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.cc | 8 ++++---- 1 file changed, 4 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 63d2ff94b..7ed187fe1 100644 --- a/src/systemc/core/process.cc +++ b/src/systemc/core/process.cc @@ -277,7 +277,6 @@ Process::finalize() void Process::run() { - _running = true; bool reset; do { reset = false; @@ -287,7 +286,7 @@ Process::run() reset = exc.is_reset(); } } while (reset); - _running = false; + _terminated = true; } void @@ -323,9 +322,10 @@ Process::ready() scheduler.ready(this); } -Process::Process(const char *name, ProcessFuncWrapper *func, bool _dynamic) : +Process::Process(const char *name, ProcessFuncWrapper *func, + bool _dynamic, bool needs_start) : ::sc_core::sc_object(name), excWrapper(nullptr), func(func), - _running(false), _dynamic(_dynamic), _isUnwinding(false), + _needsStart(needs_start), _dynamic(_dynamic), _isUnwinding(false), _terminated(false), _suspended(false), _disabled(false), _syncReset(false), refCount(0), stackSize(::Fiber::DefaultStackSize), dynamicSensitivity(nullptr) -- cgit v1.2.3