[source]

Module ibex_register_file_fpga

RV32EDataWidthDummyInstructionsWrenCheckRdataMuxCheckWordZeroValclk_ilogicrst_nilogictest_en_ilogicdummy_instr_id_ilogicdummy_instr_wb_ilogicraddr_a_i[4:0]logicraddr_b_i[4:0]logicwaddr_a_i[4:0]logicwdata_a_i[DataWidth-1:0]logicwe_a_ilogicrdata_a_ologic[DataWidth-1:0]rdata_b_ologic[DataWidth-1:0]err_ologic

Block Diagram of ibex_register_file_fpga

RISC-V register file

Register file with 31 or 15x 32 bit wide registers. Register 0 is fixed to 0.

This register file is designed to make FPGA synthesis tools infer RAM primitives. For Xilinx FPGA architectures, it will produce RAM32M primitives. Other vendors have not yet been tested.

Parameters

Name

Default

Description

RV32E

0

DataWidth

32

DummyInstructions

0

WrenCheck

0

RdataMuxCheck

0

WordZeroVal

'0

Ports

Name

Type

Direction

Description

clk_i

wire logic

input

Clock and Reset

rst_ni

wire logic

input

test_en_i

wire logic

input

dummy_instr_id_i

wire logic

input

dummy_instr_wb_i

wire logic

input

raddr_a_i

wire logic [4 : 0]

input

Read port R1

rdata_a_o

var logic [DataWidth - 1 : 0]

output

raddr_b_i

wire logic [4 : 0]

input

Read port R2

rdata_b_o

var logic [DataWidth - 1 : 0]

output

waddr_a_i

wire logic [4 : 0]

input

Write port W1

wdata_a_i

wire logic [DataWidth - 1 : 0]

input

we_a_i

wire logic

input

err_o

var logic

output

This indicates whether spurious WE or non-one-hot encoded raddr are detected.

Always Blocks

always @(posedge clk_i)

Note that the SystemVerilog LRM requires variables on the LHS of assignments within "always_ff" to not be written to by any other process. However, to enable the initialization of the inferred RAM32M primitives with non-zero values, below "initial" procedure is needed. Therefore, we use "always" instead of the generally preferred "always_ff" for the synchronous write procedure.