[Moore] Drop named_constant op in favor of dbg.variable #7624
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.
Remove the
NamedConstantOp
and replace its uses withVariableOp
from the debug dialect.The op was originally added to track the value of constant parameters, localparams, and specparams in the IR. In ImportVerilog, such parameters would generate a corresponding
named_constant
op and all references to the parameter by name would be replaced with thenamed_constant
's result.This doesn't really work well for parameters defined outside a module, such as in packages or at the root of the Verilog source file. (Modules are isolated from above, preventing the use of
named_constant
s from outside the module.) Therefore expressions would generally fall back to materializing constants directly where they were used.Since the named constant ops are only there to track a constant value in the IR for the user's debugging convenience, using the debug dialect directly feels a lot more appropriate.