diff options
-rw-r--r-- | src/systemc/core/event.cc | 10 | ||||
-rw-r--r-- | src/systemc/core/event.hh | 2 | ||||
-rw-r--r-- | src/systemc/core/object.cc | 3 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/systemc/core/event.cc b/src/systemc/core/event.cc index aa4a71315..120b51476 100644 --- a/src/systemc/core/event.cc +++ b/src/systemc/core/event.cc @@ -191,6 +191,16 @@ Event::triggered() const return _triggeredStamp == scheduler.changeStamp(); } +void +Event::clearParent() +{ + if (!parent) + return; + Object::getFromScObject(parent)->delChildEvent(sc_event()); + parent = nullptr; + topLevelEvents.emplace(topLevelEvents.end(), sc_event()); +} + Events topLevelEvents; Events allEvents; diff --git a/src/systemc/core/event.hh b/src/systemc/core/event.hh index 2d620c91b..532d98343 100644 --- a/src/systemc/core/event.hh +++ b/src/systemc/core/event.hh @@ -138,6 +138,8 @@ class Event } } + void clearParent(); + private: sc_core::sc_event *_sc_event; diff --git a/src/systemc/core/object.cc b/src/systemc/core/object.cc index 91e3cb36a..781e6d6d1 100644 --- a/src/systemc/core/object.cc +++ b/src/systemc/core/object.cc @@ -145,6 +145,9 @@ Object::~Object() } children.clear(); + for (auto event: events) + Event::getFromScEvent(event)->clearParent(); + if (parent) popObject(&parent->_gem5_object->children, _name); else |