Initiate memtrace DPI only when trace_read_ready
This is required because otherwise we might overwrite into the Verilog registers that contain a valid trace line that was missed by downstream when it was not ready. Basically whenever trace_read_cycle stalls, we also want to stall __in_* registers.
This commit is contained in:
@@ -76,21 +76,26 @@ module SimMemTrace #(parameter FILENAME = "undefined", NUM_LANES = 4) (
|
|||||||
end
|
end
|
||||||
__in_finished = 1'b0;
|
__in_finished = 1'b0;
|
||||||
end else begin
|
end else begin
|
||||||
for (integer tid = 0; tid < NUM_LANES; tid = tid + 1) begin
|
// We have to write to __in_ regs only when trace_read_ready, or
|
||||||
memtrace_query(
|
// otherwise we might overwrite lines that were previously valid
|
||||||
trace_read_ready,
|
// but the downstream missed by being not ready.
|
||||||
trace_read_cycle,
|
if (trace_read_ready) begin
|
||||||
tid,
|
for (integer tid = 0; tid < NUM_LANES; tid = tid + 1) begin
|
||||||
|
memtrace_query(
|
||||||
|
trace_read_ready,
|
||||||
|
trace_read_cycle,
|
||||||
|
tid,
|
||||||
|
|
||||||
__in_valid[tid],
|
__in_valid[tid],
|
||||||
__in_address[tid],
|
__in_address[tid],
|
||||||
|
|
||||||
__in_is_store[tid],
|
|
||||||
__in_size[tid],
|
|
||||||
__in_data[tid],
|
|
||||||
|
|
||||||
__in_finished
|
__in_is_store[tid],
|
||||||
);
|
__in_size[tid],
|
||||||
|
__in_data[tid],
|
||||||
|
|
||||||
|
__in_finished
|
||||||
|
);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user