diff options
author | Gabe Black <gabeblack@google.com> | 2018-07-17 00:09:59 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-05 06:08:22 +0000 |
commit | 91a6b128198515a7a29ee766715c9a1fe1bf7b0c (patch) | |
tree | 22980516f87d12af1df372ddfabe57e45f4acc5a /src/systemc/core/process.hh | |
parent | 746c1eaa72dbce46899459f988336485190897c2 (diff) | |
download | gem5-91a6b128198515a7a29ee766715c9a1fe1bf7b0c.tar.xz |
systemc: Implement sc_pause, sc_stop, and re-sc_start-ing.
This change further modifies the scheduler to implement the sc_pause
and sc_stop functions, and to ensure that calling sc_start again works.
Also, some small changes were made to how processes and contexts are
hooked up. Now, rather than checking whether a process is running to
determine wether it started on its own or needs to be started manually,
there's a bool which explicitly tracks whether it needs this step. The
problem was that once a thread finished, it wasn't considered running
any more. In that case it had run but finished, but that was
indistinguishable from it needing to run but not having been started.
Change-Id: I3aefb5493f91d9efa1a1382586196339b67925fe
Reviewed-on: https://gem5-review.googlesource.com/12031
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/process.hh')
-rw-r--r-- | src/systemc/core/process.hh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/systemc/core/process.hh b/src/systemc/core/process.hh index 579ea602f..7c75d6244 100644 --- a/src/systemc/core/process.hh +++ b/src/systemc/core/process.hh @@ -246,7 +246,7 @@ class Process : public ::sc_core::sc_object, public ListNode { public: virtual ::sc_core::sc_curr_proc_kind procKind() const = 0; - bool running() const { return _running; } + bool needsStart() const { return _needsStart; } bool dynamic() const { return _dynamic; } bool isUnwinding() const { return _isUnwinding; } bool terminated() const { return _terminated; } @@ -298,7 +298,8 @@ class Process : public ::sc_core::sc_object, public ListNode static Process *newest() { return _newest; } protected: - Process(const char *name, ProcessFuncWrapper *func, bool _dynamic); + Process(const char *name, ProcessFuncWrapper *func, bool _dynamic, + bool needs_start); static Process *_newest; @@ -314,7 +315,7 @@ class Process : public ::sc_core::sc_object, public ListNode ProcessFuncWrapper *func; sc_core::sc_curr_proc_kind _procKind; - bool _running; + bool _needsStart; bool _dynamic; bool _isUnwinding; bool _terminated; |