Coverage gaps L3, L6, L10: six language shapes, randsequence as real nodes, an opt-in uvm_field_* indent

TODO §54 (docs/features/coverage-gaps-l); closes docs/coverage_gaps.md
L3, L6 and L10. The first dev stalled under machine load; a second
finished from the tree.

54.1 `->>` with optional delay or event control (`StmtKind::EventTrigger`),
stream `with [range]` (`ExprKind::StreamWith`), the LRM's other
`casting_type`s, drive strength on a net declaration (`DataDecl::strength`,
whose comment slots also fix a pre-existing refusal on an `assign` with
a comment before its strength), `let` at statement position
(`StmtKind::Let`), and `#(min:typ:max)` clocking skews — `ClockingSkew`
as the LRM's two alternatives, `edge [delay]` | `delay` (review rework of
QA's HIGH). Comment slots added to `let`, stream concatenations and the
clocking grammar; the RTL gap fuzzer at 505 gaps, zero failing.
54.2 `randsequence` (it was a parse error; the keyword is new):
`RandSequence` → `Production` → `Alternative` → `ProdItem` (ref, block,
if, repeat, case, rand join), code blocks by the statement grammar; one
production per line, alternatives aligned; the LRM's examples as cases.
54.3 `[format] uvm-utils-indent` / `lucisv.format.uvmUtilsIndent`, default
off, tracking nested `_begin`/`_end` pairs; 21 corpus files change with
it on, all idempotent. A short comment-free enum body already one-lines,
so no key was built — the behaviour is pinned. `[format]` table tests
added (review rework). `->>`'s event control is bound through the shared
`bind_timing` (review rework of QA's second HIGH).

0 of 820 corpus files differ from 0.48.x with the key off; the opentitan
sweep is identical; no corpus or opentitan file writes any of the new
shapes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5.1 committed 2026-09-07 01:12:49 -05:00
1 parent e1679bebc5
commit a69a1cb528
69 files changed
+3660 -127

No files matched your search

+51
View File
@@ -119,6 +119,18 @@ pub enum ExprKind {
/// The stream expressions, carrying their comments the way a
/// concatenation's elements do.
inner: Vec<ExprItem>,
/// The three gaps the two nested brace pairs open. Boxed to keep
/// `Expr` small, as for `TernaryComments`.
comments: Box<StreamComments>,
},
/// `expr with [ range ]` — a stream expression's array range
/// (IEEE 1800 §11.4.14): `{<< {a with [0:3]}}`, `{>> {a with [i+:4]}}`,
/// `{<< {a with [i]}}`. The only `with` whose argument is a bracket
/// rather than a `(` or a `{`, which is what tells it from an array
/// method's iterator argument and from a `randomize` constraint block.
StreamWith {
base: Box<Expr>,
range: Box<StreamRange>,
},
Paren {
inner: Box<Expr>,
@@ -451,6 +463,45 @@ pub struct WithComments {
pub after_kw: Vec<Comment>,
}
/// The gaps of a streaming concatenation's own brackets:
/// `{ /*a*/ << byte /*b*/ { x } /*c*/ }`. The elements inside carry their own
/// comments the way a concatenation's do; these three are what the nesting of
/// the two brace pairs leaves over.
#[derive(Debug, Clone, Default)]
pub struct StreamComments {
/// Between the outer `{` and the `<<` or `>>`.
pub after_open: Vec<Comment>,
/// Between the direction (or the slice size) and the inner `{`.
pub before_inner: Vec<Comment>,
/// Between the inner `}` and the outer `}`.
pub before_close: Vec<Comment>,
}
/// The `with [ … ]` bracket of a stream expression: one index (`[i]`) or a
/// range in any of the three spellings a part select takes (`[m:l]`,
/// `[i+:n]`, `[i-:n]`).
///
/// It is not an [`ExprKind::Range`] because that node wraps a *base* — here
/// the base stands on the `with`'s left, outside the bracket — but it keeps
/// exactly the same comment slots, so the printer lays both out through one
/// function.
#[derive(Debug, Clone)]
pub struct StreamRange {
/// Comments written on either side of the `with` keyword.
pub with_comments: WithComments,
/// The single index, or the range's first operand.
pub msb: Expr,
/// `:`, `+:` or `-:`; `None` for the single-index spelling.
pub op: Option<String>,
/// The range's second operand; `None` for the single-index spelling.
pub lsb: Option<Expr>,
/// `[ /*a*/ m /*b*/ : /*c*/ l /*d*/ ]` — the slots
/// [`SegmentComments`] names. `before_open` is always empty here: what
/// was written between the `with` and the `[` belongs to the keyword, so
/// it goes in `with_comments.after_kw`.
pub comments: SegmentComments,
}
impl TernaryComments {
/// True when nothing was written inside the `? :` — the common case, laid
/// out without any comment handling.