[FIRRTL] EliminateWires: preserve sv.attributes when converting WireOp to NodeOp#10519
Open
bheneffe wants to merge 1 commit into
Open
[FIRRTL] EliminateWires: preserve sv.attributes when converting WireOp to NodeOp#10519bheneffe wants to merge 1 commit into
bheneffe wants to merge 1 commit into
Conversation
seldridge
approved these changes
May 21, 2026
Member
seldridge
left a comment
There was a problem hiding this comment.
LGTM. Only a few nits.
Thanks for fixing this. This would be surprising when it gets dropped!
…p to NodeOp When LowerAnnotations processes firrtl.AttributeAnnotation (the mechanism used by Chisel's addAttribute()), it sets sv.attributes on the FIRRTL WireOp. EliminateWires then converts single-writer passive WireOps to NodeOps without copying sv.attributes, causing attributes like mark_debug to be silently dropped before LowerToHW runs. Copy sv.attributes from the WireOp to the replacement NodeOp, matching the existing pattern in LowerToHW.cpp for RegOp and RegResetOp. Assisted-by: vscode/eicp:Claude Opus 4.6
8916574 to
500a664
Compare
Author
|
Hey @seldridge |
|
Results of circt-tests run for 500a664 compared to results for 5306f6f: sv-testsChanges in emitted diagnostics:
|
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.
Hi,
I ran into this while trying to use Chisel's
addAttribute()to annotate a wire with(* mark_debug = "true" *)for Vivado debug probes. The attribute was set correctly byLowerAnnotations(assv.attributeson the FIRRTLWireOp), but never appeared in the emitted SystemVerilog.Root cause:
EliminateWiresconverts single-writer passiveWireOps toNodeOps without copyingsv.attributes, so they get silently dropped beforeLowerToHWruns.Proposed fix: copy
sv.attributesfrom theWireOpto the replacementNodeOp, matching the existing pattern inLowerToHW.cppforRegOpandRegResetOp.Assisted-by: vscode/eicp:Claude Opus 4.6