summaryrefslogtreecommitdiff
path: root/tb/top
diff options
context:
space:
mode:
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;