summaryrefslogtreecommitdiff
path: root/instrmem/v0.1/test_instr_memory.v
diff options
context:
space:
mode:
authordianshi <dianshi@main.lv>2022-01-19 22:00:08 +0000
committerdianshi <dianshi@main.lv>2022-01-19 22:00:08 +0000
commitf3a300ce5927cad9ecf02821b3be007f9d2af22b (patch)
tree43bdcb0683971341f79f072504a40eea9b50368f /instrmem/v0.1/test_instr_memory.v
parentdeebf92127386873cb34d46f414d31c7a69adcfe (diff)
downloadcpu8_v-f3a300ce5927cad9ecf02821b3be007f9d2af22b.tar.gz
cpu8_v-f3a300ce5927cad9ecf02821b3be007f9d2af22b.zip
Add instruction memory
Diffstat (limited to 'instrmem/v0.1/test_instr_memory.v')
-rw-r--r--instrmem/v0.1/test_instr_memory.v33
1 files changed, 33 insertions, 0 deletions
diff --git a/instrmem/v0.1/test_instr_memory.v b/instrmem/v0.1/test_instr_memory.v
new file mode 100644
index 0000000..cc6f0b7
--- /dev/null
+++ b/instrmem/v0.1/test_instr_memory.v
@@ -0,0 +1,33 @@
+`timescale 1ns/1ps
+
+module test_instr_memory;
+
+reg [15:0]pc;
+reg [15:0]instruction;
+integer i;
+
+instr_memory uut(
+ .pc(pc),
+ .instruction(instruction)
+);
+
+initial begin
+ $display("Start testing instruction memory");
+ $dumpfile("test_instr_memory.vcd");
+ $dumpvars(0,test_instr_memory);
+
+ for (i=0;i<=30;i=i+2)
+ begin
+ pc = i;
+ #10;
+ end
+
+end
+
+initial begin
+ $monitor("At time=%t",$time);
+end
+
+endmodule
+
+