Hi,
I’m trying to implement some priority based assertion like below,
event clear_e;
bit d0,d1,d0_hit,d1_hit;
always @ (posedge L0_CLK or clear_e) begin
if(clear_e) d0 = 0;
else if($rose(Det0)) d0 = 1;
end
always @ (posedge L1_CLK or clear_e) begin
if(clear_e) d1 = 0;
else if ($rose(Det1)) d1 = 1;
end
always@(posedge L0_CLK or posedge L1_CLK or clear_e) begin
if (clear_e) begin
d0_hit = 0;
d1_hit = 0;
end
else if (d0==1 && d1 == 0) d0_hit=1;
else if(d1==1 && d0 == 0) d1_hit=1;
end
property l0_chk_p;
@(posedge CLK3)(d0_hit == 1) && !($stable(p0_l0)) |-> (rcv_p0 == p0_l0);
endproperty
l0_chk_a : assert property(l0_chk_p) begin
`uvm_info("ASSERT_PASS", $psprintf("@[%0t] PASS for L0 ", $time), UVM_LOW)
->clear_e;
end else begin
`uvm_error("IF_ASSERT", $psprintf("@[%0t] ASSET_ERR :L0 : Assertion FAILED !! \n", $time))
->clear_e;
end
property l1_chk_p;
@(posedge CLK3)(d1_hit == 1) && !($stable(p0_l1)) |-> (rcv_p0 == p0_l1);
endproperty
l1_chk_a : assert property(l1_chk_p) begin
`uvm_info("ASSERT_PASS", $psprintf("@[%0t] PASS for L1 ", $time), UVM_LOW)
->clear_e;
end else begin
`uvm_error("IF_ASSERT", $psprintf("@[%0t] ASSET_ERR :L1 : Assertion FAILED !! \n", $time))
->clear_e;
end
Here, if d0 comes first it should ignore d1 even if it hits and then after some cycles of CLK3 rcv_p0 should be equal to p0_l0 else vice versa.
I see that the d0_hit/d1_hit itself is not getting asserted.
could some one help me what I’m missing here…?