diff options
author | Gabe Black <gabeblack@google.com> | 2018-09-07 15:42:51 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-10-09 21:42:44 +0000 |
commit | c524f21396457c55435f852bcf0bb4befb91ddba (patch) | |
tree | 5775e3ae966f4a928e8ae88db0e6faa88247eebd /src/systemc/core/scheduler.cc | |
parent | 18b2e3b7c954b6b5916ba8c39e731e219277e5f4 (diff) | |
download | gem5-c524f21396457c55435f852bcf0bb4befb91ddba.tar.xz |
systemc: Catch exceptions during updates, notifications, and callbacks.
Change-Id: I6005c12ce32d24413618e3955625432985f99f69
Reviewed-on: https://gem5-review.googlesource.com/c/12607
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/scheduler.cc')
-rw-r--r-- | src/systemc/core/scheduler.cc | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc index beec87d9d..801580947 100644 --- a/src/systemc/core/scheduler.cc +++ b/src/systemc/core/scheduler.cc @@ -328,11 +328,15 @@ Scheduler::runUpdate() { status(StatusUpdate); - Channel *channel = updateList.getNext(); - while (channel) { - channel->popListNode(); - channel->update(); - channel = updateList.getNext(); + try { + Channel *channel = updateList.getNext(); + while (channel) { + channel->popListNode(); + channel->update(); + channel = updateList.getNext(); + } + } catch (...) { + throwToScMain(); } } @@ -340,8 +344,13 @@ void Scheduler::runDelta() { status(StatusDelta); - while (!deltas.empty()) - deltas.front()->run(); + + try { + while (!deltas.empty()) + deltas.front()->run(); + } catch (...) { + throwToScMain(); + } } void @@ -431,6 +440,7 @@ Scheduler::throwToScMain(const ::sc_core::sc_report *r) if (!r) r = reportifyException(); _throwToScMain = r; + status(StatusOther); scMain->run(); } |