summaryrefslogtreecommitdiff
path: root/src/systemc/core/sensitivity.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-04 14:59:28 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 00:52:24 +0000
commitee3e3278fd7e0d805ea0ecbf97a113cc5086c0af (patch)
tree261da6679e08b18cec591f4a2c5d5f189bed978d /src/systemc/core/sensitivity.hh
parentd1a86fd7007dbdc6f6a5771c61ef45e72429e374 (diff)
downloadgem5-ee3e3278fd7e0d805ea0ecbf97a113cc5086c0af.tar.xz
systemc: Change how signal based resets work.
The previous implementation used the value changed event to track when signals changed value, but there were a couple problems with this approach. First, this piggybacked on the sensitivity mechanism in some ways, but diverged in others. The sensitivity didn't notify a process when it was satisfied like other sensitivity types would, and it also ignored whether the process was disabled. Second, the value_changed_event is notified by a signal instance as a delta notification, but reset signals are supposed to act immediately. That means they should happen before all delta notifications, or in other words all delta notifications should see the reset status of a given process. That's particularly important in the case of wait(int n) where setting the reset clears the reset count, and the count is checked when determining whether or not to wake up a process when its sensitivity is satisfied, potentially by a delta notification. Third, by removing the middle man and not trying to repurpose the sensitivity mechanism, the code gets simpler and easier to understand. Change-Id: I0d05d11437291d368b060f6a45a207813615f113 Reviewed-on: https://gem5-review.googlesource.com/c/13294 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/sensitivity.hh')
-rw-r--r--src/systemc/core/sensitivity.hh82
1 files changed, 2 insertions, 80 deletions
diff --git a/src/systemc/core/sensitivity.hh b/src/systemc/core/sensitivity.hh
index 62c9682c3..7a065d2a8 100644
--- a/src/systemc/core/sensitivity.hh
+++ b/src/systemc/core/sensitivity.hh
@@ -81,8 +81,7 @@ class Sensitivity
enum Category
{
Static,
- Dynamic,
- Reset
+ Dynamic
};
virtual Category category() = 0;
@@ -92,7 +91,7 @@ class Sensitivity
/*
- * Dynamic vs. static vs. reset sensitivity.
+ * Dynamic vs. static sensitivity.
*/
class DynamicSensitivity : virtual public Sensitivity
@@ -124,29 +123,6 @@ class StaticSensitivity : virtual public Sensitivity
typedef std::vector<StaticSensitivity *> StaticSensitivities;
-class ResetSensitivity : virtual public Sensitivity
-{
- private:
- bool _val;
- bool _sync;
-
- protected:
- ResetSensitivity(Process *p, bool _val, bool _sync) :
- Sensitivity(p), _val(_val), _sync(_sync)
- {}
-
- void addToEvent(const ::sc_core::sc_event *e) override;
- void delFromEvent(const ::sc_core::sc_event *e) override;
-
- bool val() { return _val; }
- bool sync() { return _sync; }
-
- public:
- Category category() override { return Reset; }
-};
-
-typedef std::vector<ResetSensitivity *> ResetSensitivities;
-
/*
* Sensitivity to an event or events, which can be static or dynamic.
@@ -319,60 +295,6 @@ class DynamicSensitivityEventAndList :
bool notify(Event *e) override;
};
-/*
- * Reset sensitivities.
- */
-
-void newResetSensitivitySignal(
- Process *p, const sc_core::sc_signal_in_if<bool> *signal,
- bool val, bool sync);
-
-void newResetSensitivityPort(
- Process *p, const sc_core::sc_in<bool> *port, bool val, bool sync);
-void newResetSensitivityPort(
- Process *p, const sc_core::sc_inout<bool> *port, bool val, bool sync);
-void newResetSensitivityPort(
- Process *p, const sc_core::sc_out<bool> *port, bool val, bool sync);
-
-class ResetSensitivitySignal :
- public ResetSensitivity, public SensitivityEvent
-{
- protected:
- const sc_core::sc_signal_in_if<bool> *_signal;
-
- friend void newResetSensitivitySignal(
- Process *p, const sc_core::sc_signal_in_if<bool> *signal,
- bool val, bool sync);
-
- ResetSensitivitySignal(
- Process *p, const sc_core::sc_signal_in_if<bool> *signal,
- bool _val, bool _sync);
-
- bool notify(Event *e) override;
-};
-
-class ResetSensitivityPort : public ResetSensitivitySignal
-{
- private:
- friend void newResetSensitivityPort(
- Process *p, const sc_core::sc_in<bool> *port, bool val, bool sync);
- friend void newResetSensitivityPort(
- Process *p, const sc_core::sc_inout<bool> *port,
- bool val, bool sync);
- friend void newResetSensitivityPort(
- Process *p, const sc_core::sc_out<bool> *port,
- bool val, bool sync);
-
- ResetSensitivityPort(
- Process *p, const sc_core::sc_port_base *port,
- bool _val, bool _sync) :
- Sensitivity(p), ResetSensitivitySignal(p, nullptr, _val, _sync)
- {}
-
- public:
- void setSignal(const ::sc_core::sc_signal_in_if<bool> *signal);
-};
-
} // namespace sc_gem5
#endif //__SYSTEMC_CORE_SENSITIVITY_HH__