In reply to SUNODH:
Since this is a homework question, I’ll give guidelines into the solutions.
I’m writing an assertion to check at the initial stage of clk my read & write should not happen until 5 clk cycles.
One of the main requirements is “at the initial stage of clk”.
That is not well defined, but it typically means during the forst “n” clock after boot.
Assuming n==10, you could use an initial statement with a loop for 10 clocking events.
There you can write a concurrent or an immidiate assertion.
the not is aproperty operator. You need to understand what first_match is and where it is used. See my papers to get a good understanding of assertions.
Here I have 2 doubts:
can i write w_r sequence without any event or clk semantics
Yes, as long as you do not use an endpoint when tht sequence is used.
Is my understanding is correct for not w_r : It means my sequence w_r should not happen, if w_r seq occurred my assertion will show fail
In reply to SUNODH:
One of the main requirements is “at the initial stage of clk”.
That is not well defined, but it typically means during the forst “n” clock after boot.
Assuming n==10, you could use an initial statement with a loop for 10 clocking events.
There you can write a concurrent or an immidiate assertion.
Thank You Ben as per your instruction I used below logic it worked for me
In reply to SUNODH:
You can use the current assertion with the not(property).
An imediate asserion uses expressions and does not use properties.
initial
begin
repeat(10)
begin
@(posedge clk)
// That clocking event flows into the property
ap_rdwr_init: assert property (not(read || write))
$display ($time, " PASS:: write = %0d, read = %0d | @_Time = %0t\n", $sampled(write),$sampled(read),$time);
else
$fatal ($time, " FAIL:: write = %0d, read = %0d | @_Time = %0t\n", $sampled(write),$sampled(read),$time);
end
end
On first_match (not_read_write), You need to study what first_match of a sequence means,
and ask yourself what the first_match of a expression results into.
Ben
in edaplayground it is showing below error
Error-[PAOCNAILS] Procedural assertion in a loop
Procedural assertion ( i.e., assert, assume or cover property) is not allowed in looping statement.Only immediate assertions are allowed in this context.