diff options
author | Gabe Black <gabeblack@google.com> | 2018-07-16 16:14:33 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-05 06:06:00 +0000 |
commit | f2ab5e7a9e11783da3b9d7338775cf4b5fe2c29c (patch) | |
tree | c8b08f18270cb3131f37b6e0bfe1e8f2e94da63d /src/systemc/core/scheduler.hh | |
parent | d7755ec828868582e2b409ba14f1c8c920c7f184 (diff) | |
download | gem5-f2ab5e7a9e11783da3b9d7338775cf4b5fe2c29c.tar.xz |
systemc: Implement the sensitivity mechanism.
This change lets processes be sensitive to events, timeouts, etc.
Change-Id: If30a256dfa8a2e92192c1f9c96b48e2aa28ec27e
Reviewed-on: https://gem5-review.googlesource.com/11713
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/scheduler.hh')
-rw-r--r-- | src/systemc/core/scheduler.hh | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/systemc/core/scheduler.hh b/src/systemc/core/scheduler.hh index e1ad21a57..aa8ec9aa4 100644 --- a/src/systemc/core/scheduler.hh +++ b/src/systemc/core/scheduler.hh @@ -30,6 +30,8 @@ #ifndef __SYSTEMC_CORE_SCHEDULER_HH__ #define __SYSTEMC_CORE_SCHEDULER_HH__ +#include <vector> + #include "sim/eventq.hh" #include "systemc/core/channel.hh" #include "systemc/core/list.hh" @@ -58,7 +60,7 @@ typedef NodeList<Channel> ChannelList; * schedules an event to be run at time 0 with a slightly elevated priority * so that it happens before any "normal" event. * - * When that t0 event happens, it calls the schedulers initToReady method + * When that t0 event happens, it calls the schedulers prepareForInit method * which performs step 2 above. That indirectly causes the scheduler's * readyEvent to be scheduled with slightly lowered priority, ensuring it * happens after any "normal" event. @@ -115,11 +117,14 @@ class Scheduler uint64_t numCycles() { return _numCycles; } Process *current() { return _current; } - // Mark processes that need to be initialized as ready. - void initToReady(); + // Prepare for initialization. + void prepareForInit(); + + // Register a process with the scheduler. + void reg(Process *p); - // Put a process on the list of processes to be initialized. - void init(Process *p) { initList.pushLast(p); } + // Tell the scheduler not to initialize a process. + void dontInitialize(Process *p); // Run the next process, if there is one. void yield(); @@ -162,7 +167,10 @@ class Scheduler Process *_current; + bool initReady; + ProcessList initList; + ProcessList toFinalize; ProcessList readyList; ChannelList updateList; |