Convert ports to ANSI: a Verilog-2001 header merged with its body declarations, and a verifier that never drops a comment or an attribute
TODO §51 (docs/features/ansi-conversion), the second §8 refactoring. `vlog_refactor::convert_to_ansi` (ports/ansi.rs, ports/merge.rs): for a `PortList::NonAnsi` module, each header name gains its direction, net or variable type, signing and packed dims from the body declarations that describe it, merged per IEEE 1800 §23.2.2.2 (`output b; reg [7:0] b;` → `output reg [7:0] b`), as insertions around the untouched name so no reference anchor moves; the absorbed declarations are deleted with their comments carried onto the ports. Twenty-three refusals, each a sentence (port expressions, disagreeing ranges, initialisers, directives, a comment that would have to move into a one-line list, an attributed declaration). Code action `lucisv: convert ports to ANSI (N ports)` and command `lucisv.convertToAnsi`. Review rework (QA's two HIGHs, invariant 4): the verifier's comment rule is now `never_dropped` over comments and attribute instances alike — `has ≥ had`, `wrote ≤ gone` unless the text is the one generated placeholder, `has == had − gone + wrote` — with masked-corruption attack tests, re-attacked by QA (30-plus pairs, a neutering pass). Neither the corpus nor opentitan holds a non-ANSI module; acceptance is by round trip (ANSI → 2001 → ANSI, same ports/types in order) over five corpus modules and 290 of 291 opentitan candidates (the one failure is kmac_reduced_tb.sv's pre-existing trailing-comma parse error). 0 of 854 corpus files differ from 0.45.0. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
d9ed2c447a
commit
aa479cf701
25 files changed
+3539
-58
No files matched your search
@@ -68,7 +68,7 @@ index scope when the defining module lives outside the default folder scope.
|
||||
|---|---|---|
|
||||
| Prepare rename | `textDocument/prepareRename` | Verifies the target and returns its editable range |
|
||||
| Rename | `textDocument/rename` | Renames local or workspace-resolved symbols |
|
||||
| Port actions | code actions / commands | Adds, removes, and propagates module ports; expands a `.*` wildcard into the named connections it stands for (a port with no same-named signal in scope becomes `.p()` and is named in a warning) — `lucisv.expandWildcard` |
|
||||
| Port actions | code actions / commands | Adds, removes, and propagates module ports; expands a `.*` wildcard into the named connections it stands for (a port with no same-named signal in scope becomes `.p()` and is named in a warning) — `lucisv.expandWildcard`; converts a Verilog-2001 header to ANSI, each body declaration merged into the port it described (IEEE 1800 §23.2.2.2) with its comments carried along — `lucisv.convertToAnsi` |
|
||||
| Instantiate module | inline completion / `lucisv.instantiate` | Builds an instance from an indexed module interface, including in clients without ghost text |
|
||||
| Apply workspace edit | `workspace/applyEdit` | Delivers multi-file refactor changes to the client |
|
||||
| Show definition | `window/showDocument` | Opens a generated or resolved target after an action |
|
||||
|
||||
Reference in new issue
Block a user