Use debug_name by default for instances #323
Merged
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.
This PR changes the default naming scheme for instances.
Before, we would generate a unique name
inst{n}
wheren
is equal to the current number of instances in the definition. This makes it challenging to debug because you have to look at the instantiation to figure out what module was being instances (which is not always obvious).@priyanka-raina suggested that we attach module names to instances so we can see which module is being instanced (which in turn attaches the module names to the wires). We already had this logic for error message so it was fairly simple to repurpose.
The new naming scheme is:
{module_name}_inst{n}
wheren
is the number of timesmodule_name
has been instanced in the current definition.This shouldn't affect any functionality, it should improve debugging experience, however it is a pain for any existing gold files. I've updated the magma golds here, mantle will also need to be updated.
Let me know if you have any issues with this new proposed naming scheme.