RVSCC/rtl/instr_memory.sv
Mario1159 4785dd29de
Some checks failed
Verilate / verilate (push) Failing after 51s
Add Git LFS
2023-06-06 14:22:41 +00:00

25 lines
586 B
Systemverilog
Executable File

`include "timescale.sv"
import rv32i_defs::*;
module instr_memory #(
parameter string FILE_PATH = "",
parameter int NUM_INSTR = 32
) (
instr_memory_if.mem instr_mem_if
);
// Number of bits referenced with one address
localparam int BlockSize = 8;
localparam int NumBlocks = NUM_INSTR * 4;
logic [BlockSize-1:0] mem[NumBlocks];
assign instr_mem_if.instr = {
mem[instr_mem_if.addr+'d0],
mem[instr_mem_if.addr+'d1],
mem[instr_mem_if.addr+'d2],
mem[instr_mem_if.addr+'d3]
};
initial $readmemh(FILE_PATH, mem);
endmodule