Closed msfschaffner closed 3 years ago
b/170256350
There is a closely related rule [v2001-generate-begin]:
That one checks explicitly for generate begin
. I should ask around if that one can be generalized to cover all uses of generate
.
In both places I checked, including the lowRISC guide section you cited, I see:
Do not wrap a generate construct with an additional begin block.
Do not use generate regions {generate, endgenerate}.
So they are in agreement.
Of these statements, the second seems to cover the first, making it somewhat redundant. WDYT?
If not redundant, should these two statements be implemented as one rule or separate?
Indeed, the second one seems to be a super set of the first with respect to style guidance (i.e., don't use generate regions). Hence I would be ok with just implementing one rule for this, unless we see a need that this has to be made configurable in the future (and in such a case you may still want both rules).
Summary
The google and lowRISC style guides discourage the use of
generate
regions and separategenvar
declarations, since they are considered legacy constructs.It would be nice if the style linter could detect those constructs and flag them.
Suggested rule names:
[legacy-genvar-declaration]
[legacy-generate-region]
Test cases and examples
The more examples you provide, the easier it will be for someone to come along and implement it.
bad:
good: