I have looked at the switch model and I don't understand why the wait
statement includes "until ThenTime_v /= now"
It seems to me that this would trigger the process as soon as the time
counter advances. A colleague even tells me that this condition will
never be met since the function "now" won't generate an event.
Nicolas,
The *complete* wait statement in the switch model is
wait
on A(I)'transaction, B(I)'transaction, Cab(I)'transaction
until ThenTime_v /= now;
This wait statement has an explicit sensitivity list ("wait on").
So there is no need for the "until" condition to generate an
event; indeed, as you say, it cannot because ThenTime_v is a
variable and NOW is a function; neither can generate an event.
In effect it says:
Every time there is a transaction on one or more of
the signals {A(I), B(I), Cab(I)}, evaluate the expression
ThenTime_v/=now; if it's false, go back to waiting; but
if it's true, proceed.
So the wait will be released on the first transaction (driver
update) on any of those signals that occurs after the current
moment of simulation time.
Your colleague's point about "condition will never be met"
is based on a small misunderstanding. If you write
wait until <<condition>>;
then the wait statement has an implicit sensitivity list
built from every signal that appears in the <<condition>>.
But if the wait statement has an explicit sensitivity
list, then no implicit sensitivity list is required.
So:
wait until now >= 2 us;
is wrong - it will block forever.
But
wait on sig until now >= 2 us;
is OK; it will release at the first event on "sig"
that happens at or after time 2us.
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
(e-mail address removed)
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.