Rename the tool to lucisv (Language Utility for Coding In SystemVerilog)
This commit is contained in:
1 parent
a284e33110
commit
eeaffafd56
188 files changed
+2825
-2802
No files matched your search
@@ -55,7 +55,7 @@ class without a line of per-site code.
|
||||
|
||||
| construct | why | corpus evidence |
|
||||
|---|---|---|
|
||||
| `constraint c { ... }` | the constraint language is its own grammar — `dist { 0 :/ 5, [1:20] :/ 20 }`, `->` implication, `solve x before y`, `inside`, `foreach`, `if`/`else`. None of it appears anywhere else in vfmt, and there is no layout convention worth inventing for it. | `ibex_icache_core_req_item.sv:28-62` (five blocks, all four of those forms) |
|
||||
| `constraint c { ... }` | the constraint language is its own grammar — `dist { 0 :/ 5, [1:20] :/ 20 }`, `->` implication, `solve x before y`, `inside`, `foreach`, `if`/`else`. None of it appears anywhere else in lucisv, and there is no layout convention worth inventing for it. | `ibex_icache_core_req_item.sv:28-62` (five blocks, all four of those forms) |
|
||||
| `covergroup ... endgroup[: label]` | same argument: `coverpoint`, `cross`, `bins`/`ignore_bins`/`illegal_bins`, `binsof ... intersect`, `with function sample`. | `ibex_icache_core_agent_cov.sv:17-46`, `uart_env_cov.sv:8-55` |
|
||||
| the `#( ... )` of a parameterized **type** reference | its arguments are types as often as expressions (`#(virtual ibex_icache_core_if)`, `#(push_pull_item #(A, B))`), so `parse_expr` cannot represent them. | `push_pull_driver_lib.sv:20-24`, `ibex_icache_core_driver.sv:15` |
|
||||
|
||||
@@ -71,11 +71,11 @@ slice `source[span]`, drop the trivia copies the skip made. This is why
|
||||
## Assumptions
|
||||
|
||||
- **The class body is an item list, not a member list.** SystemVerilog's
|
||||
`class_item` production overlaps almost exactly with what vfmt already
|
||||
`class_item` production overlaps almost exactly with what lucisv already
|
||||
accepts at module scope, so the alternative — a separate `ClassItem` enum —
|
||||
would have duplicated a dozen variants to gain nothing. The cost is that a
|
||||
construct only legal at module scope (`always_ff`, an instantiation) parses
|
||||
inside a class instead of being rejected. vfmt is a formatter, not a
|
||||
inside a class instead of being rejected. lucisv is a formatter, not a
|
||||
compiler; it does not check legality anywhere else either.
|
||||
- **A verbatim block's *relative* layout is what survives, not its absolute
|
||||
layout.** `raw_lines` dedents continuation lines by `col - 1` and the
|
||||
@@ -204,7 +204,7 @@ verbatim. The fix is one arm —
|
||||
rather than done. Nothing is corrupted by the gap; the fence is simply
|
||||
inactive. *(Lead note, per lint-rules-2 QA: inactive for the FORMATTER
|
||||
only. `fence::protected_regions`' line-based scan backstop still sees the
|
||||
fence, so `vfmt check --fix` and the server's quick fixes DO decline to
|
||||
fence, so `lucisv check --fix` and the server's quick fixes DO decline to
|
||||
edit inside it — the asymmetry errs toward hands-off, which is the
|
||||
harmless direction, but readers should not conclude the fence does
|
||||
nothing in a class body.)*
|
||||
@@ -345,7 +345,7 @@ non-zero verification-error count.
|
||||
|
||||
`./tools/corpus_check.sh corpus` over the same pinned 820-file corpus. All four
|
||||
repos verified unmodified afterwards (`git status --porcelain` clean apart from
|
||||
the pre-existing untracked `.vfmt-corpus-rev` stamps).
|
||||
the pre-existing untracked `.lucisv-corpus-rev` stamps).
|
||||
|
||||
| metric | before | after |
|
||||
|---|---|---|
|
||||
@@ -435,7 +435,7 @@ direction. Gained files by tree: `ibex/dv` 55, `ibex/vendor` 34,
|
||||
corpus leans on parameterized *type references* (`uvm_analysis_port #(...)`)
|
||||
as heavily as on `extends`, which is why the `#` blocker at 40 files was
|
||||
really part of this feature; (c) constraints and covergroups are big, common,
|
||||
and completely disjoint from every grammar vfmt already has.
|
||||
and completely disjoint from every grammar lucisv already has.
|
||||
- **Chose verbatim for constraints and covergroups before writing a line of
|
||||
parser.** The deciding argument is not effort but risk symmetry: a verbatim
|
||||
block is re-lexed as ordinary tokens by the safety net, so a wrong byte is
|
||||
@@ -554,10 +554,10 @@ Python (not just by count).
|
||||
7, others 8 (one each) — exact match, including the "34 of 70 are
|
||||
queues/dynamic arrays" arithmetic (25+9).
|
||||
- Round-tripped **all 578** formattable files (not sampled): copied each to a
|
||||
scratch dir, `vfmt <file>` then `vfmt --check <file>`. **0 failures, 0
|
||||
scratch dir, `lucisv <file>` then `lucisv --check <file>`. **0 failures, 0
|
||||
non-fixed-points.**
|
||||
- Corpus repos confirmed unmodified: `git -C <repo> status --porcelain` clean
|
||||
in all four (only the pre-existing untracked `.vfmt-corpus-rev` stamps),
|
||||
in all four (only the pre-existing untracked `.lucisv-corpus-rev` stamps),
|
||||
before and after the round-trip.
|
||||
- **Claim 1: PASS**, every number independently reproduced, not just
|
||||
eyeballed against the README.
|
||||
@@ -610,7 +610,7 @@ reverted:
|
||||
real binary on all 3 passes. **PASS.**
|
||||
|
||||
**Handshakes (claim 6).**
|
||||
- Fence inactive inside a class body: `// vfmt: off` around a member inside
|
||||
- Fence inactive inside a class body: `// lucisv: off` around a member inside
|
||||
`class c; ... endclass` is ignored (`int a = 1;` gets reformatted to
|
||||
`int a = 1;`); the identical shape inside `module m; ... endmodule` is left
|
||||
byte-for-byte alone. Also checked the *complementary* case not mentioned in
|
||||
@@ -656,7 +656,7 @@ class c;
|
||||
endclass
|
||||
```
|
||||
|
||||
`vfmt check` on this file reports `no-tabs` (line 2) but **not**
|
||||
`lucisv check` on this file reports `no-tabs` (line 2) but **not**
|
||||
`case-missing-default` for the `case` inside the method — exactly the
|
||||
asymmetry the broad wording obscures. Suggest tightening the sentence to name
|
||||
which rules are affected (the 4 AST-walk ones), so a reader doesn't conclude
|
||||
@@ -682,7 +682,7 @@ with `` `uvm_field_* `` macro items between them as class items; `` `ifdef``/
|
||||
`` `else``/`` `endif`` directives between ordinary class members; `endclass :
|
||||
d` where the label doesn't match the class name `c` — **parses and is
|
||||
preserved verbatim, not rejected and not "corrected"** (consistent with the
|
||||
Assumptions section: vfmt does not check semantic legality); an empty class;
|
||||
Assumptions section: lucisv does not check semantic legality); an empty class;
|
||||
a 5-deep `extends` chain (`c5 extends c4 extends c3 extends c2 extends c1`);
|
||||
and a combined case exercising `typedef class` forward declaration, class
|
||||
parameters referenced in an `extends #(.W(W))` override, multiple
|
||||
@@ -753,7 +753,7 @@ Points reviewed and accepted:
|
||||
signature change made mandatory-not-optional for exactly the right
|
||||
reason: an empty verbatim slice would be a corruption bug.
|
||||
|
||||
With this, vfmt formats the majority of real-world DV code as well as
|
||||
With this, lucisv formats the majority of real-world DV code as well as
|
||||
RTL. Next per the owner's directive: alignment inference, content-hash
|
||||
cache, range formatting, remaining lint rules — and the corpus says
|
||||
queues/dynamic arrays after that.
|
||||
Reference in new issue
Block a user