diff --git a/src/core/sal/gem5/FailGem5Device.cc b/src/core/sal/gem5/FailGem5Device.cc index 0d864372..d10f6ebd 100644 --- a/src/core/sal/gem5/FailGem5Device.cc +++ b/src/core/sal/gem5/FailGem5Device.cc @@ -7,7 +7,7 @@ FailGem5Device::FailGem5Device(Params *p) : BasicPioDevice(p) { pioSize = 0x60; - DPRINTF(Fail, "Fail startup()\n"); + fail::simulator.startup(); } diff --git a/src/core/sal/gem5/Gem5Controller.cc b/src/core/sal/gem5/Gem5Controller.cc index bb4b56fb..969cdf2d 100644 --- a/src/core/sal/gem5/Gem5Controller.cc +++ b/src/core/sal/gem5/Gem5Controller.cc @@ -34,4 +34,29 @@ void Gem5Controller::reboot() } +void Gem5Controller::onBreakpoint(address_t instrPtr, address_t address_space) +{ + /*bp_cache_t &buffer_cache = m_LstList.getBPBuffer(); + bp_cache_t::iterator it = buffer_cache.begin(); + for (stringvector::iterator it = strings.begin(); it != strings.end(); it++)*/ + + bool do_fire = false; + // Check for active breakpoint-events: + bp_cache_t &buffer_cache = m_LstList.getBPBuffer(); + for(bp_cache_t::iterator it = buffer_cache.begin(); it != buffer_cache.end(); it++) + { + BPListener* pEvBreakpt = *it; + if(pEvBreakpt->isMatching(instrPtr, address_space)) { + pEvBreakpt->setTriggerInstructionPointer(instrPtr); + it = buffer_cache.makeActive(m_LstList, it); + do_fire = true; + // "it" has already been set to the next element (by calling + // makeActive()): + continue; // -> skip iterator increment + } + } + if (do_fire) + m_LstList.triggerActiveListeners(); +} + } // end-of-namespace: fail diff --git a/src/core/sal/gem5/Gem5Controller.hpp b/src/core/sal/gem5/Gem5Controller.hpp index 9a113454..fc1ed551 100644 --- a/src/core/sal/gem5/Gem5Controller.hpp +++ b/src/core/sal/gem5/Gem5Controller.hpp @@ -11,6 +11,8 @@ extern int interrupt_to_fire; class Gem5Controller : public SimulatorController { public: + void onBreakpoint(address_t instrPtr, address_t address_space); + virtual void save(const std::string &path); virtual void restore(const std::string &path); virtual void reboot();