Skip to content

hw: gate the per-instruction trace behind `ifdef DEBUG - #328

Merged
colluca merged 1 commit into
pulp-platform:developfrom
DanielKellerM:snitch-trace-plusarg
Jul 30, 2026
Merged

hw: gate the per-instruction trace behind `ifdef DEBUG#328
colluca merged 1 commit into
pulp-platform:developfrom
DanielKellerM:snitch-trace-plusarg

Conversation

@DanielKellerM

@DanielKellerM DanielKellerM commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

The snitch_cc .dasm tracer opens logs/trace_hart_*.dasm and $fwrites a
line per retired instruction unconditionally (guarded only by translate_off),
for every hart in the design. On a multi-cluster sim that is 100+ harts each
doing a per-cycle $sformat + $fwrite to disk, which dominates wall-clock
during compute and writes hundreds of MB per run even when the trace is unwanted.

Fully gate the tracer behind `ifdef DEBUG

@DanielKellerM
DanielKellerM force-pushed the snitch-trace-plusarg branch 2 times, most recently from e4c118d to e9a50ba Compare July 30, 2026 13:24
@DanielKellerM DanielKellerM changed the title hw: gate the per-instruction trace behind a +trace plusarg hw: gate the per-instruction trace behind `ifdef DEBUG Jul 30, 2026
@DanielKellerM
DanielKellerM marked this pull request as ready for review July 30, 2026 13:40
Copilot AI review requested due to automatic review settings July 30, 2026 13:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The snitch_cc .dasm tracer opens logs/trace_hart_*.dasm and $fwrites a line per
retired instruction unconditionally (guarded only by translate_off) -- for every
hart in the design. On a multi-cluster sim that is 100+ harts each doing per-cycle
$sformat + $fwrite to disk, which dominates wall-clock during compute and writes
hundreds of MB per run even when the trace is not wanted.

Fully gate the tracer behind `ifdef DEBUG so it is compiled out by default, and
pass -DDEBUG down to the RTL via bender when DEBUG=ON (reusing the existing DEBUG
build flag, which the tracer already keys off for $fflush).
@DanielKellerM
DanielKellerM force-pushed the snitch-trace-plusarg branch from e9a50ba to 5d8b93d Compare July 30, 2026 13:43
@colluca
colluca changed the base branch from main to develop July 30, 2026 13:49
@colluca
colluca merged commit 3299c73 into pulp-platform:develop Jul 30, 2026
6 checks passed
@colluca
colluca deleted the snitch-trace-plusarg branch July 30, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants