FPGA DEVICES · ENGINEERING · SOURCING Source-linked information. Clear project requirements.

Tutorials

AXI4-Stream Backpressure Testbench: Catch Changed or Lost Beats

Published · Updated

Build the reference queue from accepted transfers

An AXI4-Stream transfer occurs on a clock edge where TVALID and TREADY are both asserted. Count that event exactly once. A source must retain the offered beat while stalled, including the sideband fields carried with it. A test that compares only TDATA during a constantly ready run misses many interface bugs.

USB logic analyzer hardware. External captures observe exposed signals; the downloadable example tests internal AXI transactions in simulation.
USB logic analyzer hardware. External captures observe exposed signals; the downloadable example tests internal AXI transactions in simulation. Photo: Dilshan Jayakody from Maharagama, Sri Lanka. Original · CC BY-SA 2.0.

The downloadable SystemVerilog example is a small one-stage stream register with a testbench, not a complete AXI verification IP. It carries data and a last marker, drives random downstream stalls from a repeatable seed, and compares every accepted output against a reference queue. It does not implement TKEEP or every optional sideband; extend both the payload and scoreboard when your interface uses them.

Check timing after functional simulation.

Use the external timing budget for board-facing signals.

Make a broken implementation fail the same test

Run the normal design, then run the provided deliberately faulty variant that drops the last marker. The reference sequence includes marked beats, so a missing marker must produce a mismatch. This is a useful check on the checker: a test that passes both versions does not establish the behavior it claims to test.

Only valid + ready accepts a beatOnly valid + ready accepts a beatVALID01234READY01234Transfer01234Beat 42 held → accepted at cycle 2; beat 43 at cycle 3
Illustrative model and values; assumptions are stated in the adjacent text.

The browser trace tool examines user-entered cycle,valid,ready,data,last records. It counts accepted beats and reports changes to a stalled offer. It is a single-interface trace check; without an input reference stream it cannot prove that an entire pipeline neither lost nor duplicated a beat. The downloadable testbench supplies that separate end-to-end comparison.

Define reset release separately.

Keep simulation success tied to its scope

Preserve the seed, simulator version, source revision and pass/fail output. Test long stalls, back-to-back transfers and reset recovery; add packet-length and byte-valid tests when those signals exist. Check a reset interruption according to your system contract rather than pretending an in-flight packet survives every reset.

Prove the checker detects a faultProve the checker detects a fault1Normal stream register200 accepted beats compared with queue2FAULT buildLAST deliberately forced low3Expected resultMismatch at the first marked beat
Illustrative model and values; assumptions are stated in the adjacent text.

Passing this example proves the supplied test cases for the supplied register, not timing closure or board performance. For your own design, retain the scoreboard and replace the device under test, then make at least one intentional fault fail before trusting a green regression.

Keep the actual implementation version.

Count accepted stream beats: short sequenceCount accepted stream beats: Cycle 0: VALID 1 READY 0: 0 accepted beats; Cycle 1: held while stalled: 0 accepted beats; Cycle 2: first transfer: 1 accepted beats; Cycle 3: second transfer: 2 accepted beats

Cycle 0: VALID 1 READY 0: 0 accepted beats → Cycle 1: held while stalled: 0 accepted beats → Cycle 2: first transfer: 1 accepted beats → Cycle 3: second transfer: 2 accepted beats

Download and reproduce the test

Download the stream register and testbench. Run the commands in RUN.txt. The normal build accepted 200 beats in 313 cycles; the injected LAST fault failed at beat index 12. This is simulation evidence for the supplied example.

iverilog -g2012 -s tb -o pass.vvp axis_register_tb.sv
vvp pass.vvp
iverilog -g2012 -DFAULT -s tb -o fault.vvp axis_register_tb.sv
vvp fault.vvp

Export your result with its assumptions. For an unresolved board or implementation issue, prepare an engineering review with the exact part, revision and relevant record. This link opens the review page; it does not send your worksheet.

Sources and scope

Sources checked 18 November 2026. Numerical examples are calculated cases. Hardware measurements and device timing closure are outside the results shown here.

Back to Tutorials

Related evidence and next tasks

Continue the task with the relevant source scope. These reading paths do not establish interchangeability or current supply.

Source addresses and citation trail

Full source addresses are retained below. Read each citation with its document revision, page, table and applicability conditions above.

  1. https://commons.wikimedia.org/wiki/File:8_Channel_USB_logic_analyzer_(5172098012).jpg
  2. https://creativecommons.org/licenses/by-sa/2.0
  3. https://docs.amd.com/r/2024.2-English/ug1483-model-composer-sys-gen-user-guide/AXI4-Stream-Support-in-Model-Composer
  4. https://zipcpu.com/blog/2021/08/28/axi-rules.html
  5. https://docs.amd.com/api/khub/documents/Ds0JjAYlvIFpRMxJMOrbRw/content