TO Be coming

Nov 28, 2026

UVM Course: Day 27: Capstone Project (Day 1 of 3) — DUT Selection and Testbench Architecture

Day 27: Capstone Project (Day 1 of 3) — DUT Selection and Testbench Architecture
Advertisement
Top banner — drop your 728×90 or responsive ad unit here.

Day 27: Capstone Project (Day 1 of 3) — DUT Selection and Testbench Architecture

A 30-day SystemVerilog/UVM verification series. Twenty-six days of building blocks. Three days of putting them all together. Today, the plan. Tomorrow, the code. The day after, the proof.

The capstone is not a new topic. It is the moment the previous 26 days either work as a whole or don't. Every mechanism you have learned — agents, sequences, scoreboard, coverage, RAL, virtual sequencer, drain time, regression — has to fit into one testbench without breaking any of the others. That is what a real UVM project is, and it is why the capstone is three days, not one.

Today is architecture. No code worth writing yet, except the skeleton and the plan. The testbench you build tomorrow is only as good as the decisions you make today.


1. DUT Selection

Three candidates, in increasing complexity. Choose one; you can extend the same structure to a bigger DUT later.

DUTComplexityWhat it exercises from the course
APB UARTMediumBus protocol, register file, data path, error conditions, parity, baud rate
GPIO ControllerLow–MediumRegister file, interrupts, pin muxing, edge detection
FIFO with APB register interfaceLowEverything from Days 1–21, with a clean reference DUT that you can easily break to test the checker

Pick the one you have the RTL for. If you have all three, the FIFO with APB register interface is the best learning vehicle: it exercises every layer you have built, has well-understood expected behavior (so the model is easy to write correctly), and has enough corner cases (full, empty, wrap-around, reset) to make the coverage model meaningful.

The rule for choosing a DUT: pick the largest one whose specification you can hold in your head at once. If you find yourself re-reading the spec to remember what a register does, the DUT is too large for a three-day capstone. Shrink it, then extend later.

2. The Architecture Diagram

Before writing any code, draw the testbench. The diagram for the FIFO-with-APB-registers capstone looks like this:

                        ┌──────────────────────────────────┐
                        │  fifo_capstone_test              │
                        │  (chooses sequence, configures)  │
                        └──────────────┬───────────────────┘
                                       │ creates
                        ┌──────────────▼───────────────────┐
                        │  fifo_capstone_env               │
                        └──┬────────────────┬────────────┬─┘
                           │                │            │
                ┌──────────▼──────┐  ┌──────▼──────┐  ┌──▼────────────┐
                │  apb_agent      │  │  ref_model  │  │  reg_scoreboard│
                │  (active)       │  │             │  │  (analyzes     │
                │                 │  │             │  │   reads/writes)│
                │  ┌───────────┐  │  └──────┬──────┘  └──▲─────────────┘
                │  │ driver    │  │         │            │
                │  │ sequencer │  │         │            │
                │  │ monitor   │──┼─────────┼────────────┘
                │  └───────────┘  │         │
                └─────────────────┘         │
                        │                   │
                        │  APB vif          │
                        ▼                   │
                ┌───────────────────────┐   │
                │  DUT: FIFO + APB regs │   │
                └───────┬───────────────┘   │
                        │                   │
                        │  FIFO data path   │
                        ▼                   │
                ┌───────────────────┐       │
                │  fifo_data_if     │       │
                │  (write/read pins)│       │
                └───────┬───────────┘       │
                        │                   │
                ┌───────▼───────────┐       │
                │  fifo_data_monitor│───────┘
                │  (publishes data  │
                │   to model/coverage│
                │   /scoreboard)    │
                └───────────────────┘

                        ┌────────────────────┐
                        │  virtual sequencer │
                        │  (coordinates apb  │
                        │   and data paths)  │
                        └────────────────────┘

Three observations from the diagram:

  • The APB agent drives the register bus. All register reads and writes go through it. RAL connects to its sequencer through the adapter.
  • The FIFO data path is separate. It has its own monitor, its own transaction type, and its own coverage. Do not try to shoehorn data-path transactions through the APB monitor.
  • The reference model sits between them. It watches APB register writes (e.g., a "push data" write) and predicts what the FIFO data path should emit next.

3. The Component List

Every file you are going to write. This is the build plan for Days 28 and 29.

