Scenario: Req goes High, after 10 cycle ACK should go high for 1 clk cycle.
Check : 1. Above condition 2. ACK doesnt get asserted before 10 clk 3. it remains high for 1 clk
The following code capture Check_1.
int xyz=10; //variable coming from an equation and not a constant
property assert_check_loop;
int v;
@(posedge clk) disable iff(disable_assertion)
($rose(m), v=xyz+1, $display(“2: Assertion Started %t”,time)) |-> (v>0, v=v-1'b1)[*0:] ##0 v==0 ##0 $rose(n);
endproperty : assert_check_loop
Can you please help me with Check_2 and Check_3 in the same assertion.
Thanks vdangeti for the reply. “For Check_2: use $rose (n) |-> ( $past(m,10));”
Observation: The assertion only triggered once. Even though Rose(n) appeared later in simulation, the Assertion remained in Finished state forever after once triggering.
Query: as I mentioned “10” is not fixed and hence I took “xyz”. So 10 cant be used directly in $past(m,10) at the same time being a variable it cannot be used either. Any solution?
Thanks Srini for the reply. I perfectly understand your point and concern for not mixing all three together and make it complex for debug and readability both.
But being a learner and exploring the field am interested to know how can Check_2 be clubbed together with Check_1. I tried multiple options few failed, few “Never Finished”, few gave compilation errors.
So if you can suggest me a piece of code that would be very helpful.
// Req goes High, after 10 cycle ACK should go high for 1 clk cycle.
// Check : 1. Above condition 2. ACK doesnt get asserted before 10 clk
// 3. it remains high for 1 clk
property p1_2_3;
$rose(req) |-> !ack [*9] ##1 ack ##1 !ack;
endproperty : p1
// Req goes High, after 10 cycle ACK should go high for 1 clk cycle.
// Check : 1. Above condition 2. ACK doesnt get asserted before 10 clk
// 3. it remains high for 1 clk
property p1_2_3;
$rose(req) |-> !ack [*9] ##1 ack ##1 !ack;
endproperty : p1
Thanks Srini. It looks perfect but when it comes to Variable delay and not a Fixed constant-10, is where I am stuck.
int xyz=10; //variable coming from an equation and not a constant
property assert_check_loop;
int v;
@(posedge clk) disable iff(disable_assertion)
($rose(m), v=xyz+1, $display(“2: Assertion Started %t”,time)) |-> (v>0, v=v-1'b1)[*0:] ##0 v==0 ##0 $rose(n);
endproperty : assert_check_loop
Here I wanted to use **!n in conjunction with the repeat util operator[*0:]**. something like: (v>0, v=v-1'b1,!n )[*0:]