hw: gate the iDMA tracer behind the DEBUG define - #329
Draft
DanielKellerM wants to merge 2 commits into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ensures iDMA and Snitch instruction tracing are consistently controlled by a single DEBUG knob across both vsim and Verilator simulation flows, preventing unwanted log generation when DEBUG is off.
Changes:
- Gate iDMA tracing (
DMATracing) behind`ifdef DEBUGby deriving it from a localDMATraceparameter. - Wire
-DDEBUGinto the Verilator Bender flags whenDEBUG=ON, aligning behavior with thevsimflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| make/verilator.mk | Adds conditional -DDEBUG to Verilator’s Bender flags when DEBUG=ON. |
| hw/snitch_cluster/src/snitch_cc.sv | Drives idma_inst64_top.DMATracing from a DEBUG-gated localparam instead of a hardcoded enable. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Follow the snitch TRACE flag (traces on by default, TRACE=OFF disables via +define+TRACE_OFF) instead of DEBUG, which coupled tracing to the +acc waveform slowdown. idma_inst64_top derives DMATracing from `ifndef TRACE_OFF, so the iDMA backend traces by default and is silenced together with the snitch_cc trace under TRACE=OFF.
The trace define reaches only the vsim bender flags; the Verilator flow builds from the base flags. Add the TRACE=OFF -> -DTRACE_OFF guard to SN_VLT_BENDER_FLAGS so the opt-out silences traces under Verilator too.
DanielKellerM
force-pushed
the
idma-trace-follow-debug
branch
from
August 3, 2026 12:14
8435b4f to
342bbe3
Compare
DanielKellerM
marked this pull request as draft
August 3, 2026 12:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows up on #328 and coordinates with @colluca's upcoming
TRACEchange.idma_inst64_topwas instantiated with a hardcoded.DMATracing (1), so the iDMA backend wrotedma_trace_*.logon every run. Rather than couple this toDEBUG(which also pulls in+accand slows the sim), it now follows the sameTRACEopt-out being introduced for thesnitch_cctrace: traces on by default,TRACE=OFFdisables them.Two commits:
hw: gate the iDMA tracer with the TRACE_OFF opt-out-idma_inst64_topderives.DMATracingfrom a localDMATraceparameter gated by`ifndef TRACE_OFF, so the iDMA trace is silenced together with thesnitch_cctrace underTRACE=OFF.make: wire the TRACE_OFF opt-out into the Verilator flow- the trace define reaches only the vsim bender flags; Verilator builds from the base flags. This adds theTRACE=OFF -> -DTRACE_OFFguard toSN_VLT_BENDER_FLAGSso the opt-out works under Verilator too.Coordination with the
TRACEchangeDMATracingis an elaboration-time parameter, soTRACE_OFFhas to be a compile define (bender-DTRACE_OFF/--vlog-arg), not just a+defineon thevsimrun command.SN_VSIM_FLAGSfeeds thevsimsimulate step (vsim.mk:103/110), whileSN_VLOG_FLAGS/bender feed the compile step (vsim.mk:90), so a+define+TRACE_OFFonSN_VSIM_FLAGSalone would not reach either thesnitch_cc`ifndefor this parameter. This PR handles the Verilator wiring; the vsim compile-side wiring belongs with theTRACEchange.Verified (iDMA side, self-contained on Verilator)
dma_1don Verilator: default build -> iDMAdma_trace_*.logpresent;TRACE=OFFbuild -> absent. (Thesnitch_cc.dasmtrace stays on the oldDEBUGgate until theTRACEchange lands, so it reads 0 in both cases here; it will followTRACE_OFFonce that lands.)Draft until the
TRACEchange lands; will rebase and re-run the full on/off smoke-check on both flows then.