← Design Verification Interviews
Interview Question · Concept
The Regions of a Time Slot
The Question
The interviewer asks
Walk through the regions of one simulation time slot. What runs in each, and why should a testbench writer care?
You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Preponed samples values for assertions and clocking blocks before anything changes. Active runs process code and blocking assignments, Inactive runs code delayed by #0, and NBA applies the <= updates. Observed evaluates assertions, Reactive runs their action blocks and program code, and Postponed runs $strobe and $monitor once nothing can change. Where a line of testbench code runs decides which value it sees.
Read the diagram as text
- Preponed: samples for #1step and assertions
- Active: woken processes run; <= reads its right side
- Inactive: processes resumed after #0
- NBA: pending <= updates are written
- Observed: concurrent assertions evaluate
- Reactive set: program code and assertion actions
- Postponed: $strobe prints; nothing may change
- Preponed → Active: then
- Active → Inactive: then
- Inactive → NBA: then
- Active → NBA: <= updates
- NBA → Active: wakes readers
- NBA → Observed: all three empty
- Observed → Reactive set: then
- Reactive set → Postponed: nothing left
Active, Inactive and NBA repeat until all three are empty. Only then do Observed, Reactive and Postponed run.
| Region | What happens there | A testbench consequence |
|---|---|---|
| Preponed | Values sampled for concurrent assertions and #1step clocking inputs | Checkers see the value from before the edge |
| Active | Process code, blocking assignments, <= right-hand sides | $display here sees pre-update flop values |
| Inactive | Processes resumed after #0 | Still before the NBA updates |
| NBA | <= targets updated | Flops change; processes waiting on them wake in Active again |
| Observed | Concurrent assertions evaluated | Uses Preponed samples |
| Reactive | Assertion action blocks, program code | Sees values after the NBA updates |
| Postponed | $strobe, $monitor; no new value changes allowed | Final values of the time slot |
Active, Inactive and NBA repeat until no events remain, then the Observed and Reactive set runs, and the whole loop can restart before Postponed.
One flop updated with <= at t=5, read from three regions of the same time slot.
Active: q=0 Inactive: q=0 Postponed: q=1Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer puts <= updates, #0 and $strobe in the right regions. It predicts the three lines of the run.
What Interviewers Listen For (Senior)
A good senior answer uses the regions to justify a team rule: sample through clocking blocks, check in assertions, never use #0. It says which races the rule still leaves for code review.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfProve ItBreak ItCompare
- The Regions of a Time Slot
-
WhyWhy Nonblocking Makes Process Order IrrelevantL1 Junior
Two clocked always blocks read each other's outputs. Why does
<=make the result independent of which block the simulator runs first?2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
With
<=, neither block changes a variable during the Active region; each only reads and schedules. Whichever block runs first, both read the same pre-edge values. The updates all land later, in the NBA region. With=, the first block to run changes its output before the second reads it. So the order decides the answer.Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer walks through both orders of the two blocks. It shows they give the same values with
<=and different values with=.Misconception
"
<=makes the simulator run all always blocks at the same instant."Processes still run one after another. The order stops mattering because no process sees another one's update until the NBA region.
Source IEEE 1800-2017 §4.9.4, §4.7
-
Break ItBreaking a Clocked Block with a Blocking TemporaryL1 JuniorL2 Mid-Level
A clocked block computes
tmp = a + b;and thensum <= tmp;. Another always block also readstmpat the same edge. What can go wrong?systemverilog always @(posedge clk) begin tmp = a + b; sum <= tmp; end always @(posedge clk) observed <= tmp;2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Inside the block the code is fine, because
tmpis a local temporary. The bug is the second reader: it may run before or after the first block in the same Active region. So it sees either the old or the newtmp. Keep blocking temporaries local to their block, or declare them inside it. Share only flop outputs written with<=.Two Legal Orders at One EdgeOne rising edge wakes a writer and a reader in the same Active region. Arrows from the edge and from the Active region are wake-ups and run order; arrows to and from the pins are values. Illustrative sequenceCallValueReturnWaiting- The edge wakes botht=5 (illustrative)
The rising edge at t=5 wakes the driver and the monitor. Both are now waiting to run in the Active region of the same time step.
Follow the calls, values and waits
- call driver: Rising edge → Active region
- call monitor: Rising edge → Active region
- Order A: driver firstt=5 (illustrative)
If the scheduler runs the driver first,
rdatais already a1 when the monitor reads it. The monitor sees the new beat.Follow the calls, values and waits
- call run: Active region → Racy driver
- data rdata = a1: Racy driver → racy_bus pins
- call run: Active region → Raw monitor
- data reads a1: racy_bus pins → Raw monitor
- Order B: monitor firstt=5 (illustrative)
If it runs the monitor first, the monitor reads 00, the value from before the edge. The standard allows both orders.
Follow the calls, values and waits
- call run: Active region → Raw monitor
- data reads 00: racy_bus pins → Raw monitor
- call run: Active region → Racy driver
- data rdata = a1: Racy driver → racy_bus pins
- Move the write off the edget=5 to t=7 (illustrative)
A drive through
drv_cbwith output skew 2 lands at t=7. At t=5 every reader sees 00, in any order, so the race is gone.More context
The DUT reads the pins at the same edge, so it is exposed to the race in exactly the same way as the monitor.
Follow the calls, values and waits
- data reads 00: racy_bus pins → Raw monitor
- data rdata = a1 at t=7: Racy driver → racy_bus pins
Read the diagram as text
- Rising edge: t=5: clk becomes 1
- Active region: woken processes; order not specified
- Racy driver: rdata = a1 after @(posedge clk)
- Raw monitor: reads rdata after @(posedge clk)
- racy_bus pins: rvalid, rdata
- Rising edge → Active region: wakes both
- Active region → Racy driver: runs
- Active region → Raw monitor: runs
- Racy driver → racy_bus pins: writes
- racy_bus pins → Raw monitor: reads
A result that depends on which process runs first is not a result. Remove the race; do not pick a winner.
Self-Check
Tick each key point you covered in your answer.
Half-Truth
"Mixing
=and<=in one clocked block is always illegal."The language allows it. A blocking temporary that only its own block reads is a common, safe pattern. The danger is a temporary that another process reads at the same edge.
- The edge wakes botht=5 (illustrative)
-
CompareProgram Blocks vs a Module Bench with Clocking BlocksL2 Mid-Level
Compare writing the testbench in a
programblock with writing it in a module that drives through clocking blocks.2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
A program runs its code in the Reactive region, after the design has settled, so its reads never race with design updates. A clocking block gets the same effect at the signal level. It samples inputs before the edge and drives outputs at a skew after it, from ordinary module or class code. Most class-based benches, UVM included, use modules plus clocking blocks, because programs add restrictions such as no
alwaysblocks.Self-Check
Tick each key point you covered in your answer.
Misconception
"UVM requires a program block."
UVM classes are started from a module's
initialblock; nothing in the library depends on a program.Source IEEE 1800-2017 §24.3
-
WhyWhy Program Blocks Fell Out of UseL2 Mid-LevelL3 Senior
Program blocks were added to SystemVerilog to fix testbench races. Why do most teams no longer use them?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Clocking blocks already remove the TB-to-DUT race at the signal boundary, and that is where the race actually lives. Programs add awkward rules on top, such as special rules for when the simulation ends. They also mix poorly with class-based code started from modules. The industry settled on modules, classes and clocking blocks.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Senior)
A good senior answer treats it as a cost and benefit decision. It names the race that neither construct solves: two threads inside the bench.
Spec Misquote
"Programs were removed from the standard."
They are still in IEEE 1800-2017; teams stopped choosing them.
Source IEEE 1800-2017 §24.1
-
What IfWhat an Assertion Sees vs What Its Action Block SeesL2 Mid-Level
Asked if they mention assertions
What if an assertion's fail action prints the signals it checked? Which values appear?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The assertion decided using Preponed samples, but its action block runs later, in Reactive, after the NBA updates. Printing a signal there shows its new value, which can contradict the failure. Print
$sampled(sig)to show what the assertion actually saw.Self-Check
Tick each key point you covered in your answer.
Misconception
"The action block runs at the moment of sampling, so it prints the checked values."
Sampling and the action block are in different regions of the slot; flops written with
<=at that edge have already changed.Source IEEE 1800-2017 §4.4.2.6
-
Break ItA Loop That Never Advances TimeL1 JuniorL2 Mid-Level
How can two always blocks stop simulation time from ever advancing?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Suppose each block wakes on a change that the other makes, with no delay between. The two blocks keep creating new events in the same time slot, so time never moves on. An accidental combinational loop such as
assign a = ~a;does it too. Simulators detect it with an iteration limit or appear to hang.Self-Check
Tick each key point you covered in your answer.
Misconception
"A
#0in the loop breaks it."#0stays inside the same time slot, so the loop still never reaches the next time. Only a nonzero delay or breaking the dependency helps.Source IEEE 1800-2017 §4.4.2.3
-
Prove ItSolve 6.2.1: The Pipeline That Lost a StageSimulator-graded
Show it, don't just say it: this Silicon Lab problem is graded by the simulator.
What People Get Wrong
Common wrong answers and why they fail.
Spec Misquote
"$monitor and $strobe run in the Observed region."
Observed is for evaluating concurrent assertions. The display tasks that wait for settled values run in Postponed, the read-only end of the slot.
Source IEEE 1800-2017 §4.4.2.9
Half-Truth
"Put the testbench in a program block and every race is gone."
Program code runs in Reactive, after design updates, which removes races between testbench and design. Races between two testbench threads remain, and clocking blocks give the same TB-to-DUT benefit from a module.
Source IEEE 1800-2017 §24.3
Buzzword Without Mechanism
Recites "Preponed, Active, Inactive, NBA, Observed, Reactive, Postponed" but cannot say which region updates a <= target.
The list is only useful for predicting values. An interviewer follows up with a two-line program and asks what prints.