summaryrefslogtreecommitdiff
path: root/instrmem/v0.1/instr_memory.v
diff options
context:
space:
mode:
Diffstat (limited to 'instrmem/v0.1/instr_memory.v')
-rw-r--r--instrmem/v0.1/instr_memory.v18
1 files changed, 18 insertions, 0 deletions
diff --git a/instrmem/v0.1/instr_memory.v b/instrmem/v0.1/instr_memory.v
new file mode 100644
index 0000000..943d358
--- /dev/null
+++ b/instrmem/v0.1/instr_memory.v
@@ -0,0 +1,18 @@
+`include "parameters.h"
+
+module instr_memory(
+ input [15:0]pc,
+ output [15:0]instruction
+);
+
+reg [`col - 1:0] memory [`row_i - 1:0];
+wire [3:0] rom_addr = pc[4:1];
+
+initial begin
+ $readmemb("test.instr",memory,0,14);
+end
+
+assign instruction = memory[rom_addr];
+
+endmodule
+