Backport SimMemTrace

This commit is contained in:
Hansung Kim
2023-05-07 16:13:28 -07:00
parent a6dbfc3901
commit c75eaaf727

View File

@@ -23,6 +23,7 @@ MemTraceReader::MemTraceReader(const std::string &filename)
infile.open(filename);
if (infile.fail()) {
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)) {
printf("char=[%c]\n", infile.peek());
// assert(!infile.eof());
error(fileline, "failed parsing cycle..lane_id");
}
if (has_source && !(infile >> source)) {
@@ -101,8 +100,6 @@ MemTraceLine MemTraceReader::read_trace_at(const long cycle, const int lane_id,
MemTraceLine line;
line.valid = false;
// printf("tick(): cycle=%ld\n", cycle);
if (finished()) {
return line;
}