fireinterrupt example experiment

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1031 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hellwig
2012-04-05 11:45:39 +00:00
parent ff828ba48f
commit d8bbc1e3f3
4 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,17 @@
set(EXPERIMENT_NAME fireinterrupt)
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})

Binary file not shown.

View File

@ -0,0 +1,46 @@
#include <iostream>
#include <unistd.h>
#include "experiment.hpp"
#include "SAL/SALInst.hpp"
#include "SAL/bochs/BochsRegister.hpp"
#include "controller/Event.hpp"
#include "util/Logger.hpp"
#include "config/AspectConfig.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
/* 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 :) )
*/
using std::endl;
bool fireinterruptExperiment::run()
{
Logger log("FireInterrupt", false);
log << "experiment start" << endl;
#if 1
while(1){
int j = 0;
for(j=0 ; j<=100 ; j++){
fi::BPEvent mainbp(0x1045f5);
sal::simulator.addEventAndWait(&mainbp);
}
sal::simulator.fireInterrupt(1);
}
#elif 1
sal::simulator.dbgEnableInstrPtrOutput(500);
#endif
return true;
}

View File

@ -0,0 +1,14 @@
#ifndef __FIREINTERRUPT_EXPERIMENT_HPP__
#define __FIREINTERRUPT_EXPERIMENT_HPP__
#include "controller/ExperimentFlow.hpp"
class fireinterruptExperiment : public fi::ExperimentFlow
{
public:
fireinterruptExperiment() { }
bool run();
};
#endif // __FIREINTERRUPT_EXPERIMENT_HPP__