← Design Verification Interviews
Interview Question · Concept
Analysis FIFOs vs Write Functions
The Question
The interviewer asks
A scoreboard takes inputs from one monitor and outputs from another. Compare two uvm_analysis_imp_decl write functions with two uvm_tlm_analysis_fifos.
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
With imps, write_in() and write_out() each run inside the monitor's call, in zero time. The scoreboard must store and match items inside those functions. With analysis FIFOs, writes are queued. The scoreboard pulls them with get() in its own run_phase, so it can wait for the other side. Imps suit simple immediate checks. FIFOs suit checks that wait or match in order across streams.
in_mon are calls of write, numbered in the order this library makes them. The FIFO's arrow to the checker is a returned handle.- Publish10 ns (illustrative)
At 10 ns
in_moncallsap.write(#1)once. The port callswriteon each of its three resolved imps, in turn, inside that one call.Follow the calls, values and waits
- call write(#1): in_mon → chk.fifo
- call write(#1): in_mon → cov
- call write(#1): in_mon → sb
- Return10 ns (illustrative)
Every
writeis a function, so all three finish at 10 ns andin_mongoes on at once. The FIFO stored the handle;covandsbdid their work. - Consume later10 ns (illustrative)
The checker's own thread takes #1 from the FIFO at 10 ns and works on it for 25 ns. The monitor never waited for it.
Follow the calls, values and waits
- return #1: chk.fifo → chk run_phase
- Waiting: chk run_phase — working on #1 until 35 ns
- Second input15 ns (illustrative)
At 15 ns
out_monwrites the result to the scoreboard's second imp, which callswrite_out.Follow the calls, values and waits
- call write_out(#1): out_mon → sb
- Publish #2 into a busy checker20 ns (illustrative)
At 20 ns
in_monwrites #2. The FIFO stores it although the checker is still busy with #1.Follow the calls, values and waits
- call write(#2): in_mon → chk.fifo
- call write(#2): in_mon → cov
- call write(#2): in_mon → sb
- Take #235 ns (illustrative)
At 35 ns the checker finishes #1 and takes #2, which has waited in the FIFO since 20 ns.
Follow the calls, values and waits
- return #2: chk.fifo → chk run_phase
- Waiting: chk run_phase — working on #2 until 60 ns
- Released: chk run_phase
- Finish60 ns (illustrative)
The checker finishes #2 at 60 ns: it took 2 and finished 2.
Follow the calls, values and waits
- Released: chk run_phase
Read the diagram as text
- in_mon: ap.write(t) at 10 and 20 ns
- chk.fifo: Analysis FIFO, unbounded
- cov: uvm_subscriber: write(t)
- sb: write_in(t) and write_out(r)
- chk run_phase: fifo.get(t), then 25 ns of work
- out_mon: ap.write(r) at 15 and 25 ns
- in_mon → chk.fifo: 1: write(t)
- in_mon → cov: 2: write(t)
- in_mon → sb: 3: write_in(t)
- chk.fifo → chk run_phase: t returns to get(t)
- out_mon → sb: write_out(r)
The publisher's code does not change with the number of listeners, zero included.
Two write functions
`uvm_analysis_imp_decl(_in)
`uvm_analysis_imp_decl(_out)
function void write_in(item t); exp.push_back(model(t)); endfunction
function void write_out(item t); compare(exp.pop_front(), t); endfunction
Zero time, inside the monitor's call
Two analysis FIFOs
uvm_tlm_analysis_fifo #(item) in_f, out_f;
task run_phase(uvm_phase phase);
forever begin
in_f.get(i); out_f.get(o);
compare(model(i), o);
end
endtask
Own thread, can wait for the other stream
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer explains why one class cannot have two write() methods. It says what the uvm_analysis_imp_decl macro generates.
What Interviewers Listen For (Mid-Level)
A good mid-level answer chooses by whether the check must wait for the other side. It checks that both FIFOs are empty at the end.
What Interviewers Listen For (Senior)
A good senior answer talks about memory in long runs. It explains how a stream with no partner shows up in each style.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfProve ItCompareScale It
- Analysis FIFOs vs Write Functions
-
WhyWhat the Imp Decl Macro GeneratesL1 Junior
Why does a scoreboard with two analysis inputs need
uvm_analysis_imp_decl?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
uvm_analysis_impcalls a method named exactlywritein its parent. Two inputs would both call that one method, and the scoreboard could not tell them apart. The macro declares a new imp class, such asuvm_analysis_imp_in, that callswrite_in()instead.Self-Check
Tick each key point you covered in your answer.
Half-Truth
"Use one write and check the item type to see where it came from."
Both monitors often send the same item type, so the type says nothing about the source.
Source Verification Academy, UVM Cookbook, Analysis Components (PDF p160)
-
What IfTwo Scoreboard Inputs in the Same Time StepL2 Mid-Level
What if both inputs arrive in the same time step, and the scoreboard compares inside
write_out()?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 two calls come from separate monitor processes, so their order in one time step is not fixed. If
write_out()runs first, the expected item is not there yet and the compare fails falsely. Store both sides and compare when both are present. Or use analysis FIFOs and get from both inrun_phase.Self-Check
Tick each key point you covered in your answer.
Misconception
"Inputs are processed in connect order, so the input side comes first."
The calls come from separate monitor processes. Their order in one time step is not defined.
Source IEEE 1800-2017 §4.7
-
CompareAnalysis FIFO vs a Queue in the ScoreboardL2 Mid-Level
Compare an analysis FIFO with a plain queue that
write_in()pushes into.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
Both store items until their partner arrives. A plain queue is lighter, and it is enough when
write_out()does the matching. It has no blocking read, though, so a thread that wants to wait for an item must poll. The FIFO gives a blockingget(), pluspeek()andused(), so a matching thread can simply wait.Self-Check
Tick each key point you covered in your answer.
Buzzword Without Mechanism
"A queue inside the scoreboard is not proper UVM."
UVM does not require FIFOs. The choice depends on whether a thread must wait for items.
-
What IfItems Left in a FIFO at the EndL2 Mid-Level
What if one FIFO still holds items when the test ends?
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
Those items never met a partner, so something is wrong: the DUT lost a response, or the test ended too early. In
check_phase, reportused()for each FIFO as an error, with the first leftover item printed. Then a lost response fails the test instead of vanishing.Self-Check
Tick each key point you covered in your answer.
Misconception
"Leftovers are normal noise at the end of a test."
Each leftover is an input with no output or the reverse. Hiding them hides dropped transactions.
Source Verification Academy, UVM Cookbook, Analysis Components: comparator checks (PDF p170-173)
-
Scale ItMemory Growth in a Long TestL3 Senior
A ten-million-transaction test slowly runs out of memory. The bench uses analysis FIFOs. Where do you look 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
Print
used()for each analysis FIFO during the run. If one keeps growing while its partner stays empty, nothing is consuming it. Perhaps the matching thread died or waits on the wrong FIFO. An unbounded FIFO hides that for millions of items. Fail the test whenused()passes the most transactions that can legally be in flight.Self-Check
Tick each key point you covered in your answer.
Tool as Truth
"The simulator leaks memory; give the job more RAM."
An unbounded FIFO that nobody reads keeps every item it was given. Check the bench's own queues before blaming the tool.
Source uvm-core 2020.3.1 (IEEE 1800.2 library) source, tlm1/uvm_tlm_fifos.svh, uvm_tlm_analysis_fifo is unbounded
-
Prove ItSolve U3.4.1: The Trace Window That Never Drops QuietlySimulator-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.
Misconception
"An analysis FIFO can fill up and stall the monitor."
An analysis FIFO is unbounded, so write() never blocks. The risk is the opposite: it grows without limit.
Source uvm-core 2020.3.1 (IEEE 1800.2 library) source, tlm1/uvm_tlm_fifos.svh, uvm_tlm_analysis_fifo::new: super.new(name, parent, 0), "must be unbounded"
Misconception
"Just declare write() twice with different argument names."
A class can have only one method called write. The macro makes a new imp class that calls write_in or write_out instead.
Source Verification Academy, UVM Cookbook, Analysis Components: uvm_analysis_imp_decl (PDF p160)
Missed Corner
Never checks the FIFOs at the end of the test.
Items left in a FIFO were never compared. Without an end check, lost responses pass silently.
Source Verification Academy, UVM Cookbook, Analysis Components: comparator end-of-test checks (PDF p170-173)