tlul_adapter_sram

Adapt TL-UL device traffic onto an SRAM-like memory port.

Translate Get/Put into req/we/addr/wdata/wmask transactions and track outstanding responses. Responses return in request order: a write responds once accepted, a read once rvalid_i returns its data, and a rejected request without an SRAM access.

BaseAddr is intentionally omitted so multiple memory maps may be used in an SoC. Aliasing can happen if the TL-UL crossbar target size is bigger than the SRAM.

At most one of ENABLE_DATA_INTG_GEN and ENABLE_DATA_INTG_PT may be enabled; there is no legal case where both are true. Both may be disabled when a non-security-critical memory has no stored integrity and an upstream entity already returns integrity. SRAM_DW must be a multiple of the TL width.

The remaining parameters select optional features:

  • BYTE_ACCESS enables sub-word writes and results in read-modify-write for integrity regeneration when ENABLE_DATA_INTG_PT is set and ERR_ON_WRITE is clear.
  • ERR_ON_WRITE and ERR_ON_READ automatically error disallowed accesses.
  • CMD_INTG_CHECK enables command and A-channel data integrity checking.
  • ENABLE_RSP_INTG_GEN and ENABLE_DATA_INTG_GEN generate response and data integrity.
  • ENABLE_DATA_INTG_PT passes write data integrity to the SRAM and returns the stored integrity with read data.
  • SEC_FIFO_PTR uses redundant FIFO pointers.
  • ENABLE_READBACK reads back and checks written or read data.
  • DATA_XOR_ADDR removes an address XOR that the memory applied to read data, so a faulted read address shows up as an integrity error; it takes effect only with ENABLE_DATA_INTG_PT.
  • SRAM_BUS_BANK_AW is the SRAM bank address width, used only when DATA_XOR_ADDR is set.

Parameters

Table 1. Parameters
NameTypeDefaultDescription
SRAM_AWint12SRAM word-address width.
SRAM_DWint32SRAM data width; must be a multiple of TL_DW.
OUTSTANDINGint1Maximum outstanding SRAM transactions.
SRAM_BUS_BANK_AWint12SRAM bank address width; used when DATA_XOR_ADDR=1.
BYTE_ACCESSbit1Allow sub-word writes; may RMW if ENABLE_DATA_INTG_PT.
ERR_ON_WRITEbit0Reject writes with a bus error.
ERR_ON_READbit0Reject reads with a bus error.
CMD_INTG_CHECKbit0Check A-channel command and data integrity.
ENABLE_RSP_INTG_GENbit0Generate D-channel response integrity.
ENABLE_DATA_INTG_GENbit0Generate D-channel data integrity.
ENABLE_DATA_INTG_PTbit0Pass data integrity through to the SRAM port.
SEC_FIFO_PTRbit0Use redundant pointers in all three FIFOs.
ENABLE_READBACKbit0Read back and check written or read data.
DATA_XOR_ADDRbit0XOR read data with the SRAM bank address.
WidthMultintSRAM_DW / top_pkg::TL_DWTL beats packed per SRAM word.
IntgWidthinttlul_pkg::DATA_INTG_WIDTH * WidthMultIntegrity bits per SRAM word with PT.
DataOutWintENABLE_DATA_INTG_PT ? SRAM_DW + IntgWidth : SRAM_DWWidth of wdata_o, wmask_o and rdata_i.

Ports

Table 2. Ports
NameDirectionTypeDescription
clk_iinputSystem clock.
rst_niinputActive-low reset.
tl_iinputtl_h2d_tTL-UL host-to-device request.
tl_ooutputtl_d2h_tTL-UL device-to-host response.
en_ifetch_iinputmubi4_tMuBi4True allows instruction-fetch Gets.
req_ooutputlogicSRAM request valid.
req_type_ooutputmubi4_tA_USER.INSTR_TYPE of the request.
gnt_iinputSRAM grant.
we_ooutputlogicSRAM write enable.
addr_ooutputlogic [SRAM_AW-1:0]SRAM word address.
wdata_ooutputlogic [DataOutW-1:0]SRAM write data (and optional integrity).
wmask_ooutputlogic [DataOutW-1:0]SRAM write mask (and optional integrity).
intg_error_ooutputlogicIntegrity or FIFO pointer error; sticky.
user_rsvd_ooutputlogic [RSVD_WIDTH-1:0]Reserved user bits toward the SRAM side.
rdata_iinput[DataOutW-1:0]SRAM read data (and optional integrity).
rvalid_iinputSRAM read-data valid.
rerror_iinput[1:0][1] uncorrectable, sets D_ERROR; [0] unused.
compound_txn_in_progress_ooutputlogicRMW write or readback request driven.
readback_en_iinputmubi4_tMuBi4 readback enable; needs ENABLE_READBACK.
readback_error_ooutputlogicReadback failure; sticky until reset.
wr_collision_iinputlogicSRAM write collision; assertions only.
write_pending_iinputlogicSRAM write pending; assertions only.