Change-Id: I8022d937477668253c613e97c3a579ae65084b1e
This commit is contained in:
Horst Schirmeier
2014-02-09 18:54:21 +01:00
parent 5df364dea2
commit 277958b31b
45 changed files with 430 additions and 444 deletions

View File

@ -5,7 +5,7 @@ configure_file(../instantiate-experiment.ah.in
)
## Setup desired protobuf descriptions HERE ##
set(MY_PROTOS
set(MY_PROTOS
lra_simple.proto
)

View File

@ -11,9 +11,9 @@ using namespace std;
using namespace fail;
using namespace google::protobuf;
void LraSimpleCampaign::cb_send_pilot(DatabaseCampaignMessage pilot) {
void LraSimpleCampaign::cb_send_pilot(DatabaseCampaignMessage pilot)
{
LraSimpleExperimentData *data = new LraSimpleExperimentData;
data->msg.mutable_fsppilot()->CopyFrom(pilot);
campaignmanager.addParam(data);
}

View File

@ -14,7 +14,7 @@ public:
};
class LraSimpleCampaign : public fail::DatabaseCampaign {
virtual const google::protobuf::Descriptor * cb_result_message()
virtual const google::protobuf::Descriptor * cb_result_message()
{ return google::protobuf::DescriptorPool::generated_pool()->FindMessageTypeByName("LraSimpleProtoMsg"); }
virtual void cb_send_pilot(DatabaseCampaignMessage pilot);

View File

@ -54,7 +54,6 @@ int32_t correct_result[100] = {
0, 0, 0, 0
};
// ToDo: Move this functionality to SimulatorController
bool LRASimplePandaExperiment::navigateToInjectionPoint(ConcreteInjectionPoint &ip) {
Logger log_nav("navigator", false);
@ -66,11 +65,10 @@ bool LRASimplePandaExperiment::navigateToInjectionPoint(ConcreteInjectionPoint &
if (ipm.has_checkpoint_id()) {
// ToDo: Load CP state!
log_nav << "FATAL ERROR: CPs not yet implemented!" << endl;
log_nav << "FATAL ERROR: CPs not yet implemented!" << endl;
simulator.terminate(1);
}
log_nav << "Navigating to next instruction at navigational costs of " << ipm.costs() << endl;
log_nav << "Length of hop-chain: " << ipm.hops_size() << endl;
@ -110,7 +108,6 @@ bool LRASimplePandaExperiment::navigateToInjectionPoint(ConcreteInjectionPoint &
log_nav << "FATAL ERROR: Unexpected event while navigating!" << endl;
simulator.terminate(1);
}
}
#else
// Step nav
@ -195,7 +192,7 @@ bool LRASimplePandaExperiment::run()
while (true) {
logger << "asking jobserver for parameters. Undone: "<<jobClient->getNumberOfUndoneJobs() << endl;
LraSimpleExperimentData param;
if(!jobClient->getParam(param)){
if (!jobClient->getParam(param)) {
logger << "Dying." << endl; // We were told to die.
simulator.terminate(1);
}
@ -203,17 +200,17 @@ bool LRASimplePandaExperiment::run()
logger << "New param" << param.msg.DebugString() << endl;
// Get input data from Jobserver
unsigned injection_instr = param.msg.fsppilot().injection_instr();
unsigned injection_instr = param.msg.fsppilot().injection_instr();
address_t data_address = param.msg.fsppilot().data_address();
// unsigned data_width = param.msg.fsppilot().data_width();
ConcreteInjectionPoint ip;
ip.parseFromCampaignMessage(param.msg.fsppilot());
for (unsigned experiment_id = 0; experiment_id < LRASP_NUM_EXP_PER_PILOT; ++experiment_id) {
LraSimpleProtoMsg_Result *result = param.msg.add_result();
for (unsigned experiment_id = 0; experiment_id < LRASP_NUM_EXP_PER_PILOT; ++experiment_id) {
LraSimpleProtoMsg_Result *result = param.msg.add_result();
executed_jobs ++;
WallclockTimer timer;
WallclockTimer timer;
timer.startTimer();
/********************
@ -255,7 +252,6 @@ bool LRASimplePandaExperiment::run()
// Alternatively for single-bit-flips:
// data ^= 1 << experiment_id;
logger << "Injection bitflips at address " << hex << data_address << dec << endl;
timer.startTimer();
@ -321,7 +317,7 @@ bool LRASimplePandaExperiment::run()
BaseListener* ev = simulator.resume();
if (ev == &ev_timeout) {
logger << "Timeout!" << endl;
logger << "Timeout!" << endl;
result->set_resulttype(result->ERR_TIMEOUT);
} else if (ev == &ev_trap) {
logger << "Trap!" << endl;
@ -332,7 +328,7 @@ bool LRASimplePandaExperiment::run()
ev == &ev_unauth_mem_acc_4) {
result->set_resulttype(result->ERR_OUTSIDE_TEXT);
logger << hex << "Unauthorized memory access (" << ((((MemAccessListener*)ev)->getTriggerAccessType() == fail::MemAccessEvent::MEM_READ) ? "R" : "W") <<
logger << hex << "Unauthorized memory access (" << ((((MemAccessListener*)ev)->getTriggerAccessType() == fail::MemAccessEvent::MEM_READ) ? "R" : "W") <<
") at instruction " << ((MemAccessListener*)ev)->getTriggerInstructionPointer() << " access address: " <<
((MemAccessListener*)ev)->getTriggerAddress() << dec << endl;
} else if (ev == &ev_func_end) {
@ -357,12 +353,12 @@ bool LRASimplePandaExperiment::run()
result->set_experiment_number(executed_jobs);
simulator.clearListeners();
}
simulator.clearListeners();
}
jobClient->sendResult(param);
logger << param.debugString();
}
jobClient->sendResult(param);
logger << param.debugString();
}
logger << "jobClient.getNumberOfUndoneJobs() = " << jobClient->getNumberOfUndoneJobs() << "executed_jobs = " << executed_jobs << endl;

View File

@ -1,6 +1,6 @@
#ifndef __LRA_SIMPLE_PANDA_EXPERIMENT_HPP__
#define __LRA_SIMPLE_PANDA_EXPERIMENT_HPP__
#define __LRA_SIMPLE_PANDA_EXPERIMENT_HPP__
#include "efw/ExperimentFlow.hpp"
#include "cpn/InjectionPoint.hpp"
#include "util/ElfReader.hpp"

View File

@ -6,25 +6,24 @@ message LraSimpleProtoMsg {
repeated group Result = 2 {
enum ResultType {
OK = 1;
ERR_WRONG_RESULT = 2;
ERR_WRONG_RESULT = 2;
ERR_TRAP = 3;
ERR_TIMEOUT = 4;
ERR_OUTSIDE_TEXT = 5;
}
//required int32 bitoffset = 1 [(sql_primary_key) = true];
required uint32 experiment_number = 1 [(sql_primary_key) = true];
//required int32 bitoffset = 1 [(sql_primary_key) = true];
required uint32 experiment_number = 1 [(sql_primary_key) = true];
required ResultType resulttype = 2;
// Times for evaluation
required float time_init = 3;
required float time_nav = 4;
required float time_inject = 5;
required float time_aftermath = 6;
}
}
}

View File

@ -8,8 +8,9 @@
int main(int argc, char **argv)
{
fail::CommandLine &cmd = fail::CommandLine::Inst();
for (int i = 1; i < argc; ++i)
for (int i = 1; i < argc; ++i) {
cmd.add_args(argv[i]);
}
LraSimpleCampaign c;
if (fail::campaignmanager.runCampaign(&c)) {