Module 8: Protocol Projects | Intermediate UVM

AXI-Lite Verification Project

Build a reusable UVM environment that verifies AXI4-Lite reads, writes, handshakes, responses, and protocol corner cases.

Learning objectives

  • Explain the purpose of AXI4-Lite and distinguish its read and write transaction paths.
  • Build a focused UVM test using sequences, an AXI-Lite agent, monitors, and a scoreboard.
  • Verify VALID/READY handshakes, write responses, read responses, and byte-enable behavior.
  • Use assertions, reports, and functional coverage to identify missing AXI-Lite scenarios.
  • Debug and reproduce a failing AXI-Lite transaction using its address, data, response, and test seed.

Step 1: Understand the protocol

AXI4-Lite is a lightweight memory-mapped interface commonly used for control and status registers. Unlike a simple request/acknowledge bus, AXI4-Lite separates read and write activity into independent channels.

A write transaction uses three channels:

  • Write address (AW): carries the target address.
  • Write data (W): carries the data and byte strobes.
  • Write response (B): reports whether the write completed successfully.

A read transaction uses two channels:

  • Read address (AR): identifies the location being accessed.
  • Read data (R): returns the data and response status.

The important verification point is that these channels use independent VALID/READY handshakes. The testbench must not assume that a transfer occurs simply because VALID is asserted. A transfer occurs when both VALID and READY are high in the same cycle.

Verification mindset: Do not verify AXI-Lite only by checking the final register value. Verify how the transaction reaches the DUT, when each handshake occurs, what response is returned, and whether the DUT behaves correctly when READY is delayed.

Step 2: Define the verification plan

Before writing sequences, turn the AXI-Lite requirements into observable checks. A useful intermediate-level plan should cover both normal operation and handshake corner cases.

Scenario Stimulus Expected evidence
Basic write Valid address and data AW/W transfers complete and B response is valid
Basic read Valid read address AR transfer completes and R response contains expected data
READY backpressure Delay READY VALID remains asserted until the transfer occurs
Byte write Partial WSTRB pattern Only selected bytes are modified
Invalid address Access an unsupported location Expected error response or defined DUT behavior
Back-to-back accesses Multiple reads and writes No lost, duplicated, or reordered transactions

The scoreboard should compare transactions at the protocol or register-model boundary rather than relying only on raw signal activity.

Step 3: Study the UVM structure

A reusable AXI-Lite environment normally separates stimulus, protocol driving, observation, and checking. Keep the test responsible for what should happen while the agent handles how an AXI-Lite transaction is driven.

class axi_lite_env extends uvm_env;


axi_lite_agent      agent;
axi_lite_scoreboard scoreboard;

function void build_phase(uvm_phase phase);
super.build_phase(phase);


agent = axi_lite_agent::type_id::create("agent", this);
scoreboard = axi_lite_scoreboard::type_id::create(
  "scoreboard", this);


endfunction

function void connect_phase(uvm_phase phase);
agent.monitor.ap.connect(scoreboard.analysis_export);
endfunction
endclass

The monitor converts pin-level activity into transactions that can be consumed by the scoreboard and coverage model. This keeps protocol observation independent from the sequence that generated the stimulus.

Design rule: Avoid putting scoreboard expectations directly into the driver. A driver should translate sequence items into bus activity; a monitor should observe the interface; the scoreboard should determine whether observed behavior is correct.

Step 4: Build an AXI-Lite write sequence

Start with a single register write. Make the expected address, data, byte strobes, and response explicit before introducing randomization.

class axi_lite_write_seq extends uvm_sequence #(axi_lite_item);


`uvm_object_utils(axi_lite_write_seq)

task body();
axi_lite_item req;


req = axi_lite_item::type_id::create("req");

start_item(req);
req.kind  = AXI_WRITE;
req.addr  = 'h1000;
req.data  = 'hDEADBEEF;
req.strb  = 4'b1111;
finish_item(req);

`uvm_info("AXI_WRITE",
  $sformatf("addr=0x%0h data=0x%0h strb=0x%0h",
            req.addr, req.data, req.strb),
  UVM_MEDIUM)


endtask
endclass

For a complete verification environment, the sequence item would normally contain the fields needed to model the relevant AXI-Lite request and response information. Keep protocol-specific details inside the agent rather than duplicating them across tests.

