Backport SimMemTrace
This commit is contained in:
@@ -23,6 +23,7 @@ MemTraceReader::MemTraceReader(const std::string &filename)
|
|||||||
infile.open(filename);
|
infile.open(filename);
|
||||||
if (infile.fail()) {
|
if (infile.fail()) {
|
||||||
fprintf(stderr, "failed to open file %s\n", filename.c_str());
|
fprintf(stderr, "failed to open file %s\n", filename.c_str());
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,8 +61,6 @@ void MemTraceReader::parse(const bool has_source) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(infile >> line.cycle >> loadstore >> line.core_id >> line.lane_id)) {
|
if (!(infile >> line.cycle >> loadstore >> line.core_id >> line.lane_id)) {
|
||||||
printf("char=[%c]\n", infile.peek());
|
|
||||||
// assert(!infile.eof());
|
|
||||||
error(fileline, "failed parsing cycle..lane_id");
|
error(fileline, "failed parsing cycle..lane_id");
|
||||||
}
|
}
|
||||||
if (has_source && !(infile >> source)) {
|
if (has_source && !(infile >> source)) {
|
||||||
@@ -101,8 +100,6 @@ MemTraceLine MemTraceReader::read_trace_at(const long cycle, const int lane_id,
|
|||||||
MemTraceLine line;
|
MemTraceLine line;
|
||||||
line.valid = false;
|
line.valid = false;
|
||||||
|
|
||||||
// printf("tick(): cycle=%ld\n", cycle);
|
|
||||||
|
|
||||||
if (finished()) {
|
if (finished()) {
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user