4
\$\begingroup\$

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.

  1. Is it possible to write this with the SystemVerilog Assertion?
  2. Is it possible to write this with the SystemVerilog Assertion without any additional clocks?
asked Aug 19, 2022 at 9:17
\$\endgroup\$

1 Answer 1

4
\$\begingroup\$

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 expressionwait (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
answered Aug 19, 2022 at 15:54
\$\endgroup\$
3
  • \$\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\$ Commented Aug 19, 2022 at 16:12
  • 1
    \$\begingroup\$ @Arseniy: That's what it would do without a fork. \$\endgroup\$ Commented 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\$ Commented Aug 19, 2022 at 18:23

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.