From c7c531ce16fe66bf9f3bcb04ea9294d50a41e348 Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 17 Apr 2025 17:20:48 -0400 Subject: HALT instruction... but it voids future stages' instructions --- src/sim/controller.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/sim/controller.cc') diff --git a/src/sim/controller.cc b/src/sim/controller.cc index 9256151..9ae6d16 100644 --- a/src/sim/controller.cc +++ b/src/sim/controller.cc @@ -1,4 +1,5 @@ #include "controller.h" +#include "ex.h" #include "response.h" #include "storage.h" @@ -20,7 +21,11 @@ void Controller::run_for(int number) { int i; for (i = 0; i < number; ++i) { - this->advance(WAIT); + try { + this->advance(WAIT); + } catch (HaltException &e) { + break; + } } } -- cgit v1.2.3