FileLayerStatus
apb_if.svInterfaceFrom Day 22
apb_transaction.svTransactionFrom Day 22
apb_driver.sv, apb_monitor.sv, apb_sequencer.sv, apb_agent.svAgentFrom Day 22
fifo_data_if.svInterfaceFrom Day 4
fifo_tx.svTransactionFrom Day 4
fifo_data_monitor.svMonitorFrom Day 4 (no driver needed — the DUT drives the data)
dut_reg_block.sv, ctrl_reg.sv, status_reg.sv, data_reg.svRALFrom Days 15–17
apb_reg_adapter.svRALFrom Day 22
fifo_ref_model.svModelNew
fifo_reg_scoreboard.svCheckerFrom Day 9, adapted
fifo_data_scoreboard.svCheckerFrom Day 9
fifo_capstone_coverage.svCoverageFrom Day 10, extended
fifo_capstone_vseqr.svCoordinatorFrom Day 8, extended
fifo_capstone_seq_lib.svSequencesNew
fifo_capstone_env.svEnvNew — wires everything
fifo_capstone_test.sv, fifo_capstone_err_test.svTestsNew
fifo_capstone_tb_top.svTopNew

Roughly forty files, but most of them are one you have written before. The genuinely new work is the reference model, the env wiring, and the top. That is why Days 28–29 are enough time: the rest is assembly.


4. The Register Plan

The register model is the DUT's public API. Write it out before writing the SV. This is the same table the DUT's spec provides, but in the form you will need for the RAL model:

OffsetNameFieldsAccessReset
0x00CTRLEN[0], MODE[2:1], RST[3]RW0x0
0x04STATUSFULL[0], EMPTY[1], ERR[2]RO0x2 (empty)
0x08DATADATA[7:0]WO/RO (push/pop)0x0
0x0CINT_ENFULL_EN[0], EMPTY_EN[1], ERR_EN[2]RW0x0
0x10INT_STATFULL[0], EMPTY[1], ERR[2]W1C0x0

Two subtleties worth checking before Day 28:

  • DATA is WO on write (push) and RO on read (pop). This is unusual for uvm_reg — a single field cannot have different access on read vs. write. The standard trick is to model DATA as two fields (or two registers at the same offset with different access policies). Decide now which approach you will use.
  • INT_STAT is W1C. Do not model it as RW. If you do, every interrupt-flag test will fail with a mismatch that looks like a DUT bug but isn't.

5. The Sequence Plan

Five sequences, in order of complexity. Each targets a category of bug.

SequenceWhat it provesRuntime
fifo_reset_seqAll registers reset to spec values.< 1µs
fifo_write_read_seqWrite a value, read it back — the data path works.~10µs
fifo_full_seqWrite until FULL asserts; verify STATUS. Then write again and verify the DUT rejects.~50µs
fifo_empty_seqRead until EMPTY asserts; verify STATUS. Then read again and verify the DUT rejects.~50µs
fifo_wrap_seqFill, drain, fill again — the pointer wraps correctly and data is not corrupted.~100µs

The sequence library also includes the standard RAL sequences from Day 20 — uvm_reg_hw_reset_seq, uvm_reg_bit_bash_seq, uvm_reg_access_seq — which you run as-is. Together they form the smoke regression.


6. The Coverage Plan

Coverage is a declaration of intent. Every line below maps to a covergroup bin, and every line corresponds to a real verification goal.

Coverage goalCovergroup / bin
Write a value, read it back correctlycross_wr_rd / single_pair
Write while FULLcp_full intersect {1} on push
Read while EMPTYcp_empty intersect {1} on pop
Data at extremes (0x00, 0xFF)cp_wdata / zero, max
Data at mid-rangecp_wdata / low, high
Pointer wrap-aroundcp_wr_ptr / max_to_zero
Reset to reset (no data corruption)cp_reset_after_data
Concurrent write+readcross_wr_rd / simultaneous

Eight goals. If the DUT's spec says any of these are legal, all eight must be closed. If a spec line is absent from the coverage plan, the coverage is incomplete.

The most common capstone mistake: writing coverage bins after the testbench, in a rush to close the number. That produces coverage that hits the number without verifying the DUT. Write the coverage plan today, from the spec, and make Day 29's job to hit it — not to invent it.

7. What Day 28 Will Add

Tomorrow: Capstone Project (Day 2 of 3) — Build. You will implement the file list above, start with the DUT and the interfaces, then the agent and monitor, then the scoreboards and reference model, and get a smoke test running by end of day. The wiring is the hard part; individual components are already familiar.


8. Quiz

Ten questions on capstone planning — architecture, register model, sequences, coverage.

Question 1 of 10
Loading…
    0 / 10
    Advertisement
    Bottom banner — drop your 728×90 or responsive ad unit here.

    Coming Up Next: Day 28 — Capstone Project (Day 2 of 3) — Build

    • Assemble the file list — top module, interfaces, agent, monitor, transactions.
    • Build the register model and adapter — connect RAL to the APB agent.
    • Wire the reference model — between APB writes and the FIFO data path.
    • Get the smoke test passing — one write, one read, clean log.
    ← Back to the 30-Day UVM Course
    See all 30 days, week by week.

    Series: 30 days of SystemVerilog/UVM verification. Day 27's capstone plan.

    No comments:

    Post a Comment

    SiteMap