Step 5: Verify the handshake, not just the data

One of the most important AXI-Lite checks is that a source does not discard a transfer merely because READY is low. When VALID is asserted without READY, the source must hold the transaction according to the protocol requirements until the handshake occurs.

// Example conceptual assertion:


// Once VALID is asserted, relevant payload signals
// remain stable until VALID && READY.

property stable_until_handshake(
logic valid,
logic ready,
logic [31:0] payload
);
@(posedge clk)
valid && !ready |=> valid && $stable(payload)
until_with (valid && ready);
endproperty

The exact assertion should match the interface signals and protocol requirements of the design. The key verification idea is to deliberately create stalls and prove that the transaction survives them.

Also check that the testbench does not accidentally introduce an unrealistic assumption such as requiring READY to be asserted in the same cycle as VALID.

Step 6: Add reads, responses, and byte strobes

Once a basic write works, expand the environment one behavior at a time:

  1. Add a read sequence and compare returned RDATA against the expected register value.
  2. Check the BRESP response for writes and RRESP for reads.
  3. Introduce delayed READY to exercise backpressure.
  4. Use different WSTRB values to verify partial writes.
  5. Exercise legal back-to-back reads and writes.
  6. Access valid and invalid address regions.
  7. Combine reset, register access, and protocol traffic to expose sequencing problems.

For byte strobes, the scoreboard should understand which bytes are expected to change. For example, a full-word write and a single-byte write to the same register should not produce the same expected result.

Step 7: Build coverage around meaningful scenarios

Coverage should answer whether the important protocol behaviors have actually occurred. Useful coverage points include:

  • Read versus write transactions.
  • Different response types.
  • Full-word versus partial-byte writes.
  • READY asserted immediately versus delayed.
  • Single versus back-to-back accesses.
  • Valid versus invalid addresses.
  • Reset followed by the first register access.

Cross coverage can reveal gaps such as a partial write being tested only when the bus is idle, while no test combines partial writes with READY backpressure.

Step 8: Build it incrementally

  1. Start with reset: establish the known DUT state.
  2. Add one write: verify AW, W, B, and the resulting register value.
  3. Add one read: verify AR, R, returned data, and response.
  4. Add backpressure: delay READY and verify transaction stability.
  5. Add byte strobes: verify partial register updates.
  6. Add negative cases: exercise unsupported addresses and defined error responses.
  7. Add randomization: vary addresses, data, strobes, and legal timing behavior.
  8. Add coverage: confirm that the regression exercises the intended scenario space.
Common mistake: Starting with a large random AXI-Lite sequence before proving that one read and one write work deterministically. When a complex test fails, it becomes difficult to tell whether the problem is the driver, handshake handling, DUT logic, scoreboard, or stimulus.

Try it yourself

Create an AXI-Lite smoke test with these steps:

  1. Reset the DUT.
  2. Write 32'hDEADBEEF to a valid register address.
  3. Check the write response.
  4. Read the same address.
  5. Compare the returned data with the expected value.
  6. Repeat the write using a partial WSTRB pattern.
  7. Repeat one transaction while READY is intentionally delayed.

Your evidence should include the test result, at least one monitored transaction, and a coverage observation showing that both normal and stalled transfers were exercised.

Debug checklist

  • No write response: inspect AW/W handshakes and the conditions that generate BVALID.
  • Read data is wrong: compare the requested address with the scoreboard's expected register state.
  • Transaction disappears during a stall: inspect VALID stability while READY is low.
  • Partial write fails: verify WSTRB interpretation and byte-lane mapping.
  • Scoreboard mismatch: determine whether the monitor reconstructed the transaction correctly before debugging the DUT.
  • Intermittent failure: record the test name, seed, configuration, address, data, response, and first failing transaction.

Key takeaways

  • AXI-Lite verification must cover both transaction results and the handshake behavior that produces those results.
  • Separate sequences, drivers, monitors, scoreboards, assertions, and coverage so each verification responsibility has a clear owner.
  • Use deterministic read/write tests before adding randomization and backpressure scenarios.
  • Verify WSTRB, responses, invalid accesses, reset interaction, and delayed READY—not only successful full-word transfers.
  • Use coverage and reproducible logs to turn a protocol project into measurable verification evidence.