0
0
VHDLprogramming~10 mins

Stimulus process with wait statements in VHDL - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Stimulus process with wait statements
Start process
Apply stimulus
Wait for time or event
Apply next stimulus
Wait again
Repeat or end
The process applies signals, then waits for a specified time or event before continuing to the next step.
Execution Sample
VHDL
stim_proc: process
begin
  signal_a <= '0';
  wait for 10 ns;
  signal_a <= '1';
  wait for 20 ns;
  wait;
end process stim_proc;
This process sets signal_a to '0', waits 10 ns, sets it to '1', waits 20 ns, then stops.
Execution Table
StepTime (ns)Actionsignal_a ValueWait Statement
10Set signal_a to '0''0'wait for 10 ns
210Wait ends, set signal_a to '1''1'wait for 20 ns
330Wait ends, process waits indefinitely'1'wait (infinite)
4-Process stops here, no further action'1'no further wait
💡 Process stops at infinite wait statement, no further stimulus applied
Variable Tracker
VariableStart (0 ns)After 1 (10 ns)After 2 (30 ns)Final
signal_a'0''1''1''1'
Key Moments - 2 Insights
Why does the process stop after the last wait statement?
Because the last wait statement is 'wait;' with no condition or time, it causes the process to pause indefinitely, as shown in execution_table step 3.
Does the signal change immediately after the wait statement?
No, the signal changes happen right after the wait period ends, as seen between steps 1 and 2 in the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the value of signal_a at 15 ns?
AUndefined
B'0'
C'1'
DProcess stopped
💡 Hint
15 ns is between step 2 (10 ns, '1') and step 3 (30 ns, '1') in the execution_table.
At which step does the process enter an infinite wait?
AStep 1
BStep 3
CStep 2
DStep 4
💡 Hint
Look at the Wait Statement column in the execution_table for the infinite wait.
If the first wait was changed to 'wait for 5 ns;', how would signal_a change at 7 ns?
Asignal_a would be '1'
Bsignal_a would still be '0'
Csignal_a would be undefined
DProcess would stop
💡 Hint
Refer to variable_tracker and execution_table timing for signal changes after wait periods.
Concept Snapshot
Stimulus process uses wait statements to control timing.
Signals change, then process waits for time or event.
'wait for time;' pauses process for that duration.
'wait;' pauses process indefinitely.
Useful for testbenches to apply signals step-by-step.
Full Transcript
This VHDL stimulus process example shows how signals are assigned values and then the process waits for specified times before continuing. Initially, signal_a is set to '0' at time 0 ns. The process then waits for 10 ns. After 10 ns, signal_a changes to '1'. The process waits another 20 ns. At 30 ns, the process reaches an infinite wait statement and stops executing further. The variable tracker shows signal_a starting undefined, then becoming '0' at 0 ns, and '1' at 10 ns, remaining '1' thereafter. Key points include understanding that signals change right after wait periods end, and that a plain 'wait;' causes the process to pause forever. The quizzes test understanding of signal values at specific times and the effect of wait statements on process flow.