summaryrefslogtreecommitdiff
path: root/nandgame/computer.sv
diff options
context:
space:
mode:
authoruvok2026-01-09 19:36:02 +0100
committeruvok2026-01-10 09:54:18 +0100
commitb3494ea7cc4040adcbfd123f0931116b34d4e9e2 (patch)
tree14ca78ebc0d146fd0ceaea7aac713a5108b51f10 /nandgame/computer.sv
parent526bbb2a4618b0ca6e3367bfc9a2bb30476ea3be (diff)
Implement halting
Diffstat (limited to 'nandgame/computer.sv')
-rw-r--r--nandgame/computer.sv13
1 files changed, 11 insertions, 2 deletions
diff --git a/nandgame/computer.sv b/nandgame/computer.sv
index b706d7f..7f42c05 100644
--- a/nandgame/computer.sv
+++ b/nandgame/computer.sv
@@ -8,7 +8,8 @@
`include "counter.sv"
module computer (
- input clk_in
+ input clk_in,
+ output halt
);
wire nclk_int;
@@ -68,7 +69,9 @@ instruction_decode CPU (
.D_in(reg_D_int),
.pA_in(reg_pA_int),
- .result_out(result_int)
+ .result_out(result_int),
+
+ .invalid_ins(halt)
);
counter PC (
@@ -78,4 +81,10 @@ counter PC (
.st_store_X_in(cpu_do_jump_int)
);
+`ifdef VERILATE
+initial begin
+ $dumpfile("simpc.vvp"); $dumpvars();
+end
+`endif
+
endmodule