[ImportVerilog] Incorporate block names to variable/instance names #8680
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.
Use the names of surrounding generate blocks as a prefix for variable and instance names. This makes the names match up more closely with how existing EDA tools would label variables and instances embededded in generate blocks.
Consider the following Verilog input:
The ImportVerilog conversion pass will now produce the following variables:
This closely matches names like
foo.bar[2].z
orfoo_bar_2_z
that would be generated by common EDA tools. Ideally we would be able to use a name likefoo.bar[2].z
directly, but ExportVerilog currently does not support escaped identifiers, causing the name to be sanitized to something likefoo_bar5B25D_z
.By incorporating for-generate loop indices and block names into the variable name, logical equivalence checking should become easier and the signal names in Arcilator waveforms will match user expectations more closely.
Fixes #8679.