Relay full trace line info to DPI

This commit is contained in:
Hansung Kim
2023-04-12 13:54:59 -07:00
parent 1057ed59d3
commit 8e763b512a
3 changed files with 44 additions and 17 deletions

View File

@@ -124,14 +124,18 @@ extern "C" void memtracelogger_init(const char *filename) {
extern "C" void memtracelogger_log(unsigned char trace_log_valid,
unsigned long trace_log_cycle,
unsigned long trace_log_address,
unsigned int trace_log_lane_id,
int trace_log_lane_id,
unsigned char trace_log_is_store,
int trace_log_size,
unsigned long trace_log_data,
unsigned char *trace_log_ready) {
// printf("memtrace_query(cycle=%ld, tid=%d)\n", trace_read_cycle,
// trace_read_lane_id);
*trace_log_ready = 1;
if (trace_log_valid) {
printf("%s: [%lu] valid: address=0x%lx, tid=%u\n", __func__,
trace_log_cycle, trace_log_address, trace_log_lane_id);
printf("%s: [%lu] valid: address=%lx, tid=%u, size=%d\n", __func__,
trace_log_cycle, trace_log_address, trace_log_lane_id,
trace_log_size);
}
}

View File

@@ -1,3 +1,4 @@
// FIXME hardcoded
`define DATA_WIDTH 64
`define MAX_NUM_LANES 32
`define LOGSIZE_WIDTH 32
@@ -81,7 +82,6 @@ module SimMemTrace #(parameter FILENAME = "undefined", NUM_LANES = 4) (
memtrace_init(FILENAME);
end
// Evaluate the signals on the positive edge
always @(posedge clock) begin
if (reset) begin
for (integer tid = 0; tid < NUM_LANES; tid = tid + 1) begin