summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2023-10-03 18:55:47 -0600
committerAlejandro Soto <alejandro@34project.org>2023-10-03 18:55:47 -0600
commitb0f56144be04db7f62ac30107e392a7902b6fd39 (patch)
tree35809e18126e9db9fc9b67aec7f2b82b953f9277
parentb09f5251cb2b15bbf59064671ce7aa19f01b66c7 (diff)
tb: fix halt force
Diffstat (limited to '')
-rw-r--r--tb/top/conspiracion.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/tb/top/conspiracion.cpp b/tb/top/conspiracion.cpp
index a740240..26ea1f0 100644
--- a/tb/top/conspiracion.cpp
+++ b/tb/top/conspiracion.cpp
@@ -463,11 +463,12 @@ int main(int argc, char **argv)
core->step__VforceVal = 1;
}
- cores[0]->halt__VforceEn = start_halted;
top.rst_n = 0;
cycle();
top.rst_n = 1;
+ cores[0]->halt__VforceEn = static_cast<bool>(start_halted);
+
auto do_reg_dump = [&]()
{
std::fputs("=== dump-regs ===\n", ctrl);
@@ -631,14 +632,16 @@ int main(int argc, char **argv)
unsigned i = 0;
auto loop_accurate = [&]()
{
+ bool exit_loop = false;
+
do {
cycle();
- maybe_halt();
- for (const auto *core : cores)
- if (core->halted)
- break;
- } while (!failed && (*cycles == 0 || ++i < *cycles));
+ if (maybe_halt())
+ for (const auto *core : cores)
+ if (core->halted)
+ exit_loop = true;
+ } while (!exit_loop && !failed && (*cycles == 0 || ++i < *cycles));
};
const bool slow_path = *cycles > 0 || enable_accurate_video || enable_trace;