amaranth icon indicating copy to clipboard operation
amaranth copied to clipboard

Enforce naming rules on core HDL

Open tpwrules opened this issue 1 year ago • 2 comments

The rules are quite simple and liberal:

  • Can't be None or the empty string (case-specific exceptions)
  • Can't contain a Unicode separator character
  • Can't contain a Unicode control character, undefined character, or surrogate character

I did not bother updating the deprecated _mem or _rec modules.

Pretty much all cases I tried using a name illegal by these rules, it caused a problem somewhere else (e.g. an RTLIL syntax error).

Maybe worth adding some logic to Fragment to catch any cases that slipped through?

Closes #1209

tpwrules avatar Mar 23 '24 23:03 tpwrules

Apparently having arbitrary FSM state is desirable, so those will be allowed again once https://github.com/amaranth-lang/amaranth/pull/1234 is merged. This will need a patch after then anyway.

tpwrules avatar Mar 24 '24 00:03 tpwrules

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.82%. Comparing base (fa2adbe) to head (e0bbaca). Report is 189 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1235      +/-   ##
==========================================
- Coverage   89.87%   89.82%   -0.05%     
==========================================
  Files          43       43              
  Lines        9992    10008      +16     
  Branches     2417     2417              
==========================================
+ Hits         8980     8990      +10     
- Misses        818      822       +4     
- Partials      194      196       +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 25 '24 21:03 codecov[bot]