From 91a6b128198515a7a29ee766715c9a1fe1bf7b0c Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 17 Jul 2018 00:09:59 -0700 Subject: 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 Maintainer: Gabe Black --- src/systemc/core/process.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/systemc/core/process.hh') 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; -- cgit v1.2.3