Skip to content

Implement AXI-Stream UVM agent - #1

Open
allRisc wants to merge 1 commit into
mainfrom
add-axi-stream-agent
Open

Implement AXI-Stream UVM agent#1
allRisc wants to merge 1 commit into
mainfrom
add-axi-stream-agent

Conversation

@allRisc

@allRisc allRisc commented Aug 4, 2026

Copy link
Copy Markdown
Member

Build out the previously-empty axi_stream_agent submodule into a full UVM agent, mirroring the structure and design decisions of the sibling APB and AHB agents.

Agent

  • Two operating modes selected via axi_st_agent_config.agent_mode: AXI_ST_TRANSMITTER_AGENT drives TVALID and the transfer payload from a sequence; AXI_ST_RECEIVER_AGENT drives TREADY, applying reactive backpressure. Mirrors the APB requester/completer split.
  • One transaction models a single stream transfer (beat), carrying data/strb/keep/last/id/dest/user plus per-transfer tvalid_delay (idle insertion) and tready_delay (backpressure) knobs.
  • Optional sidebands TID/TDEST/TUSER default to width 0 and are guarded by (W==0)?1:W localparams so zero-width vectors never occur (same technique the AHB agent uses for HMASTER_WIDTH).

Components

  • axi_st_vip_if interface with drv_tx_cb / drv_rx_cb / mon_cb clocking blocks and matching modports, driven off aclk / areset_n.
  • Driver implements complementary transmitter and receiver run phases over the handshake, honouring the idle/backpressure delays.
  • Monitor emits one transaction per completed TVALID && TREADY handshake and forwards offered transfers to reactive receiver sequences via req_ap.
  • Sequencer, coverage collector, and agent wire-up follow the APB layout.
  • Reactive receiver sequences: base reactive, no-backpressure, and randomized backpressure (parallels APB's reactive/no-wait/wait sequences).

Parameter checking

  • axi_st_agent.check_params enforces TDATA width as a positive multiple of 8 and warns on TID > 8 / TDEST > 4 per the AXI-Stream recommendations.

Example / tooling

  • Self-contained example testbench (env, transmitter sequence, reactive receiver, top module) plus filelists, proj.toml, Natural Docs config, and the GitHub Pages workflow, matching the other agents.

Naming / license

  • Repo-level identifiers keep the full axi_stream form (package axi_stream_agent_pkg, axi_stream_agent.f); all internal types, classes, macros, and the interface use the axi_st_ / AXI_ST_ abbreviation.
  • All source files carry the MIT header matching this repo's LICENSE.

Correctness notes (deliberate improvements over the APB reference)

  • The strb_keep_c constraint (TSTRB may only assert where TKEEP asserts) is guarded to transmitter-generated stimulus so a reactive randomize() cannot fail on monitor-sampled values.
  • The coverage covergroup is constructed in the collector's constructor.
  • The monitor's request latch clears whenever TVALID is idle, so a withdrawn offer cannot deadlock reactive receiver sequences.

Build out the previously-empty axi_stream_agent submodule into a full UVM
agent, mirroring the structure and design decisions of the sibling APB and
AHB agents.

Agent
- Two operating modes selected via axi_st_agent_config.agent_mode:
  AXI_ST_TRANSMITTER_AGENT drives TVALID and the transfer payload from a
  sequence; AXI_ST_RECEIVER_AGENT drives TREADY, applying reactive
  backpressure. Mirrors the APB requester/completer split.
- One transaction models a single stream transfer (beat), carrying
  data/strb/keep/last/id/dest/user plus per-transfer tvalid_delay (idle
  insertion) and tready_delay (backpressure) knobs.
- Optional sidebands TID/TDEST/TUSER default to width 0 and are guarded by
  (W==0)?1:W localparams so zero-width vectors never occur (same technique
  the AHB agent uses for HMASTER_WIDTH).

Components
- axi_st_vip_if interface with drv_tx_cb / drv_rx_cb / mon_cb clocking
  blocks and matching modports, driven off aclk / areset_n.
- Driver implements complementary transmitter and receiver run phases over
  the handshake, honouring the idle/backpressure delays.
- Monitor emits one transaction per completed TVALID && TREADY handshake and
  forwards offered transfers to reactive receiver sequences via req_ap.
- Sequencer, coverage collector, and agent wire-up follow the APB layout.
- Reactive receiver sequences: base reactive, no-backpressure, and
  randomized backpressure (parallels APB's reactive/no-wait/wait sequences).

Parameter checking
- axi_st_agent.check_params enforces TDATA width as a positive multiple of 8
  and warns on TID > 8 / TDEST > 4 per the AXI-Stream recommendations.

Example / tooling
- Self-contained example testbench (env, transmitter sequence, reactive
  receiver, top module) plus filelists, proj.toml, Natural Docs config, and
  the GitHub Pages workflow, matching the other agents.

Naming / license
- Repo-level identifiers keep the full axi_stream form (package
  axi_stream_agent_pkg, axi_stream_agent.f); all internal types, classes,
  macros, and the interface use the axi_st_ / AXI_ST_ abbreviation.
- All source files carry the MIT header matching this repo's LICENSE.

Correctness notes (deliberate improvements over the APB reference)
- The strb_keep_c constraint (TSTRB may only assert where TKEEP asserts) is
  guarded to transmitter-generated stimulus so a reactive randomize() cannot
  fail on monitor-sampled values.
- The coverage covergroup is constructed in the collector's constructor.
- The monitor's request latch clears whenever TVALID is idle, so a withdrawn
  offer cannot deadlock reactive receiver sequences.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant