From afca00ce0ab17719337cecc5863976bc3a236e01 Mon Sep 17 00:00:00 2001 From: friemel Date: Wed, 16 Jan 2013 15:27:06 +0000 Subject: [PATCH] - Added a define which marks the use of BPRangeListener - Gem5 now has two different implementation for breakpoints. - If only BPSingleListener are used, gem5 Breakpoints are used - If BPRangeListener are used, gem5 calls onBreakpoint() in every simulated instruction git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@2003 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- simulators/gem5/src/cpu/simple/base.cc | 6 ++++++ src/core/config/CMakeLists.txt | 1 + src/core/config/FailConfig.hpp.in | 1 + src/core/sal/gem5/Gem5Listener.ah | 7 ++++--- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/simulators/gem5/src/cpu/simple/base.cc b/simulators/gem5/src/cpu/simple/base.cc index aec594a7..aff10ed0 100644 --- a/simulators/gem5/src/cpu/simple/base.cc +++ b/simulators/gem5/src/cpu/simple/base.cc @@ -377,6 +377,12 @@ BaseSimpleCPU::preExecute() TheISA::PCState pcState = thread->pcState(); + // FAIL* + #if defined(CONFIG_EVENT_BREAKPOINTS) && defined(CONFIG_EVENT_RANGEBREAKPOINTS) + fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId()); + fail::simulator.onBreakpoint(cpu, instAddr(), -1); + #endif + if (isRomMicroPC(pcState.microPC())) { stayAtPC = false; curStaticInst = microcodeRom.fetchMicroop(pcState.microPC(), diff --git a/src/core/config/CMakeLists.txt b/src/core/config/CMakeLists.txt index 1886bf63..11bb8807 100644 --- a/src/core/config/CMakeLists.txt +++ b/src/core/config/CMakeLists.txt @@ -3,6 +3,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/VariantConfig.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/VariantConfig.hpp) OPTION(CONFIG_EVENT_BREAKPOINTS "Event source: Breakpoints" OFF) +OPTION(CONFIG_EVENT_RANGEBREAKPOINTS "Event source: Range Breakpoints" OFF) OPTION(CONFIG_EVENT_MEMREAD "Event source: Memory reads" OFF) OPTION(CONFIG_EVENT_MEMWRITE "Event source: Memory writes" OFF) OPTION(CONFIG_EVENT_GUESTSYS "Event source: Outbound guest-system communication" OFF) diff --git a/src/core/config/FailConfig.hpp.in b/src/core/config/FailConfig.hpp.in index 4977908f..f0f29b91 100644 --- a/src/core/config/FailConfig.hpp.in +++ b/src/core/config/FailConfig.hpp.in @@ -7,6 +7,7 @@ // Event sources #cmakedefine CONFIG_EVENT_BREAKPOINTS +#cmakedefine CONFIG_EVENT_RANGEBREAKPOINTS #cmakedefine CONFIG_EVENT_MEMREAD #cmakedefine CONFIG_EVENT_MEMWRITE #cmakedefine CONFIG_EVENT_GUESTSYS diff --git a/src/core/sal/gem5/Gem5Listener.ah b/src/core/sal/gem5/Gem5Listener.ah index afdfaeb6..0f909d73 100644 --- a/src/core/sal/gem5/Gem5Listener.ah +++ b/src/core/sal/gem5/Gem5Listener.ah @@ -1,9 +1,10 @@ #ifndef __GEM5_LISTENER_AH__ #define __GEM5_LISTENER_AH__ +#include "config/FailConfig.hpp" #include "config/VariantConfig.hpp" -#if defined(BUILD_GEM5) +#if defined(BUILD_GEM5) && defined(CONFIG_EVENT_BREAKPOINTS) && !defined(CONFIG_EVENT_RANGEBREAKPOINTS) #include "../SALInst.hpp" @@ -27,7 +28,7 @@ aspect Gem5Listener { { System* sys = *System::systemList.begin(); m_Breakpoint = new Gem5Breakpoint(&sys->pcEventQueue, this->m_WatchInstrPtr); - + return true; } @@ -41,6 +42,6 @@ aspect Gem5Listener { }; }; -#endif // defined(BUILD_GEM5) +#endif // defined(BUILD_GEM5) && defined(CONFIG_EVENT_BREAKPOINTS) && !defined(CONFIG_EVENT_RANGEBREAKPOINTS) #endif // __GEM5_LISTENER_AH__