km_rom_interface

Adapt the PicoRV32 native memory interface to the ROM with parity checking and look-ahead prefetch.

Bridges the PicoRV32 native memory interface to the standard ROM memory interface (km_rom_mem_req_t / km_rom_mem_rsp_t). Read-only: write attempts are immediately acknowledged and reported as errors on rom_write_err_o.

Supports the PicoRV32 look-ahead interface for efficient prefetching: mem_la_read_i / mem_la_addr_i arrive one cycle before mem_valid_i, allowing the ROM to begin the fetch early.

Odd parity is checked per byte on the read-strobe lanes of every read response; a mismatch raises parity_error_o for the cycle the response is valid. Requests are held off for two cycles after reset release.

Parameters

Table 1. Parameters
NameTypeDefaultDescription
ROM_ADDR_WIDTHint unsignedKM_ROM_MEM_ADDR_WIDTHWord-address width for the ROM.

Ports

Table 2. Ports
NameDirectionTypeDescription
clk_iinputlogicSystem clock.
rst_niinputlogicActive-low asynchronous reset.
mem_valid_iinputlogicPicoRV32 native memory request valid (from CPU).
mem_ready_ooutputlogicMemory ready: read data valid, or immediately for a write.
mem_addr_iinputlogic [31:0]Byte address.
mem_wdata_iinputlogic [31:0]Write data (unused, ROM is read-only).
mem_wstrb_iinputlogic [3:0]Write strobe; any set bit marks a write, which is acknowledged without effect and flagged on rom_write_err_o.
mem_rstrb_iinputlogic [3:0]Read strobe: byte lanes consumed by the CPU, which select the parity-checked lanes.
mem_rdata_ooutputlogic [31:0]Read data.
mem_la_read_iinputlogicLook-ahead read signal (1 cycle before mem_valid).
mem_la_addr_iinputlogic [31:0]Look-ahead address.
mem_la_rstrb_iinputlogic [3:0]Look-ahead read strobe; selects the parity-checked lanes of a look-ahead fetch.
rom_mem_req_ooutputkm_rom_mem_req_tROM memory request, exposed at the subsystem boundary.
rom_mem_rsp_iinputkm_rom_mem_rsp_tROM memory response.
parity_error_ooutputlogicCombinational; high while a valid read response fails parity on a strobed lane.
rom_write_err_ooutputlogicCombinational; high while mem_valid_i is high with a nonzero write strobe.