ecos: additional burst fault model

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1961 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hsc
2012-11-27 17:06:32 +00:00
parent 5fe61e0f3f
commit 87ee9df37b
4 changed files with 38 additions and 6 deletions

View File

@ -346,7 +346,11 @@ bool EcosKernelTestCampaign::add_experiment_ec(const std::string& variant, const
}
count_exp_jobs++;
count_exp += 8;
if (ECOS_FAULTMODEL_BURST) {
count_exp++;
} else {
count_exp += 8;
}
// enqueue job
#if 1
@ -357,6 +361,7 @@ bool EcosKernelTestCampaign::add_experiment_ec(const std::string& variant, const
d->msg.set_instr2_offset(instr2);
d->msg.set_instr2_address(instr_absolute);
d->msg.set_mem_addr(data_address);
d->msg.set_faultmodel(ECOS_FAULTMODEL_BURST ? d->msg.BURST : d->msg.SINGLEBITFLIP);
campaignmanager.addParam(d);
#endif
@ -371,7 +376,11 @@ bool EcosKernelTestCampaign::add_known_ec(const std::string& variant, const std:
}
count_known_jobs++;
count_known += 8;
if (ECOS_FAULTMODEL_BURST) {
count_known++;
} else {
count_known += 8;
}
#if 1
add_result(variant, benchmark, instr1, instr2, instr_absolute, data_address,
@ -497,7 +506,8 @@ void EcosKernelTestCampaign::collect_results()
EcosKernelTestExperimentData *res;
while ((res = static_cast<EcosKernelTestExperimentData *>(campaignmanager.getDone()))) {
// sanity check
if (res->msg.result_size() != 8) {
if ((!ECOS_FAULTMODEL_BURST && res->msg.result_size() != 8)
|| (ECOS_FAULTMODEL_BURST && res->msg.result_size() != 1)) {
m_log << "wtf, result_size = " << res->msg.result_size() << endl;
continue;
}
@ -505,6 +515,7 @@ void EcosKernelTestCampaign::collect_results()
EcosKernelTestProtoMsg_Result const *prev_singleres = 0;
int first_bit = 0, bit_width = 0;
#if !ECOS_FAULTMODEL_BURST
// one job contains 8 experiments
for (int idx = 0; idx < res->msg.result_size(); ++idx) {
EcosKernelTestProtoMsg_Result const *cur_singleres = &res->msg.result(idx);
@ -533,6 +544,12 @@ void EcosKernelTestCampaign::collect_results()
first_bit = cur_singleres->bit_offset();
bit_width = 1;
}
#else
// burst fault: bits 0-7, one experiment
first_bit = 0;
bit_width = 8;
prev_singleres = &res->msg.result(0);
#endif
add_result(res->msg.variant(), res->msg.benchmark(), res->msg.instr1_offset(),
res->msg.instr2_offset(), res->msg.instr2_address(), res->msg.mem_addr(),
first_bit, bit_width, prev_singleres->resulttype(), prev_singleres->ecos_test_result(),

View File

@ -24,6 +24,12 @@ message EcosKernelTestProtoMsg {
// to instr_address
optional int32 injection_ip = 7;
enum FaultModel {
SINGLEBITFLIP = 1;
BURST = 2;
}
optional FaultModel faultmodel = 10;
repeated group Result = 8 {
// single experiment bit offset
required int32 bit_offset = 1;

View File

@ -321,7 +321,8 @@ bool EcosKernelTestExperiment::faultInjection() {
}
#endif
// for each job we're actually doing *8* experiments (one for each bit)
// for each job with the SINGLEBITFLIP fault model we're actually doing *8*
// experiments (one for each bit)
for (int bit_offset = 0; bit_offset < 8; ++bit_offset) {
// 8 results in one job
EcosKernelTestProtoMsg_Result *result = param.msg.add_result();
@ -365,7 +366,13 @@ bool EcosKernelTestExperiment::faultInjection() {
// --- fault injection ---
MemoryManager& mm = simulator.getMemoryManager();
byte_t data = mm.getByte(mem_addr);
byte_t newdata = data ^ (1 << bit_offset);
byte_t newdata;
if (param.msg.has_faultmodel() && param.msg.faultmodel() == param.msg.BURST) {
newdata = data ^ 0xff;
bit_offset = 8; // enforce loop termination
} else if (!param.msg.has_faultmodel() || param.msg.faultmodel() == param.msg.SINGLEBITFLIP) {
newdata = data ^ (1 << bit_offset);
}
mm.setByte(mem_addr, newdata);
// note at what IP we did it
int32_t injection_ip = simulator.getRegisterManager().getInstructionPointer();
@ -549,7 +556,8 @@ bool EcosKernelTestExperiment::faultInjection() {
}
}
// sanity check: do we have exactly 8 results?
if (param.msg.result_size() != 8) {
if ((!param.msg.has_faultmodel() || param.msg.faultmodel() == param.msg.SINGLEBITFLIP)
&& param.msg.result_size() != 8) {
log << "WTF? param.msg.result_size() != 8" << endl;
} else {
param.msg.set_runtime(timer);

View File

@ -1,3 +1,4 @@
#pragma once
#define PREREQUISITES 0
#define ECOS_FAULTMODEL_BURST 0