diff options
Diffstat (limited to 'eater_cpu/cpp/Veater_computer__main.cpp')
| -rw-r--r-- | eater_cpu/cpp/Veater_computer__main.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/eater_cpu/cpp/Veater_computer__main.cpp b/eater_cpu/cpp/Veater_computer__main.cpp index 315d52a..7afa4d0 100644 --- a/eater_cpu/cpp/Veater_computer__main.cpp +++ b/eater_cpu/cpp/Veater_computer__main.cpp @@ -20,6 +20,8 @@ void load_program(const std::unique_ptr<Veater_computer> &topp) { topp->eater_computer->RAM->r_datastore[1] = 0x1f; // OUT topp->eater_computer->RAM->r_datastore[2] = 0xe0; + // HALT + topp->eater_computer->RAM->r_datastore[3] = 0xf0; // Data @ 14 topp->eater_computer->RAM->r_datastore[14] = 14; // Data @ 15 @@ -53,7 +55,8 @@ int main(int argc, char **argv, char **) { // Simulate until $finish while (VL_LIKELY(!contextp->gotFinish()) && - VL_LIKELY(contextp->time() < 100)) { + VL_LIKELY(contextp->time() < 100) && + VL_LIKELY(!(topp->eater_computer->flags.__PVT__halt))) { // Evaluate model topp->eval(); @@ -65,7 +68,7 @@ int main(int argc, char **argv, char **) { topp->clk_in = !topp->clk_in; - if (topp->eater_computer->PC_out == 4 && + if (topp->eater_computer->PC_out == 6 && topp->eater_computer->decoder__DOT__internal_state == 0x01) break; } |
