-
released this
2026-09-02 04:19:08 -07:00 | 230 commits to master since this releaseConstraint bodies — round 1 of coverage_gaps C1, the DV correctness
item.constraint c { … },constraint C::c { … }andrandomize() with { … }were opaque verbatim text: no name span, nothing inside bound,
so renaming arandfield leftconstraint c { user_id < 5; }as
non-compiling code with, at best, a generic warning. Now a constraint
declaration is a real node —soft,dist(:=/:/),->
implication,if/else,foreach,solve … before,unique,
disable soft,`ifdefarms — and the parser attempts the
structured body behind a rewind snapshot: any shape it does not know
restores the cursor and both pending-comment buckets and re-runs the
verbatim capture character for character, so an unknown body is the
old behavior, not an approximation. No keywords were reserved —
soft/dist/solve/beforeare matched by text — sologic before;
keeps working and the editor grammar is untouched.Layout is canonical: one constraint item per line,
}at the header's
column,distweights broken like a braced list; awithblock keeps
its one-line-or-not shape.verify.rsuntouched; the constraint attack
pairs re-derived and extended (a droppedsoft,:=for:/,
swappedsolve/before, a droppedelseset, a flattened
implication, a comment moved across}). Every operand binds to the
class's properties (this.implicit;foreachvariables nest; a
withblock resolves against the randomized object's class first), so
hover, definition, references and rename reach inside; renaming a
randfield from its declaration rewrites its constraint uses in-file
and cross-file.FACTS_FORMAT10 → 11. Lint rules read constraint
operands instead of treating the body as opaque.QA's finding — a comment right after
soft,dist,solve,
beforeor the constraint name was dropped, so the safety net refused
the file — was answered with an exhaustive gap fuzzer (a block comment
in every inter-token gap of fifteen fixtures, 358 gaps, format and
idempotency both demanded) and fourteen named comment fields; the
forty gaps that remain are shared expression machinery that behaves
identically outside a constraint (q[/*c*/ i],inside {[/*c*/ 0:3]},
scoped-name chains) and are filed as a parser-wide round. No opentitan
file hits one.Opentitan: 1 993 of 2 009 constraint bodies parse structured (the 16
fallbacks are macro-item bodies and non-LRM shapes), all laid out,
token-equivalent and idempotent; 48 DV files across 16 IPs re-format
idempotently with their comment streams byte-identical; the sweep's
failure set unchanged and the tolerant-diagnostic count per file
identical. Corpus: 37 files change layout, all verified; +1 646
references, 84 % answered. Covergroups are round 2.Downloads