summaryrefslogtreecommitdiff
path: root/src/systemc/ext
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemc/ext')
-rw-r--r--src/systemc/ext/channel/sc_signal.hh13
-rw-r--r--src/systemc/ext/channel/sc_signal_in_if.hh14
2 files changed, 27 insertions, 0 deletions
diff --git a/src/systemc/ext/channel/sc_signal.hh b/src/systemc/ext/channel/sc_signal.hh
index e4300343d..3b2765db5 100644
--- a/src/systemc/ext/channel/sc_signal.hh
+++ b/src/systemc/ext/channel/sc_signal.hh
@@ -51,6 +51,7 @@ namespace sc_gem5
{
class Process;
+class Reset;
class ScSignalBase : public sc_core::sc_prim_channel
{
@@ -80,6 +81,10 @@ class ScSignalBaseBinary : public ScSignalBase
protected:
ScSignalBaseBinary(const char *_name);
+ mutable std::vector<sc_gem5::Reset *> _resets;
+ void _signalReset(sc_gem5::Reset *reset);
+ void _signalReset();
+
const sc_core::sc_event &posedgeEvent() const;
const sc_core::sc_event &negedgeEvent() const;
@@ -352,6 +357,7 @@ class sc_signal<bool, WRITER_POLICY> :
return;
this->m_cur_val = this->m_new_val;
+ this->_signalReset();
this->_signalChange();
if (this->m_cur_val) {
this->_posStamp = ::sc_gem5::getChangeStamp();
@@ -363,6 +369,13 @@ class sc_signal<bool, WRITER_POLICY> :
}
private:
+ bool
+ _addReset(sc_gem5::Reset *reset) const
+ {
+ this->_resets.push_back(reset);
+ return true;
+ }
+
// Disabled
sc_signal(const sc_signal<bool, WRITER_POLICY> &);
};
diff --git a/src/systemc/ext/channel/sc_signal_in_if.hh b/src/systemc/ext/channel/sc_signal_in_if.hh
index 6fac35860..008516495 100644
--- a/src/systemc/ext/channel/sc_signal_in_if.hh
+++ b/src/systemc/ext/channel/sc_signal_in_if.hh
@@ -39,6 +39,13 @@ class sc_logic;
};
+namespace sc_gem5
+{
+
+class Reset;
+
+} // namespace sc_gem5
+
namespace sc_core
{
@@ -83,6 +90,13 @@ class sc_signal_in_if<bool> : virtual public sc_interface
sc_signal_in_if() : sc_interface() {}
private:
+ friend class sc_gem5::Reset;
+ virtual bool
+ _addReset(sc_gem5::Reset *reset) const
+ {
+ return false;
+ }
+
// Disabled
sc_signal_in_if(const sc_signal_in_if<bool> &) : sc_interface() {}
sc_signal_in_if<bool> &