ecos_kernel_test: merge experiment steps 0-2 into a single run

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1443 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
chb
2012-07-09 13:58:47 +00:00
parent 4aa4943ae9
commit bc922a98d3
6 changed files with 232 additions and 184 deletions

View File

@ -12,8 +12,6 @@
#include "util/ProtoStream.hpp"
#include "util/MemoryMap.hpp"
#include "ecc_region.hpp"
#include "../plugins/tracing/TracingPlugin.hpp"
//#define PRUNING_DEBUG_OUTPUT
@ -23,6 +21,29 @@ using namespace fail;
char const * const trace_filename = "trace.tc";
char const * const results_filename = "ecos_kernel_test.csv";
char const * const mm_filename = "memory_map.txt"; //TODO: sync with experiment.cc
bool EcosKernelTestCampaign::readMemoryMap(fail::MemoryMap &mm, char const * const filename) {
ifstream file(filename);
if (!file.is_open()) {
cout << "failed to open " << filename << endl;
return false;
}
string buf;
stringstream ss(ios::in);
unsigned guest_addr, guest_len;
unsigned count = 0;
while (getline(file, buf)) {
ss.str(buf);
ss >> guest_addr >> guest_len;
mm.add(guest_addr, guest_len);
count++;
}
file.close();
return (count > 0);
}
// equivalence class type: addr, [i1, i2]
// addr: byte to inject a bit-flip into
@ -60,9 +81,7 @@ bool EcosKernelTestCampaign::run()
// a map of addresses of ECC protected objects
MemoryMap mm;
for (unsigned i = 0; i < sizeof(memoryMap)/sizeof(*memoryMap); ++i) {
mm.add(memoryMap[i][0], memoryMap[i][1]);
}
EcosKernelTestCampaign::readMemoryMap(mm, mm_filename);
// set of equivalence classes that need one (rather: eight, one for
// each bit in that byte) experiment to determine them all