summaryrefslogtreecommitdiff
path: root/src/systemc/core/process.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-07-16 16:44:07 -0700
committerGabe Black <gabeblack@google.com>2018-09-05 06:07:01 +0000
commite02b2a3d3b0d2d56e7a968269da022cbe68f7ca2 (patch)
tree308a2bd81be536f4ced7cda88d177ae7c929efcd /src/systemc/core/process.hh
parenteb3b52b56c7caa20e7814ceab0005d63eeac3f6f (diff)
downloadgem5-e02b2a3d3b0d2d56e7a968269da022cbe68f7ca2.tar.xz
systemc: Handle suspended processes and handle sensitivity overload.
This change keeps track of whether a process would have become ready but was suspended so that it can become ready when the process is resumed. Also, this makes a process ignore its static sensitivity while a dynamic sensitivity is in place. Change-Id: If3f6c62f370051e574f81bf227746db8c43527e2 Reviewed-on: https://gem5-review.googlesource.com/11715 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.hh14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/systemc/core/process.hh b/src/systemc/core/process.hh
index cd92992eb..579ea602f 100644
--- a/src/systemc/core/process.hh
+++ b/src/systemc/core/process.hh
@@ -51,13 +51,12 @@ class Sensitivity
{
protected:
Process *process;
- void satisfy();
public:
Sensitivity(Process *p) : process(p) {}
virtual ~Sensitivity() {}
- virtual void notifyWork(Event *e) { satisfy(); }
+ virtual void notifyWork(Event *e);
void notify(Event *e);
void notify() { notify(nullptr); }
@@ -290,6 +289,10 @@ class Process : public ::sc_core::sc_object, public ListNode
void addStatic(PendingSensitivity *);
void setDynamic(Sensitivity *);
+ void satisfySensitivity(Sensitivity *);
+
+ void ready();
+
virtual Fiber *fiber() { return Fiber::primaryFiber(); }
static Process *newest() { return _newest; }
@@ -317,6 +320,7 @@ class Process : public ::sc_core::sc_object, public ListNode
bool _terminated;
bool _suspended;
+ bool _suspendedReady;
bool _disabled;
bool _syncReset;
@@ -332,6 +336,12 @@ class Process : public ::sc_core::sc_object, public ListNode
};
inline void
+Sensitivity::notifyWork(Event *e)
+{
+ process->satisfySensitivity(this);
+}
+
+inline void
Sensitivity::notify(Event *e)
{
if (!process->disabled())