From 938d89a274f0e1a4c50cc75857cffaa30e2d6f68 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 28 Oct 2023 19:18:38 +0200 Subject: [PATCH] refactor: change program mem to file prog mem --- src/{program_memory.sv => file_program_memory.sv} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename src/{program_memory.sv => file_program_memory.sv} (68%) diff --git a/src/program_memory.sv b/src/file_program_memory.sv similarity index 68% rename from src/program_memory.sv rename to src/file_program_memory.sv index d7fbfbd905ccbaa40ed7e55121678b60529c414b..04fa7fbf5a3775479004d503b726c373c2b4ff00 100755 --- a/src/program_memory.sv +++ b/src/file_program_memory.sv @@ -1,14 +1,15 @@ -module program_memory +module file_program_memory ( input [WIDTH - 1:0] addr, output [31:0] instruction ); + parameter FILE_NAME = "memfile.dat"; parameter WIDTH = 12; parameter MEM_SIZE = 1 << (WIDTH - 2) - 1; reg [31:0] imem[0:MEM_SIZE]; - initial $readmemh("memfile.dat", imem); + initial $readmemh(FILE_NAME, imem); assign instruction = imem[addr[WIDTH - 1:2]];