AXI-Stream carries a flow of payload beats. There are no addresses, so position in the stream gives each beat its meaning.
The source offers a beat with TVALID. The sink shows it can accept with TREADY. The beat transfers on the edge where both are 1.
Signal | Driven by | Meaning |
|---|---|---|
| Source | Payload word. Meaningful while TVALID is 1. |
| Source | A beat is available. |
| Sink | The sink can accept a beat this cycle. |
| Source | This beat ends the packet. |
| Source | One bit per byte. A 1 means the byte is valid. |
TSTRB, TID, TDEST and TUSER also exist in the standard. They mark sparse byte lanes, stream IDs, destinations and user sideband. This topic leaves them out of scope.
Two Boolean relations identify transfers and packet ends. They require the temporal offer/hold rules as well.
fire = TVALID && TREADY
pkt_end = fire && TLASTA packet ends on the beat where TVALID, TREADY and TLAST are all 1. Count transfers, not levels: only edges with fire = 1 move data.
TVALID | TREADY | TLAST | fire | pkt_end | What happens at the edge |
|---|---|---|---|---|---|
0 | 0 | any | 0 | 0 | Nothing offered, sink busy |
0 | 1 | any | 0 | 0 | Sink waits; TLAST means nothing without TVALID |
1 | 0 | 0 | 0 | 0 | Stall: the source holds the beat |
1 | 0 | 1 | 0 | 0 | Stall on the last beat: the packet is not over yet |
1 | 1 | 0 | 1 | 0 | A beat transfers; the packet continues |
1 | 1 | 1 | 1 | 1 | The last beat transfers; the packet ends |
Read each row as one clock edge. Only the last two rows move data, and only the very last closes a packet. The testbench below checks all eight input combinations against these columns.
The source asserts TVALID when a beat is available without waiting for TREADY. Once offered, TVALID remains asserted and TDATA's valid bytes, TKEEP and TLAST stay stable until acceptance, including the accepting edge. The sink may wait for TVALID before asserting TREADY. See Rules That Keep Flow Control Safe for the shared handshake rules.
fire when TVALID is 1 and TREADY is 0?Zero: no transfer happens. The source must hold TDATA, TKEEP and TLAST stable until the sink is ready.
TVALID, TREADY and TLAST. All three together mark the packet end.
The sink drives it. A 0 means it cannot accept a beat this cycle, so the offered payload must hold.
The two equations plus a testbench that checks all eight input combinations.
module axis_fire (
input logic tvalid,
input logic tready,
input logic tlast,
output logic fire,
output logic pkt_end
);
assign fire = tvalid && tready;
assign pkt_end = fire && tlast;
endmodule
module tb_axis_fire;
logic tvalid, tready, tlast, fire, pkt_end;
axis_fire dut (.*);
int errors = 0;
initial begin
for (int i = 0; i < 8; i++) begin
tvalid = i[2]; tready = i[1]; tlast = i[0]; #1;
if (fire !== (tvalid && tready)) errors++;
if (pkt_end !== (fire && tlast)) errors++;
end
if (errors == 0) $display("PASS: fire and packet-end equations hold for all 8 input combinations");
else $display("FAIL: %0d errors", errors);
$finish;
end
endmodule