summaryrefslogtreecommitdiff
path: root/eater_cpu/cpp
diff options
context:
space:
mode:
authoruvok2026-01-19 19:18:10 +0100
committeruvok2026-01-19 19:18:10 +0100
commit78d771dc71ca266b640d2b791cd1d06b7895b5f2 (patch)
tree28f007479dc8e78d20a0e1b8aa5cd9eb8c7d484a /eater_cpu/cpp
parent1d6e5c813516a162b2b25053657b259ff8d77b54 (diff)
eater: Print most control signals
Diffstat (limited to 'eater_cpu/cpp')
-rw-r--r--eater_cpu/cpp/simpc_term.cpp52
1 files changed, 36 insertions, 16 deletions
diff --git a/eater_cpu/cpp/simpc_term.cpp b/eater_cpu/cpp/simpc_term.cpp
index 818389f..f598f6e 100644
--- a/eater_cpu/cpp/simpc_term.cpp
+++ b/eater_cpu/cpp/simpc_term.cpp
@@ -19,11 +19,13 @@
printf("\n"); \
}
#define PRINT_NEXT() \
- { puts("-----"); }
+ { \
+ puts("-----"); \
+ }
#include "Veater_computer.h"
-#include "Veater_computer_eater_computer.h"
#include "Veater_computer_eater_alu.h"
+#include "Veater_computer_eater_computer.h"
#include "verilated.h"
#include <cstdint>
#include <cstdio>
@@ -42,29 +44,47 @@ void simpc_ui_write(const std::unique_ptr<Veater_computer> &topp, uint64_t i) {
PRINT_ME_W(status_top, 0, 0, "Step: %10lu", i);
PRINT_ME_W(status_top, 1, 0, "%-20s", paused ? "Paused" : "Running");
- PRINT_ME(3, NCUR_X, "CLK1: %4d\tState: 0x%02X\tHLT: %d",
- topp->clk_in,
- topp->eater_computer->decoder__DOT__internal_state,
- halt);
+ PRINT_ME(3, NCUR_X, "CLK1: %4d\tState: 0x%02X\tHLT: %d", topp->clk_in,
+ topp->eater_computer->decoder__DOT__internal_state, halt);
PRINT_ME(4, NCUR_X, "BUS: %02X\tPC: @0x%02X\tINS: 0x%02X",
- topp->eater_computer->bus,
- topp->eater_computer->PC_out,
- opcode
- );
-
- std::string insline{"???"}; //print_decoded(opcode, true);
+ topp->eater_computer->bus, topp->eater_computer->PC_out, opcode);
+
+ bool sub = false;
+ printf(
+ "| %c | %c | %c %c | %c %c | %c %c | %c %c | %c %c | %c | %c %c %c |\n",
+ halt ? 'X' : ' ', topp->eater_computer->flags.__PVT__MAR_in ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__RAM_in ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__RAM_out ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__INS_in ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__INS_out ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__A_in ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__A_out ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__ALU_out ? 'X' : ' ', sub ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__B_in ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__B_out ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__OUT_in ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__PC_count ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__PC_out ? 'X' : ' ',
+ topp->eater_computer->flags.__PVT__PC_in ? 'X' : ' ');
+ printf("| H | M | R R | I I | A A | € S | B B | O | C C J | \n");
+ printf("| L | A | A A | S S | I O | O U | I O | I | E O M | \n");
+ printf("| T | I | I O | I O | | B | | N | P | \n");
+
+ std::string insline{"???"}; // print_decoded(opcode, true);
PRINT_ME(5, NCUR_X, "%-80s", insline.c_str());
PRINT_ME(7, NCUR_X, "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->A->r_datastore,
+ topp->eater_computer->B->r_datastore,
+ topp->eater_computer->alu->result,
+ topp->eater_computer->OUT->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,
// topp->computer->store_to_D_int ? '*' : ' ', topp->computer->reg_D_int,
- // topp->computer->store_to_pA_int ? '*' : ' ', topp->computer->reg_pA_int,
- // topp->computer->result_int);
+ // topp->computer->store_to_pA_int ? '*' : ' ',
+ // topp->computer->reg_pA_int, topp->computer->result_int);
PRINT_NEXT();
}