From e9e4543f72b033453b99fe8c39ec1c5861252488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A0rius=20Mont=C3=B3n?= Date: Mon, 8 Nov 2021 09:24:43 +0100 Subject: [PATCH] Exception doesn't stop simulation --- inc/extension_base.h | 1 + src/extension_base.cpp | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/inc/extension_base.h b/inc/extension_base.h index 3bbd6bd..d16f2e0 100644 --- a/inc/extension_base.h +++ b/inc/extension_base.h @@ -20,6 +20,7 @@ #define EXCEPTION_CAUSE_INSTRUCTION_ACCESS 1 #define EXCEPTION_CAUSE_ILLEGAL_INSTRUCTION 2 #define EXCEPTION_CAUSE_BREAKPOINT 3 +#define EXCEPTION_CAUSE_BREAK 3 #define EXCEPTION_CAUSE_LOAD_ADDR_MISALIGN 4 #define EXCEPTION_CAUSE_LOAD_ACCESS_FAULT 5 diff --git a/src/extension_base.cpp b/src/extension_base.cpp index 513fdd6..3e87586 100644 --- a/src/extension_base.cpp +++ b/src/extension_base.cpp @@ -49,18 +49,12 @@ void extension_base::RaiseException(uint32_t cause, uint32_t inst) { regs->setPC(new_pc); log->SC_log(Log::ERROR) << "Exception! new PC 0x" << std::hex << new_pc - << std::endl; - - regs->dump(); - std::cout << "Simulation time " << sc_core::sc_time_stamp() << std::endl; - perf->dump(); - - sc_core::sc_stop(); + << std::endl << std::flush;; } bool extension_base::NOP() { log->SC_log(Log::INFO) << "NOP" << "\n"; - + sc_core::sc_stop(); return true; }