summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eater_cpu/Makefile2
-rw-r--r--eater_cpu/eater_types.sv13
2 files changed, 14 insertions, 1 deletions
diff --git a/eater_cpu/Makefile b/eater_cpu/Makefile
index d877169..9145135 100644
--- a/eater_cpu/Makefile
+++ b/eater_cpu/Makefile
@@ -1,5 +1,5 @@
cpu: eater_computer_tb.sv eater_computer.sv zbuffer.sv eater_register.v eater_alu.sv ../playground/my_mem.v ../nandgame/counter.sv
- iverilog -o $@ -g2012 $^
+ iverilog -o $@ -g2012 -DIVERILOG $^
HARDWARE_SUFFIX := .sv
TESTBENCH_SUFFIX := _tb.sv
diff --git a/eater_cpu/eater_types.sv b/eater_cpu/eater_types.sv
index b5abe21..d1699b0 100644
--- a/eater_cpu/eater_types.sv
+++ b/eater_cpu/eater_types.sv
@@ -12,6 +12,18 @@ typedef enum logic[7:0] {
} CpuState;
// CPU control flags
+`ifdef IVERILOG
+typedef struct packed {
+ logic A_out, A_in;
+ logic B_out, B_in;
+ logic INS_out, INS_in;
+ logic MAR_in;
+ logic RAM_out, RAM_in;
+ logic ALU_out;
+ logic PC_out, PC_in, PC_count;
+ logic OUT_in;
+} CpuControlFlags;
+`else
typedef struct {
logic A_out, A_in;
logic B_out, B_in;
@@ -22,5 +34,6 @@ typedef struct {
logic PC_out, PC_in, PC_count;
logic OUT_in;
} CpuControlFlags;
+`endif
`endif