summaryrefslogtreecommitdiff
path: root/src/systemc/core/process.cc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-08-16 18:59:06 -0700
committerGabe Black <gabeblack@google.com>2018-09-25 23:49:15 +0000
commit54f3a76afe055fa62a818b8355dd8c6f8bd39856 (patch)
treed4041cffe05907b049012fe73d13b3aa440ca13d /src/systemc/core/process.cc
parent9556aa3232ac6f782d715c15d2b4b62f5e7cfb9e (diff)
downloadgem5-54f3a76afe055fa62a818b8355dd8c6f8bd39856.tar.xz
systemc: Rework how delta and timed notifications/timeouts are tracked.
Rather than delegating them entirely to the gem5 event queue and using priorities to ensure the right thing happens, this change adds a few new structures which keep track of them and give the scheduler more control over what happens and in what order. The old scheme was mostly correct, but there were some competing situations which made it next to impossible to make everything happen at the right time. Change-Id: I43f4dd6ddfa488a31073c0318bb41369b1a6117d Reviewed-on: https://gem5-review.googlesource.com/12213 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/process.cc')
-rw-r--r--src/systemc/core/process.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc
index ef1cea61a..3e629c3ec 100644
--- a/src/systemc/core/process.cc
+++ b/src/systemc/core/process.cc
@@ -39,10 +39,9 @@ namespace sc_gem5
{
SensitivityTimeout::SensitivityTimeout(Process *p, ::sc_core::sc_time t) :
- Sensitivity(p), timeoutEvent(this), time(t)
+ Sensitivity(p), timeoutEvent([this]() { this->timeout(); })
{
- Tick when = scheduler.getCurTick() + time.value();
- scheduler.schedule(&timeoutEvent, when);
+ scheduler.schedule(&timeoutEvent, t);
}
SensitivityTimeout::~SensitivityTimeout()
@@ -54,7 +53,6 @@ SensitivityTimeout::~SensitivityTimeout()
void
SensitivityTimeout::timeout()
{
- scheduler.eventHappened();
notify();
}