Suppose we have two signals: A and B. And we need to check that the rising edge of signal B is between 7.62ns and 7.77ns after the rising edge of signal A. In VHDL this can be done with two "wait-for-until" expressions.
- Is it possible to write this with the SystemVerilog Assertion?
- Is it possible to write this with the SystemVerilog Assertion without any additional clocks?
1 Answer 1
SystemVerilog does not have direct translation of the compound VHDL wait
statements. The simple forms can be translated
wait for delay
→#delay
wait on A
→@A
wait until expression
→wait (expression)
If you needed to combine some of these forms together, they can be put into a fork/join_any
block
VHDL:
wait until sig = 15 for 10 ns;
SV:
fork
wait(sig == 15);
#10ns;
join_any
SystemVerilog Assertions are not the best construct to catch timing errors, but they can be used
property p;
realtime timestamp;
@(posedge a) ('1, timestamp = $realtime) |=>
@(posedge b) $realtime - timestamp inside {[7.62ns:7.77ns]};
endproperty
-
\$\begingroup\$ Am I right that the SV fork construction wait for the condition (sig==15) and THEN wait for 10ns and the VHDL wait-until-for construction wait 10ns waiting the condition (sig==15)? \$\endgroup\$Arseniy– Arseniy2022年08月19日 16:12:58 +00:00Commented Aug 19, 2022 at 16:12
-
1\$\begingroup\$ @Arseniy: That's what it would do without a fork. \$\endgroup\$Ben Voigt– Ben Voigt2022年08月19日 17:03:24 +00:00Commented Aug 19, 2022 at 17:03
-
1\$\begingroup\$
fork/join_any
block creates a process for each statement inside the block and waits for any one of the processes to complete before continuing after the block. In this case it is simply an OR of the conditions before continuing. Note that it does not terminate the remaining processes. There are other construct that can do that. \$\endgroup\$dave_59– dave_592022年08月19日 18:23:01 +00:00Commented Aug 19, 2022 at 18:23
Explore related questions
See similar questions with these tags.