[Next] [Up] [Previous]
Next: Loops Up: Basic concepts Previous: Wires and registers

Wait statements

The only statement that takes time in SV is the wait statement. A statement of the form

  wait(cond)
causes a delay until the condition cond is true, but always delays at least one time unit. Thus, wait(1) always waits exactly one time unit. For example,
wire x;

always
  begin
    x = 0;
    wait(1);
    x = 1;
  end
results in the observed sequence of values 0,1,0,1,...for x. Note that a new iteration of an always block begins exactly one time unit after the previous iteration terminates.

Ken McMillan
Fri Nov 6 22:15:28 PST 1998