Introducing the BufferCache announced on the mailing list, and some small changes. L4Sys is still WIP.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1316 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
unzner
2012-06-06 15:13:16 +00:00
parent 3284fba7d3
commit 715a393598
12 changed files with 237 additions and 24 deletions

View File

@ -33,7 +33,7 @@ bool L4SysCampaign::run()
int count = 0;
//iterate over one register
for (int bit_offset = 0; bit_offset < 1; ++bit_offset) {
for (int instr_offset = 0; instr_offset < COOL_ECC_NUMINSTR; ++instr_offset) {
for (int instr_offset = 0; instr_offset < L4SYS_NUMINSTR; ++instr_offset) {
L4SysExperimentData *d = new L4SysExperimentData;
d->msg.set_instr_offset(instr_offset);
d->msg.set_bit_offset(bit_offset);

View File

@ -1,4 +1,5 @@
#include <iostream>
#include <map>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@ -33,7 +34,7 @@ using std::endl;
char const * const state_folder = "l4sys.state";
char const * const instr_list_fn = "ip.list";
char const * const golden_run_fn = "golden.out";
sal::address_t const aspace = 0x1fd44000;
sal::address_t const aspace = 0x01e00000;
std::string output;
std::vector<sal::address_t> instr_list;
std::string golden_run;
@ -80,14 +81,12 @@ bool L4SysExperiment::run() {
log << "startup" << endl;
//FIXME: this is a race condition:
//only one L4SysExperiment instance should execute this block
//at a time
#ifdef PREPARE_EXPERIMENT
struct stat teststruct;
// STEP 1: run until interesting function starts, and save state
if (stat(state_folder, &teststruct) == -1) {
bp.setWatchInstructionPointer(COOL_ECC_FUNC_ENTRY);
bp.setWatchInstructionPointer(L4SYS_FUNC_ENTRY);
sal::simulator.addEventAndWait(&bp);
log << "test function entry reached, saving state" << endl;
@ -112,7 +111,7 @@ bool L4SysExperiment::run() {
std::ofstream instr_list_file(instr_list_fn);
instr_list_file << std::hex;
bp.setWatchInstructionPointer(fi::ANY_ADDR);
while (bp.getTriggerInstructionPointer() != COOL_ECC_CALCDONE) {
while (bp.getTriggerInstructionPointer() != L4SYS_FUNC_EXIT) {
sal::simulator.addEventAndWait(&bp);
//short sanity check
sal::address_t curr_instr = bp.getTriggerInstructionPointer();
@ -146,7 +145,7 @@ bool L4SysExperiment::run() {
sal::simulator.addSuppressedInterrupt(32);
std::ofstream golden_run_file(golden_run_fn);
bp.setWatchInstructionPointer(COOL_ECC_CALCDONE);
bp.setWatchInstructionPointer(L4SYS_FUNC_EXIT);
bp.setCounter(times_run);
sal::simulator.addEvent(&bp);
fi::BaseEvent* ev = waitIOOrOther(true);
@ -183,10 +182,10 @@ bool L4SysExperiment::run() {
output.reserve(flen);
}
//end of critical section
#endif
// STEP 4: The actual experiment.
for (int i = 0; i < COOL_ECC_NUMINSTR; i++) {
for (int i = 0; i < 1/*L4SYS_NUMINSTR*/; i++) {
log << "restoring state" << endl;
sal::simulator.restore(state_folder);
@ -195,7 +194,7 @@ bool L4SysExperiment::run() {
if (!m_jc.getParam(param)) {
log << "Dying." << endl;
// communicate that we were told to die
sal::simulator.terminate(1); // "return (false);" ?
sal::simulator.terminate(1);
}
int id = param.getWorkloadID();
int instr_offset = param.msg.instr_offset();
@ -239,10 +238,10 @@ bool L4SysExperiment::run() {
}
// aftermath
fi::BPSingleEvent ev_done(COOL_ECC_CALCDONE, aspace);
fi::BPSingleEvent ev_done(L4SYS_FUNC_EXIT, aspace);
ev_done.setCounter(times_run);
sal::simulator.addEvent(&ev_done);
const unsigned instr_run = times_run * COOL_ECC_NUMINSTR;
const unsigned instr_run = times_run * L4SYS_NUMINSTR;
fi::BPSingleEvent ev_timeout(fi::ANY_ADDR, aspace);
ev_timeout.setCounter(instr_run + 3000);
sal::simulator.addEvent(&ev_timeout);
@ -264,7 +263,7 @@ bool L4SysExperiment::run() {
if (ev == &ev_done) {
if (strcmp(output.c_str(), golden_run.c_str()) == 0) {
log << std::dec << "Result DONE" << endl;
param.msg.set_resulttype(param.msg.CALCDONE);
param.msg.set_resulttype(param.msg.DONE);
} else {
log << std::dec << "Result WRONG" << endl;
param.msg.set_resulttype(param.msg.WRONG);

View File

@ -3,9 +3,10 @@
// FIXME autogenerate this
#define COOL_ECC_FUNC_ENTRY 0x1007cd0
#define COOL_ECC_CALCDONE 0x1007d3a
#define COOL_ECC_NUMINSTR 3166
#define HEADLESS_EXPERIMENT
#define L4SYS_FUNC_ENTRY 0x1007cd0
#define L4SYS_FUNC_EXIT 0x1007d3a
#define L4SYS_NUMINSTR 3184
//#define HEADLESS_EXPERIMENT
#define PREPARE_EXPERIMENT
#endif

View File

@ -6,7 +6,7 @@ message L4SysProtoMsg {
// results
// make these optional to reduce overhead for server->client communication
enum ResultType {
CALCDONE = 1;
DONE = 1;
TIMEOUT = 2;
TRAP = 3;
INTR = 4;