telemetry_receiver
Assemble ATB telemetry packets into buffered counter messages for AXI-Lite readout.
ATB beats accepted on atvalid_i and atready_o fill an assembly buffer; a packet whose last_packet bit is set completes a message, which is decoded into a probe ID and counters and pushed into a BUFFER_DEPTH message FIFO read through the CSRs. A push into a full FIFO drops the oldest message. BUFFER_DEPTH must be a power of two and greater than or equal to 2. CTRL.TELEMETRY_RX_FLUSH empties both buffers and deasserts atready_o, and CTRL.TELEMETRY_TX_FLUSH drives the AF flush request.
debug_o bits:
- debug_o[0] missing_last_event: assembly buffer filled without last_packet marker.
- debug_o[1] message_buffer_full: a further push drops the oldest message.
- debug_o[2] message_buffer_empty.
- debug_o[3] assembly_buffer_full: the beat being accepted fills the assembly buffer.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
BUFFER_DEPTH | int unsigned | 8 | Completed-message FIFO depth; must be a power of two and >= 2. |
MAX_NUM_COUNTERS_PER_MESSAGE | int unsigned | 4 | Counters allowed per message; only the first NumCounterRegs are readable. |
MaxNumBlocksPerMessage | int unsigned | 1 + (TelemetryCounterWidth / TelemetryDataWidth) * MAX_NUM_COUNTERS_PER_MESSAGE | Packet blocks spanning one message: one header block plus one block per counter byte. |
MaxNumPacketsPerMessage | int unsigned | MaxNumBlocksPerMessage % NumBlocksPerPacket == 0 ? MaxNumBlocksPerMessage / NumBlocksPerPacket : MaxNumBlocksPerMessage / NumBlocksPerPacket + 1 | ATB packets spanning one message. |
PacketIndexWidth | int unsigned | $clog2(MaxNumPacketsPerMessage) | Packet-index counter width. |
BlockIndexWidth | int unsigned | $clog2(NumBlocksPerPacket) | Block-index counter width. |
AssemblyBufferDepth | int unsigned | (TelemetryPacketWidth / TelemetryDataWidth) * MaxNumPacketsPerMessage | Assembly-buffer depth in beats. |
AssemblyBufferPtrWidth | int unsigned | $clog2(AssemblyBufferDepth) | Assembly-buffer pointer width. |
MessageBufferPtrWidth | int unsigned | $clog2(BUFFER_DEPTH) + 1 | Message-FIFO pointer width. |
Ports
| Name | Direction | Type | Description |
|---|---|---|---|
clk_i | input | logic | System clock. All synchronous logic uses the rising edge. |
rst_ni | input | logic | Async reset, active-low. Assert asynchronously; deassert synchronously to clk_i. |
axil_req_i | input | axil_req_t | AXI-Lite CSR request. |
axil_resp_o | output | axil_resp_t | AXI-Lite CSR response. |
atdata_i | input | telemetry_data_t | ATB data. One 8-bit data beat per transfer. |
atid_i | input | atb_id_t | ATB ID. Identifies the trace source. Unused. |
atready_o | output | logic | ATB ready. High when the receiver can accept a beat; low only while CTRL.TELEMETRY_RX_FLUSH is set. |
atvalid_i | input | logic | ATB valid. High when atdata_i and atid_i are valid. |
afvalid_o | output | logic | ATB flush valid. Requests a flush from the source. It is CTRL.TELEMETRY_TX_FLUSH, held until afready_i completes the handshake. |
afready_i | input | logic | ATB flush ready. Acknowledges the flush request and clears CTRL.TELEMETRY_TX_FLUSH. |
irq_o | output | logic | Receiver interrupt. Active high, level. Asserted while INTR_STATUS.MISSING_LAST is set, or while the FIFO fill level exceeds CTRL.BUFFER_THRESHOLD, each gated by its INTR_ENABLE bit. |
debug_o | output | logic [3:0] | [0] missing_last_event; [1] message_buffer_full; [2] message_buffer_empty; [3] assembly_buffer_full. |