summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-08-09 20:31:35 -0700
committerGabe Black <gabeblack@google.com>2018-09-20 01:44:29 +0000
commita11636c7d19caa5832c09b539bcee01ec8818364 (patch)
tree5a3c77193a9a9a6dbd85da3bb6f2f436d5c024a3 /src
parent7dd1cea5179de87e8b8f9de5d425b1466e8ab8e9 (diff)
downloadgem5-a11636c7d19caa5832c09b539bcee01ec8818364.tar.xz
systemc: Ensure delta notifications happen at the right time after sc_pause.
Normally delta notifications would be created during the evaluation or update phases, and so there isn't any problem with them cutting in front of those stages. When the simulation is paused however, those notifications could be waiting before the ready event starts and could preempt it. This change adds a check for that situation to the end of the pause event and runs the evalution and update stages inline if necessary. Change-Id: I4477b2ae8e7980406df00ba7320ae2a24ae2da9b Reviewed-on: https://gem5-review.googlesource.com/12080 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/systemc/core/scheduler.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/systemc/core/scheduler.cc b/src/systemc/core/scheduler.cc
index 44c56467d..d2e87f25d 100644
--- a/src/systemc/core/scheduler.cc
+++ b/src/systemc/core/scheduler.cc
@@ -210,6 +210,14 @@ Scheduler::pause()
_paused = true;
kernel->status(::sc_core::SC_PAUSED);
scMain->run();
+
+ // If the ready event is supposed to run now, run it inline so that it
+ // preempts any delta notifications which were scheduled while we were
+ // paused.
+ if (readyEvent.scheduled()) {
+ eq->deschedule(&readyEvent);
+ runReady();
+ }
}
void