← Design Verification Interviews
Interview Question · Design
Auto vs Explicit Register Prediction
The Question
The interviewer asks
Your register model uses auto-prediction. A boot sequence also writes registers directly on the bus. What goes wrong, and how do you set up prediction instead?
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
Auto-prediction updates the mirror only for accesses made through the register model. The boot write is invisible to it, so the mirror stays at the reset value and the next mirror(UVM_CHECK) fails. Use explicit prediction instead: connect a uvm_reg_predictor to the bus monitor. The predictor converts every observed transfer with the adapter and updates the right register. Turn auto-prediction off, so each access is predicted once.
- Start a raw item
The boot sequence sends a raw item to the sequencer. The map took no part.
Follow the calls, values and waits
- data boot apb_item: write 0 <- a5: boot_write sequence → APB sequencer + driver
- Waiting: boot_write sequence — in finish_item until item_done
- On the bus25 ns (illustrative)
The design takes a5 at the 25 ns edge.
Follow the calls, values and waits
- data pwdata = a5 at address 0: APB sequencer + driver → incr_csr.ctrl
- Observed25 ns (illustrative)
The monitor sees psel, penable and pready at the 25 ns edge and writes the transfer to its analysis port.
Follow the calls, values and waits
- data pwdata = a5 at address 0: incr_csr.ctrl → apb_monitor
- data monitor item t: write 0, a5: apb_monitor → uvm_reg_predictor
- Predicted25 ns (illustrative)
The predictor converts the item with the adapter, asks the map which register sits at address 0 and predicts it with the field's write policy. The mirror is a5, and the prediction count is 1.
Follow the calls, values and waits
- data predict a5: uvm_reg_predictor → regs.ctrl
- The boot write returns30 ns (illustrative)
The driver calls
item_doneand the boot sequence'sfinish_itemreturns. The mirror already holds a5.Follow the calls, values and waits
- return item_done: APB sequencer + driver → boot_write sequence
- Released: boot_write sequence
Read the diagram as text
- boot_write sequence: Raw apb_item, no register call
- APB sequencer + driver: Write of a5 completes at 25 ns
- incr_csr.ctrl: a5 after the 25 ns edge
- apb_monitor: Samples the completed transfer at 25 ns
- uvm_reg_predictor: bus2reg, then the map finds CTRL at address 0
- regs.ctrl: Mirror and desired become a5
- boot_write sequence → APB sequencer + driver: apb_item
- APB sequencer + driver → incr_csr.ctrl: APB write
- incr_csr.ctrl → apb_monitor: pins sampled
- apb_monitor → uvm_reg_predictor: ap.write(t)
- uvm_reg_predictor → regs.ctrl: predict a5 (write policy)
With explicit prediction, every successful access the monitor sees to a mapped register reaches the mirror. Changes the hardware makes by itself do not.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer names the invisible boot write as the cause. It draws the path: bus monitor, then predictor, then register model.
What Interviewers Listen For (Senior)
A good senior answer chooses explicit prediction for reuse, because other masters write the same registers at SoC level. It asks how failed bus transfers are handled.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfProve ItCompare
- Auto vs Explicit Register Prediction
-
WhyWhy Explicit Prediction Matters at SoC LevelL3 Senior
Why does explicit prediction matter more once the block sits inside an SoC?
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
At SoC level, a CPU model, a DMA or a debug port may write the same registers through other paths. The block's register model never starts those writes. Only a predictor listening on the block's own bus sees them all. The same prediction setup then works unchanged at both levels.
Self-Check
Tick each key point you covered in your answer.
-
What IfA Write to an Address the Map LacksL2 Mid-LevelL3 Senior
What if the predictor sees a bus write to an address that the register map does not contain?
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 predictor updates nothing. The uvm-core library reports it only as an info message at
UVM_FULLverbosity, so a normal run prints nothing. That can hide a decode bug, or a register missing from the model. Raise the verbosity for that message in a check run, or count such writes yourself.Self-Check
Tick each key point you covered in your answer.
Tool as Truth
"A write to an unknown address would show up as a UVM error."
The predictor reports
REG_PREDICT_NOT_FOR_MEatUVM_FULL. At default verbosity it is not printed.Source uvm-core 2020.3.1 (IEEE 1800.2 library) source, reg/uvm_reg_predictor.svh (REG_PREDICT_NOT_FOR_ME, UVM_FULL)
-
What IfPredicting from an Errored TransferL3 Senior
What if a register write ends with an error response, such as
PSLVERR, and the register did not change?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
It depends on the adapter and the UVM version. In uvm-core, the predictor passes the status from
bus2reg(), and the register skips a prediction markedUVM_NOT_OK. Sobus2reg()must map the error toUVM_NOT_OK. The UVM Cookbook, written for UVM 1.1, says the status is ignored there. Older benches therefore filter errored transfers before the predictor.Self-Check
Tick each key point you covered in your answer.
Spec Misquote
"The predictor always ignores errors, so the mirror is always updated."
That was the UVM 1.1 behaviour the Cookbook describes. In uvm-core 2020.3.1,
do_predict()skips aUVM_NOT_OKitem with a warning.Source uvm-core 2020.3.1 (IEEE 1800.2 library) source, reg/uvm_reg.svh (do_predict: "status UVM_NOT_OK; skip prediction")
-
Prove ItConnecting an Explicit PredictorL2 Mid-Level
Prove it: write the connect-phase code that sets up explicit prediction.
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
Give the map its sequencer and adapter, and turn auto-prediction off. Point the predictor at the map, so it can find a register by address. Give it the adapter, so it can convert bus items. Then connect the bus monitor's analysis port to the predictor's
bus_in.Four connections: sequencer and adapter, prediction off, map and adapter, monitor to predictor. function void connect_phase(uvm_phase phase); regs.default_map.set_sequencer(apb.sqr, adapter); regs.default_map.set_auto_predict(0); // one prediction path only predictor.map = regs.default_map; // address -> register predictor.adapter = adapter; // bus item -> register operation apb.mon.ap.connect(predictor.bus_in); // every observed transfer endfunctionSelf-Check
Tick each key point you covered in your answer.
Missed Corner
Connects the predictor to the driver instead of the monitor.
The driver sees only the model's own items, which is auto-prediction again. Other masters' writes still go unseen.
Source Verification Academy, UVM Cookbook, Registers: explicit prediction listens to the bus agent's monitor (PDF p337)
-
CompareWhen Auto-Prediction Is Good EnoughL2 Mid-Level
Compare the two modes. When is auto-prediction good enough?
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
In a unit bench where the register model is the only master on the bus. It needs no monitor or predictor, so it is quick to set up. As soon as anything else can write the registers, switch to explicit prediction.
Self-Check
Tick each key point you covered in your answer.
What People Get Wrong
Common wrong answers and why they fail. Run It shows the wrong belief failing on a real simulator.
Misconception
"With auto-prediction on, the mirror follows every write to the DUT."
It hooks only the register model's own accesses. The twin's boot write goes straight to the sequencer, so the mirror stays at 1 and the check fails.
Run It
A raw APB boot write, then a mirror check, with auto-prediction on and no predictor.
25 ns APB write addr=0 data=a5 30 ns after the boot write: mirrored=1 FAIL: auto-prediction saw only model calls, so the raw write left a stale mirror of 1 UVM_ERROR : 1Missed Corner
"Keep auto-prediction on as well as the predictor, to be safe."
Each model access is then predicted twice. For a toggle-on-write field (W1T), two predictions toggle the mirror twice, so it ends wrong.
Source uvm-core 2020.3.1 (IEEE 1800.2 library) source, reg/uvm_reg_field.svh (W1T prediction: current value XOR written value)
Wrong Altitude
"Explicit prediction is the newer, better API, so always use it."
It costs a monitor and a predictor. In a unit bench where the model is the only bus master, auto-prediction is enough and simpler.