What you practice
Dynamic array payload: runtime-sized burst data in the sequence item (4.1). Allocate dynamic data/wstrb arrays in sequence items for variable-length bursts. It is in Dynamic Array Payload — Part 4 · AXI4 Full UVM Verification of the AXI Masterclass. Five-channel parallel UVM for AXI Full timing.
AXI only counts when the handshake simulates. RTL Studio is the Verilog and SystemVerilog IDE where you edit the RTL and prove each beat on a VCD.
What you will learn
You will learn how to allocate dynamic arrays in UVM sequence items at runtime based on burst length, enabling variable-length AXI4 data transfers.
Learning objectives
- Understand why dynamic arrays are needed for variable-length AXI bursts.
- Use
new[]inpost_randomize()to sizedata[]andwstrb[]arrays. - Align array allocation with burst length (
awlen+1orarlen+1). - Verify dynamic payload allocation via testbench INFO logs.
Theory
AXI4 supports variable-length bursts (up to 16 beats), so payload arrays must be sized *after* randomization when awlen/arlen are known. Static arrays cannot adapt to runtime burst lengths. UVM sequence items use dynamic arrays (bit [31:0] data[]) and allocate them with new[beats] in post_randomize(). This ensures memory is allocated only when needed and sized precisely for the burst.
| Operator | Purpose | When Used |
|---|---|---|
new[] | Allocate dynamic array | After randomization, once constraints are resolved |
post_randomize() | Hook to size arrays post-constraint solving | Required for runtime burst-length dependent arrays |
Practice
- Open RtlStudio and select this chapter.
Confirm student/tb/env/axi_seq_item.sv and student/tb/tb_top.sv appear in Explore.
- Open
student/tb/env/axi_seq_item.svand locate thenew()andpost_randomize()functions. - In
new(), pass the defaultnameargument tosuper.new(). - In
post_randomize(), replace the__TODO__placeholders withbeatsto allocatedataandwstrbarrays for write transfers. - Run Simulation and verify the Log panel shows
INFO: === AXI4 dynamic array payload ===andINFO: PASS.
Summary
Students extended the axi_seq_item class with dynamic data and wstrb arrays to support variable-length AXI4 bursts. They used post_randomize to allocate these arrays based on the randomized awlen value, enabling runtime-sized payload generation. The key takeaway is that dynamic arrays in UVM sequence items allow flexible, burst-length-dependent data patterns essential for realistic AXI4 verification.
Run it in the Verilog IDE
- Open the lesson in the IDE and find the valid/ready or AXI channel ports in the editor.
- Simulate with Verilator. Confirm the beat on the VCD, not only in the transcript.
- Check that data moves only on the beats this lesson describes, and that backpressure holds the transfer.
- Synthesize the RTL master, slave, or buffer with Yosys. Leave the UVM bench out of synthesis.
The lesson is done when the simulation matches Dynamic array payload: runtime-sized burst data in the sequence item. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.