I am trying to run following code to check a fixed delay value 4440ps . I want difference of two realtimes’ to be exactly equal to 4440ps . The difference is all correct when I keep $displays and see the logs .But the following code doesn’t pass as a checker. Please see .
realtime mc_b = 4440ps;
always begin
@(posedge di_b) //This is not a clock
start_time= $realtime;
@(posedge indd_b)
diff= $realtime - start_time;
end
property idel_b;
@(posedge indd_b) disable iff (!reset) //indd_b is a signal not a clock .
diff == mc_b ;
endproperty
CHECK_delay : assert property (idel_b);
In reply to dave_59:
Yes Dave. Agreed with you. We should avoid comparing the real values whenever it’s possible. But if needed, we can add some tolerance to avoid the rounding error.
I’ve drafted my experience with $floor in this post.