From f895a4ccf6e47aac761034bfa7d803cef3b8ca50 Mon Sep 17 00:00:00 2001 From: Mario Romero Date: Sun, 27 Nov 2022 03:30:54 -0300 Subject: [PATCH] Describe instruction memory based on hex file --- src/InstructionMemory.sv | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/InstructionMemory.sv b/src/InstructionMemory.sv index 0789b88..3d10eb5 100644 --- a/src/InstructionMemory.sv +++ b/src/InstructionMemory.sv @@ -1,9 +1,15 @@ `timescale 1ns / 1ps // N = Bit width -module InstructionMemory #(parameter N = 8) +module InstructionMemory #( + parameter N = 32, + parameter SIZE = 32 +) ( input logic[N-1:0] addr, output logic[N-1:0] instr - ); +); + logic[N-1:0] mem [SIZE-1:0]; + + initial $readmemh("../build/program.hex", mem); endmodule