← Design Verification Interviews
Interview Question · Design
Designing the Bench for a DMA Engine
The Question
The interviewer asks
Design the testbench for a DMA engine. It has an APB register port, an AXI master port to memory, and an interrupt line. What goes where?
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
An APB agent with a register model and explicit prediction programs the DMA. A reactive AXI slave agent answers reads from a memory model and records writes. A predictor reads each programmed transfer from the register model and computes the expected memory writes. A scoreboard compares those with the writes the AXI monitor saw. An interrupt monitor checks when the interrupt rises and clears, and a virtual sequence ties the steps together.
Read the diagram as text
- Virtual sequence: Programs a transfer, then waits for the interrupt
- APB agent: Writes DMA registers; its monitor feeds a register predictor
- DMA engine: The design under test
- AXI slave agent: Reactive: answers reads from a memory model, records writes
- Register model: Mirror of the programmed transfer (explicit prediction)
- Predictor: Computes the memory writes the transfer must make
- Scoreboard: Expected writes vs observed writes
- Interrupt monitor: Checks when the interrupt rises and clears
- Virtual sequence → APB agent: register writes
- APB agent → DMA engine: APB transfers
- DMA engine → AXI slave agent: AXI reads, writes
- APB agent → Register model: observed writes
- Register model → Predictor: programmed transfer
- Predictor → Scoreboard: expected writes
- AXI slave agent → Scoreboard: observed writes
- DMA engine → Interrupt monitor: irq line
Each part has one job: stimulus, a reply, a prediction or a check. That split is what lets most of the bench survive at SoC level.
| Component | Job | Why it is separate |
|---|---|---|
| APB agent + register model | Program and read back the DMA | Reused passive at SoC level, behind a CPU |
| AXI slave agent (reactive) | Answer reads, accept writes, add delays and errors | Memory behaviour is stimulus, not checking |
| Memory model | Hold source data and descriptors | Shared by the slave and the predictor |
| Predictor | Turn programmed transfers into expected writes | Written from the spec, not from the RTL |
| Scoreboard | Compare expected and observed writes | Gives the exact failing transfer |
| Virtual sequence | Program, start, wait for the interrupt, check | Coordinates two agents |
Each component exists because of one check or one stimulus need.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Senior)
A good senior answer draws the agents, the predictor, the scoreboard and the virtual sequence. It justifies each part by what it checks.
What Interviewers Listen For (Staff)
A good staff answer plans for reuse at SoC level and names the risky areas, such as descriptor chains and memory errors. It also gives an order for building the bench.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfBreak ItCompareScale It
- Designing the Bench for a DMA Engine
-
WhyWhy Memory Is a Reactive AgentL3 Senior
Why model the memory with a reactive slave agent, rather than a plain SystemVerilog memory module?
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 plain memory module answers the same way every time. A reactive agent takes its responses from sequences, so a test can add wait states, back-pressure and error responses on chosen beats. Its monitor also publishes every transfer for the scoreboard and coverage. The memory storage itself can stay a simple model that both the agent and the predictor read.
The Design Starts the Conversation; the Sequence AnswersA reactive slave agent answering a bus master. Arrows are item handoffs and pin activity for one request. Illustrative sequenceCallValueReturnWaiting- Tell me what to do (0 ns)
The responder sends an empty request item with
start_itemandfinish_item. The driver takes it withget_next_itemand waits forreq.Follow the calls, values and waits
- call get_next_item: Slave driver → Slave sequencer
- data request item: Responder sequence → Slave sequencer
- data request item: Slave sequencer → Slave driver
- Waiting: Responder sequence — in finish_item(request)
- Waiting: Slave driver — waiting for req
- This is what the master asked (35 ns)
Master 0 raised
reqfor its write to 0x10. The driver copieswe,addrandwdatainto the same object and callsitem_done; the responder'sfinish_itemreturns.Follow the calls, values and waits
- data write 0x10 <= 0x5a: Bus master (DUT) → Slave driver
- call item_done: Slave driver → Slave sequencer
- data request item: Slave sequencer → Responder sequence
- Released: Responder sequence
- Released: Slave driver
- Here is the reply (35 ns)
The responder stores 0x5a, randomizes a reply item under its constraints and sends it. No simulation time passes.
Follow the calls, values and waits
- data mem[0x10] = 0x5a: Responder sequence → Memory model
- data reply item: Responder sequence → Slave driver
- Waiting: Responder sequence — in finish_item(reply)
- Done (45 ns)
The driver drives
ack,rdataanderrfor one clock and callsitem_done. The master samplesackat 45 ns.Follow the calls, values and waits
- data ack, err=0: Slave driver → Bus master (DUT)
- Released: Bus master (DUT)
- Released: Responder sequence
Read the diagram as text
- Bus master (DUT): Plain module with a fixed script
- Slave driver: Moves fields between pins and items
- Slave sequencer: One responder per sequencer
- Responder sequence: forever loop, decides every reply
- Memory model: Associative array inside the sequence
- Responder sequence → Slave sequencer: 1. empty request item
- Slave driver → Slave sequencer: 1. get_next_item(request)
- Bus master (DUT) → Slave driver: 2. req, we, addr, wdata
- Slave sequencer → Responder sequence: 2. item_done: finish_item returns the filled request
- Responder sequence → Memory model: 3. store or look up
- Responder sequence → Slave driver: 3. reply item: rdata, err, wait_cycles
- Slave driver → Bus master (DUT): 4. ack, rdata, err
Swap the responder box and only the reply rule changes; the driver and item stay.
Self-Check
Tick each key point you covered in your answer.
Half-Truth
"A memory module is enough; the DMA only needs data back."
Then no test can make memory slow or return an error. The DMA's stall and error paths stay untested.
- Tell me what to do (0 ns)
-
What IfAn Error Response on One Chosen BeatL3 Senior
What if a test needs the memory to return an error on one beat of one transfer? How does it do that?
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 test starts a different responder sequence on the slave agent. That sequence answers normally until the chosen address and beat, then returns an error response. The driver is unchanged, because the sequence picks the reply. The scoreboard is told the same plan, so it expects the DMA to stop or report.
Self-Check
Tick each key point you covered in your answer.
Wrong Altitude
"Force the memory output to an error value."
A force bypasses the protocol and cannot target one beat cleanly. The monitor and coverage never see a legal error response.
-
CompareEnd-State Check vs Stream CheckL3 Senior
Compare checking memory contents at the end with checking each write as it happens.
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
An end-state check is simple and catches wrong final data. It misses writes outside the buffer that were later overwritten, repeated writes and wrong order. A stream check compares each write as it arrives, so it points at the exact transfer. Many benches do both: stream checks for debug, and an end check as a safety net.
Self-Check
Tick each key point you covered in your answer.
-
What IfA DMA That Follows Descriptors in MemoryL3 Senior
What if the DMA follows a chain of descriptors that it reads from memory?
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
Then the descriptors live in the memory model, and the predictor must read the same memory, not the register model. Build the chain in the test, write it into memory by backdoor, and point the DMA at its head. Check the descriptor reads too, not only the data writes.
Self-Check
Tick each key point you covered in your answer.
-
Break ItThe Bug This Bench Would MissL3 SeniorL4 Staff
What kind of bug would this bench miss?
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
One that the predictor shares with the RTL, such as the same misreading of the descriptor format. Both agree, so every check passes. An independent model author, spec reviews, and a few directed tests with results worked out by hand protect against this.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Staff)
A good staff answer names a shared misreading of the spec as the main risk of any model-based bench. It plans for an independent model author and spec reviews.
-
Scale ItWhat of the DMA Bench Survives at SoC LevelL4 Staff
Scale it: at SoC level, what of this bench survives?
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 APB agent turns passive behind the CPU, and real memory replaces the slave model. The predictor and scoreboard survive if they listen only to monitors. The predictor must read memory through an interface that either the model or a backdoor to real memory can serve. Software or a CPU model replaces the virtual sequence.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Staff)
A good staff answer designs the predictor's memory access as a swappable interface at block level. Then reuse at SoC level costs only wiring.
What People Get Wrong
Common wrong answers and why they fail.
Wrong Altitude
Lists UVM classes without saying what each one checks.
A class list is not a design. Each component should exist because of a check or a stimulus need.
Half-Truth
"A memory slave that answers every access at once and OK is enough."
A DMA must survive slow memory and error responses. A slave that never stalls and never returns SLVERR never exercises those paths.
Buzzword Without Mechanism
"I would use the standard UVM architecture."
That says nothing about this DMA. Name the agents, the model, what is compared, and when.