From 4576b63b0aed78f276586391784241aa70da402e Mon Sep 17 00:00:00 2001 From: uvok Date: Sun, 25 Jan 2026 16:08:13 +0100 Subject: eater: fix iverilog errors b/c of OUT name clashes --- eater_cpu/cpp/Veater_computer__main.cpp | 2 +- eater_cpu/cpp/simpc_curses.cpp | 2 +- eater_cpu/cpp/simpc_term.cpp | 2 +- eater_cpu/eater_computer.sv | 2 +- eater_cpu/eater_decoder.sv | 2 +- eater_cpu/eater_types.sv | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eater_cpu/cpp/Veater_computer__main.cpp b/eater_cpu/cpp/Veater_computer__main.cpp index 3bdb786..e7dc553 100644 --- a/eater_cpu/cpp/Veater_computer__main.cpp +++ b/eater_cpu/cpp/Veater_computer__main.cpp @@ -28,7 +28,7 @@ void load_program(const std::unique_ptr &topp) { 0x3d, // STA 11 0x4b, - // OUT + // OUT_op 0xe0, // LDI 4 0x54, diff --git a/eater_cpu/cpp/simpc_curses.cpp b/eater_cpu/cpp/simpc_curses.cpp index 4b4f04f..5ae98b1 100644 --- a/eater_cpu/cpp/simpc_curses.cpp +++ b/eater_cpu/cpp/simpc_curses.cpp @@ -70,7 +70,7 @@ void simpc_ui_write(const std::unique_ptr &topp, uint64_t i) { clock_regs, 3, 1, "A : 0x%02X\tB : 0x%02X\tALU: 0x%02X\tOUT: 0x%02X", topp->eater_computer->A->r_datastore, topp->eater_computer->B->r_datastore, topp->eater_computer->alu->result, - topp->eater_computer->OUT->r_datastore); + topp->eater_computer->OUT_reg->r_datastore); // "PC: 0x%02X, INS: 0x%02X", topp->eater_computer->PC_out, opcode; // const wchar_t flag_on = L'\u26ab'; diff --git a/eater_cpu/cpp/simpc_term.cpp b/eater_cpu/cpp/simpc_term.cpp index b0396a1..c60e690 100644 --- a/eater_cpu/cpp/simpc_term.cpp +++ b/eater_cpu/cpp/simpc_term.cpp @@ -80,7 +80,7 @@ void simpc_ui_write(const std::unique_ptr &topp, uint64_t i) { topp->eater_computer->A->r_datastore, topp->eater_computer->B->r_datastore, topp->eater_computer->alu->result, - topp->eater_computer->OUT->r_datastore); + topp->eater_computer->OUT_reg->r_datastore); // PRINT_ME( // 8, NCUR_X, "%c%8d\t%c%8d\t%c%8d\t%11d", // topp->computer->store_to_A_int ? '*' : ' ', topp->computer->reg_A_int, diff --git a/eater_cpu/eater_computer.sv b/eater_cpu/eater_computer.sv index 2fca29e..75a54c9 100644 --- a/eater_cpu/eater_computer.sv +++ b/eater_cpu/eater_computer.sv @@ -158,7 +158,7 @@ zbuffer PC_to_bus_buffer ( .data_out(bus) ); -eater_register OUT ( +eater_register OUT_reg ( .clk_in(clk_in), .data_in(bus), .en_store_in(flags.OUT_in), diff --git a/eater_cpu/eater_decoder.sv b/eater_cpu/eater_decoder.sv index 9ddc000..f738eeb 100644 --- a/eater_cpu/eater_decoder.sv +++ b/eater_cpu/eater_decoder.sv @@ -32,7 +32,7 @@ function CpuState insdep_state; STA: insdep_state = STA_INS_to_MAR; LDI: insdep_state = LDI_INS_to_A; JMP: insdep_state = JMP_INS_to_PC; - OUT: insdep_state = OUT_A_to_OUT; + OUT_op: insdep_state = OUT_A_to_OUT; HALT_op: insdep_state = HALT_st; default: insdep_state = INIT; diff --git a/eater_cpu/eater_types.sv b/eater_cpu/eater_types.sv index e12d15b..b0e5592 100644 --- a/eater_cpu/eater_types.sv +++ b/eater_cpu/eater_types.sv @@ -69,7 +69,7 @@ typedef enum logic[3:0] { STA = 'b0100, LDI = 'b0101, JMP = 'b0110, - OUT = 'b1110, + OUT_op = 'b1110, HALT_op = 'b1111 } eater_instruction; @@ -81,7 +81,7 @@ typedef struct packed { logic INS_out, INS_in; logic MAR_in; logic RAM_out, RAM_in; - logic ALU_out; + logic ALU_out, ALU_subtract_nadd; logic PC_out, PC_in, PC_count; logic OUT_in; logic halt; -- cgit v1.2.3