diff options
author | dianshi <dianshi@main.lv> | 2022-01-19 22:00:08 +0000 |
---|---|---|
committer | dianshi <dianshi@main.lv> | 2022-01-19 22:00:08 +0000 |
commit | f3a300ce5927cad9ecf02821b3be007f9d2af22b (patch) | |
tree | 43bdcb0683971341f79f072504a40eea9b50368f /instrmem/v0.1/instr_memory.v | |
parent | deebf92127386873cb34d46f414d31c7a69adcfe (diff) | |
download | cpu8_v-f3a300ce5927cad9ecf02821b3be007f9d2af22b.tar.gz cpu8_v-f3a300ce5927cad9ecf02821b3be007f9d2af22b.zip |
Add instruction memory
Diffstat (limited to 'instrmem/v0.1/instr_memory.v')
-rw-r--r-- | instrmem/v0.1/instr_memory.v | 18 |
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 + |