ecos: use MemoryMap materialization instead of own code

Change-Id: I8615a066c53e1d6a02c78bce3199fa1f73edfda9
This commit is contained in:
Horst Schirmeier
2013-04-09 13:25:02 +02:00
parent 4d03b7ce5c
commit 2d45a2c52c
2 changed files with 3 additions and 25 deletions

View File

@ -21,28 +21,6 @@ const std::string EcosKernelTestCampaign::dir_images("images");
const std::string EcosKernelTestCampaign::dir_prerequisites("prerequisites");
const std::string EcosKernelTestCampaign::dir_results("results");
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;
unsigned guest_addr, guest_len;
unsigned count = 0;
while (getline(file, buf)) {
stringstream ss(buf, ios::in);
ss >> guest_addr >> guest_len;
mm.add(guest_addr, guest_len);
count++;
}
file.close();
assert(count > 0);
return (count > 0);
}
bool EcosKernelTestCampaign::writeTraceInfo(unsigned instr_counter, unsigned timeout,
unsigned mem1_low, unsigned mem1_high, // < 1M
unsigned mem2_low, unsigned mem2_high, // >= 1M
@ -214,8 +192,7 @@ bool EcosKernelTestCampaign::run()
// a map of addresses of ECC protected objects
MemoryMap mm;
EcosKernelTestCampaign::readMemoryMap(mm,
filename_memorymap(variant, benchmark).c_str());
mm.readFromFile(filename_memorymap(variant, benchmark).c_str());
// map for keeping one "open" EC for every address
// (maps injection data address => equivalence class)