Fix size parsing from memtrace
This commit is contained in:
@@ -75,8 +75,8 @@ MemTraceLine MemTraceReader::read_trace_at(const long cycle,
|
||||
// read it right now.
|
||||
return MemTraceLine{};
|
||||
} else if (line.cycle == cycle && line.lane_id == lane_id) {
|
||||
printf("fire! cycle=%ld, valid=%d, %s addr=%x \n", cycle, line.valid,
|
||||
line.loadstore, line.address);
|
||||
printf("fire! cycle=%ld, valid=%d, %s addr=%lx, size=%d \n", cycle, line.valid,
|
||||
line.loadstore, line.address, line.data_size);
|
||||
|
||||
// FIXME! Currently lane_id is assumed to be in round-robin order, e.g.
|
||||
// 0->1->2->3->0->..., both in the trace file and the order the caller calls
|
||||
@@ -119,11 +119,11 @@ extern "C" void memtrace_init(const char *filename) {
|
||||
// TODO: accept core_id as well
|
||||
extern "C" void memtrace_query(unsigned char trace_read_ready,
|
||||
unsigned long trace_read_cycle,
|
||||
int trace_read_lane_id,
|
||||
int trace_read_lane_id,
|
||||
unsigned char *trace_read_valid,
|
||||
unsigned long *trace_read_address,
|
||||
unsigned char *trace_read_is_store,
|
||||
int *trace_read_store_mask,
|
||||
int *trace_read_size,
|
||||
unsigned long *trace_read_data,
|
||||
unsigned char *trace_read_finished) {
|
||||
// printf("memtrace_query(cycle=%ld, tid=%d)\n", trace_read_cycle,
|
||||
@@ -136,8 +136,8 @@ extern "C" void memtrace_query(unsigned char trace_read_ready,
|
||||
auto line = reader->read_trace_at(trace_read_cycle, trace_read_lane_id);
|
||||
*trace_read_valid = line.valid;
|
||||
*trace_read_address = line.address;
|
||||
*trace_read_is_store = strcmp(line.loadstore, "STORE") == 0 ;
|
||||
*trace_read_store_mask = line.data_size;
|
||||
*trace_read_is_store = (strcmp(line.loadstore, "STORE") == 0);
|
||||
*trace_read_size = line.data_size;
|
||||
*trace_read_data = line.data;
|
||||
// This means finished and valid will go up at the same cycle. Need to
|
||||
// handle this without skipping the last line.
|
||||
|
||||
Reference in New Issue
Block a user