Fail* directories reorganized, Code-cleanup (-> coding-style), Typos+comments fixed.
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1321 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
17
src/experiments/fire-interrupt/CMakeLists.txt
Normal file
17
src/experiments/fire-interrupt/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
||||
set(EXPERIMENT_NAME fire-interrupt)
|
||||
set(EXPERIMENT_TYPE FireInterruptExperiment)
|
||||
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(${EXPERIMENT_NAME} ${MY_EXPERIMENT_SRCS})
|
||||
BIN
src/experiments/fire-interrupt/bootdisk.img
Normal file
BIN
src/experiments/fire-interrupt/bootdisk.img
Normal file
Binary file not shown.
47
src/experiments/fire-interrupt/experiment.cc
Normal file
47
src/experiments/fire-interrupt/experiment.cc
Normal file
@ -0,0 +1,47 @@
|
||||
/**
|
||||
* \brief This experiment demonstrates the fireInterrupt feature.
|
||||
*
|
||||
* The keyboard-interrupts are disabled. So nothing happens if you press a button
|
||||
* on keyboard. Only the pressed button will be stored in keyboard-buffer. With
|
||||
* the fireInterrupt feature keyboard-interrupts are generated manually. The result
|
||||
* is that the keyboard interrupts will be compensated manually. bootdisk.img can
|
||||
* be used as example image (Turbo-Pacman :-) ).
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "experiment.hpp"
|
||||
#include "sal/SALInst.hpp"
|
||||
#include "sal/Event.hpp"
|
||||
#include "util/Logger.hpp"
|
||||
#include "config/FailConfig.hpp"
|
||||
|
||||
// Check if configuration dependencies are satisfied:
|
||||
#if !defined(CONFIG_EVENT_BREAKPOINTS) || !defined(CONFIG_DISABLE_KEYB_INTERRUPTS) || !defined(CONFIG_FIRE_INTERRUPTS)
|
||||
#error This experiment needs: breakpoints, disabled keyboard interrupts and fire interrupts. Enable these in the configuration.
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace fail;
|
||||
|
||||
bool FireInterruptExperiment::run()
|
||||
{
|
||||
Logger log("FireInterrupt", false);
|
||||
log << "experiment start" << endl;
|
||||
|
||||
#if 1
|
||||
while (true) {
|
||||
int j = 0;
|
||||
for (j = 0; j <= 100; j++) {
|
||||
BPSingleEvent mainbp(0x1045f5);
|
||||
simulator.addEventAndWait(&mainbp);
|
||||
}
|
||||
simulator.fireInterrupt(1);
|
||||
}
|
||||
#elif 1
|
||||
simulator.dbgEnableInstrPtrOutput(500);
|
||||
#endif
|
||||
|
||||
simulator.clearEvents(this);
|
||||
return true;
|
||||
}
|
||||
12
src/experiments/fire-interrupt/experiment.hpp
Normal file
12
src/experiments/fire-interrupt/experiment.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef __FIREINTERRUPT_EXPERIMENT_HPP__
|
||||
#define __FIREINTERRUPT_EXPERIMENT_HPP__
|
||||
|
||||
#include "efw/ExperimentFlow.hpp"
|
||||
|
||||
class FireInterruptExperiment : public fail::ExperimentFlow {
|
||||
public:
|
||||
FireInterruptExperiment() { }
|
||||
bool run();
|
||||
};
|
||||
|
||||
#endif // __FIREINTERRUPT_EXPERIMENT_HPP__
|
||||
Reference in New Issue
Block a user