Sequential Processing 65
WAIT UNTIL sendA = 1;
Execution stops at the first WAITstatement of the process even though
the expression sendA = 0is satisfied by the first signal assignment of
signal sendA. This is because the WAITstatement needs an event to occur
on signal sendAto cause the expression to be evaluated. Both processes
are now waiting on each other. Neither process can continue because they
are both waiting for a signal setby the other process. If a time-out in-
terval is inserted on each WAITstatement, execution can be allowed to con-
tinue. There is one catch to this last statement. Execution continues when
the condition is not met. An ASSERTstatement can be added to check for
continuation of the process without the condition being met. The following
example shows the architecture wait_examplerewritten to include time-
out clauses:
ARCHITECTURE wait_timeout OF wait_example IS
SIGNAL sendA, sendB : std_logic;
BEGIN
A : PROCESS
BEGIN
WAIT UNTIL (sendB = ‘ 1 ’) FOR 1 us;
ASSERT (sendB = ‘ 1 ’)
REPORT “sendB timed out at ‘ 1 ’”
SEVERITY ERROR;
sendA <= ‘ 1 ’ AFTER 10 ns;
WAIT UNTIL (sendB = ‘ 0 ’) FOR 1 us;
ASSERT (sendB = ‘ 0 ’)
REPORT “sendB timed out at ‘ 0 ’”
SEVERITY ERROR;
sendA <= ‘ 0 ’ AFTER 10 ns;
END PROCESS A;
B : PROCESS
BEGIN
WAIT UNTIL (sendA = ‘ 0 ’) FOR 1 us;
ASSERT (sendA = ‘ 0 ’)
REPORT “sendA timed out at ‘ 0 ’”
SEVERITY ERROR;
sendB <= ‘ 0 ’ AFTER 10 ns;
WAIT UNTIL (sendA = ‘ 1 ’) FOR 1 us;
ASSERT (sendA = ‘ 1 ’)