Skip to content
Snippets Groups Projects
Commit 628c1b69 authored by Adrian Böckenkamp's avatar Adrian Böckenkamp
Browse files

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
parent a43da33f
No related branches found
No related tags found
No related merge requests found
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})
#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();
}
#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__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment