diff options
author | Gabe Black <gabeblack@google.com> | 2018-07-18 20:59:56 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-05 06:09:21 +0000 |
commit | 743a1b5cdd8e607f2e1bb5ad182047c512eae3f8 (patch) | |
tree | 646432533f331db140547ac1cb4f60feda5928bd /src/systemc/core/process.cc | |
parent | 91a6b128198515a7a29ee766715c9a1fe1bf7b0c (diff) | |
download | gem5-743a1b5cdd8e607f2e1bb5ad182047c512eae3f8.tar.xz |
systemc: Implement pending activity related functions
Track the number of notifications/timeouts that are scheduled at any
given time. This lets us implement sc_pending_activity_at_current_time,
sc_pending_activity_at_future_time, and sc_time_to_pending_activity.
Change-Id: Ia3fcd29bdbfe1a6c77eb52ce4836982d4705263c
Reviewed-on: https://gem5-review.googlesource.com/12032
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.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc index 7ed187fe1..ad297a23c 100644 --- a/src/systemc/core/process.cc +++ b/src/systemc/core/process.cc @@ -37,16 +37,23 @@ namespace sc_gem5 { SensitivityTimeout::SensitivityTimeout(Process *p, ::sc_core::sc_time t) : - Sensitivity(p), timeoutEvent(this), timeout(t) + Sensitivity(p), timeoutEvent(this), time(t) { - Tick when = scheduler.eventQueue().getCurTick() + timeout.value(); - scheduler.eventQueue().schedule(&timeoutEvent, when); + Tick when = scheduler.getCurTick() + time.value(); + scheduler.schedule(&timeoutEvent, when); } SensitivityTimeout::~SensitivityTimeout() { if (timeoutEvent.scheduled()) - scheduler.eventQueue().deschedule(&timeoutEvent); + scheduler.deschedule(&timeoutEvent); +} + +void +SensitivityTimeout::timeout() +{ + scheduler.eventHappened(); + notify(); } SensitivityEvent::SensitivityEvent( |