I wanted to write an assertiion such that the delay between the “a” rise to “b” rise should be 2.1ns.
Written below code, buts it is not working. Any idea?
What do you mean by “it is not working” ? Do you see a compilation error or assertion failure or do you mean the assertion isn’t working as per intention
What are the timeunits and timeprecison in the module/checker where these assertions are written ?
What are the units and precision of the module where the clock is generated ?
Note that $realtime returns a real value scaled to the timeunits of the module/checker where the assertion is written.
So if the units of the clock generator are different than the units of the assertion,
the value returned by $realtime could be different than expectation.
Compile is fine, but assertion is not failing as intended. Basically when “a” rise and “b” rise is at same clock. Assertion should fail as the delay between them will be 0.
timeunit is ns with precision is ps;
I am using EDA playgroud to run the assertion. So timeunit/precicion problem will not be there as have single module.
Using the go-to repetition operator [->1] via $rose(i_gpio)[->1] it essentially waits for the 1st occurrence of $rose(i_gpio).
Due to overlapping implication , $rose(i_gpio) is checked from same clock tick when the antecedent is true.