From 54f3a76afe055fa62a818b8355dd8c6f8bd39856 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 16 Aug 2018 18:59:06 -0700 Subject: 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 Maintainer: Gabe Black --- src/systemc/core/process.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/systemc/core/process.cc') 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(); } -- cgit v1.2.3