Fix constants generation with same c_name between register and field #44
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.
Bug introduced in #43:
If there is a register containing a single field and both share the same name, both of their
c_name
s will be equal. Hence, when the default separator_
is selected,pr_name()
will return the same name for the register as well as for the field. Printing the address for the register and the field will therefore lead to the same constant printed twice.E.g.
will lead to the following VHDL constant generation (
ADDR_REG_SET_FOO_BAR
declared twice):Since before #43, the address constant was only printed for the register (but not for the field), the constant was previously printed only once.
This fix blocks the printing of the constant if a field and its register share the same
c_name
.