Added abo-simple-arm experiment code
It is a simple and short experiment that performs single stepping through the target. It is designed to be used with gem5 (+ ARM). Change-Id: Id48b2b087a3650bd0298454ff168c0dbdaaae0c8
This commit is contained in:
17
src/experiments/abo-simple-arm/CMakeLists.txt
Normal file
17
src/experiments/abo-simple-arm/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
set(EXPERIMENT_NAME abo-simple-arm)
|
||||||
|
set(EXPERIMENT_TYPE ABOSimpleARMExperiment)
|
||||||
|
configure_file(../instantiate-experiment.ah.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/instantiate-${EXPERIMENT_NAME}.ah @ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
#experiment sources
|
||||||
|
set(MY_EXPERIMENT_SRCS
|
||||||
|
experiment.hpp
|
||||||
|
experiment.cc
|
||||||
|
)
|
||||||
|
|
||||||
|
#### include directories ####
|
||||||
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
## build library
|
||||||
|
add_library(fail-${EXPERIMENT_NAME} ${MY_EXPERIMENT_SRCS})
|
||||||
40
src/experiments/abo-simple-arm/experiment.cc
Normal file
40
src/experiments/abo-simple-arm/experiment.cc
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#include "util/Logger.hpp"
|
||||||
|
#include "experiment.hpp"
|
||||||
|
#include "sal/SALConfig.hpp"
|
||||||
|
#include "sal/SALInst.hpp"
|
||||||
|
#include "sal/Listener.hpp"
|
||||||
|
#include "config/FailConfig.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace fail;
|
||||||
|
|
||||||
|
// Check if configuration dependencies are satisfied:
|
||||||
|
#if !defined(CONFIG_EVENT_BREAKPOINTS) && !defined(CONFIG_EVENT_BREAKPOINTS_RANGE)
|
||||||
|
#error This experiment needs: breakpoints. Enable them in the configuration.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool ABOSimpleARMExperiment::run()
|
||||||
|
{
|
||||||
|
Logger log("abo-simple", false);
|
||||||
|
log << "Startup!" << endl;
|
||||||
|
|
||||||
|
BPSingleListener* ret;
|
||||||
|
BPSingleListener bp(0x800334);
|
||||||
|
ret = (BPSingleListener*)simulator.addListenerAndResume(&bp);
|
||||||
|
log << hex << ret->getTriggerInstructionPointer() << ": "
|
||||||
|
<< simulator.getMnemonic() << endl;
|
||||||
|
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||||
|
simulator.clearListeners();
|
||||||
|
while ((ret = (BPSingleListener*)simulator.addListenerAndResume(&bp)) != 0) {
|
||||||
|
log << hex << ret->getTriggerInstructionPointer() << ": "
|
||||||
|
<< simulator.getMnemonic() << " => Abort? " << flush;
|
||||||
|
char ch;
|
||||||
|
cin.clear(); cin.sync(); cin >> ch;
|
||||||
|
cout << endl;
|
||||||
|
if (ch == 'y' || ch == 'Y')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Explicitly terminate, or the simulator will continue to run.
|
||||||
|
simulator.terminate();
|
||||||
|
}
|
||||||
13
src/experiments/abo-simple-arm/experiment.hpp
Normal file
13
src/experiments/abo-simple-arm/experiment.hpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef __ABO_SIMPLE_ARM_EXPERIMENT_HPP__
|
||||||
|
#define __ABO_SIMPLE_ARM_EXPERIMENT_HPP__
|
||||||
|
|
||||||
|
#include "efw/ExperimentFlow.hpp"
|
||||||
|
#include "efw/JobClient.hpp"
|
||||||
|
|
||||||
|
class ABOSimpleARMExperiment : public fail::ExperimentFlow {
|
||||||
|
public:
|
||||||
|
ABOSimpleARMExperiment() { }
|
||||||
|
bool run();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __ABO_SIMPLE_ARM_EXPERIMENT_HPP__
|
||||||
Reference in New Issue
Block a user