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,6 +76,10 @@ module SimMemTrace #(parameter FILENAME = "undefined", NUM_LANES = 4) (
|
||||
end
|
||||
__in_finished = 1'b0;
|
||||
end else begin
|
||||
// We have to write to __in_ regs only when trace_read_ready, or
|
||||
// otherwise we might overwrite lines that were previously valid
|
||||
// but the downstream missed by being not ready.
|
||||
if (trace_read_ready) begin
|
||||
for (integer tid = 0; tid < NUM_LANES; tid = tid + 1) begin
|
||||
memtrace_query(
|
||||
trace_read_ready,
|
||||
@@ -94,4 +98,5 @@ module SimMemTrace #(parameter FILENAME = "undefined", NUM_LANES = 4) (
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
endmodule
|
||||
|
||||
Reference in New Issue
Block a user