could you please help on how to write an assertion such that between two requests there should be one grant. I have written the following. could you please conform whether it is correct.
// One mistake:
$rose(req) |-> !req[*1:$]
// at the $rose(req) req==1, thus with the |-> the req cannot be ==0 in the same cycle.
// you meant
$rose(req) |-> strong(##1 !req[*1:$] ##1 grant && req==0) ); // OK
// says, at rose of req, no req until grant && req==0
//
// This can also be expressed as
$rose(req) |-> strong( ##1 req[->1] intersect ##1 grant && !req[->1]) 0;
In reply to harsh pandya:
yes, this is another approach. It’s really how one sees it, and they are ALL OK.
The (!req until_with grant); is more English-like, but you have to mentally visualize the meaning of the waveform or review the meaning of this property.
The req[->1] intersect ##1 grant && !req[->1] is more waveform style where you
visualize 2 signals and see when to evaluate a gated signal.
The **(##1 !req[*1:$] ##1 grant && req==0)**is more stream-like where you have a stream of possible scenarios.
One may argue at my visualization approach, but this is how I see it. Having worked a lot with waveforms and hardware, I tend to avoid the English-like approaches, but this is me.
Ben