• v0.27.0
    release / build-and-publish (push) Successful in 5m49s
    Stable

    lucio released this 2026-09-02 04:19:08 -07:00 | 230 commits to master since this release

    Constraint bodies — round 1 of coverage_gaps C1, the DV correctness
    item.

    constraint c { … }, constraint C::c { … } and randomize() with { … } were opaque verbatim text: no name span, nothing inside bound,
    so renaming a rand field left constraint 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, `ifdef arms — 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/before are matched by text — so logic before;
    keeps working and the editor grammar is untouched.

    Layout is canonical: one constraint item per line, } at the header's
    column, dist weights broken like a braced list; a with block keeps
    its one-line-or-not shape. verify.rs untouched; the constraint attack
    pairs re-derived and extended (a dropped soft, := for :/,
    swapped solve/before, a dropped else set, a flattened
    implication, a comment moved across }). Every operand binds to the
    class's properties (this. implicit; foreach variables nest; a
    with block resolves against the randomized object's class first), so
    hover, definition, references and rename reach inside; renaming a
    rand field from its declaration rewrites its constraint uses in-file
    and cross-file. FACTS_FORMAT 10 → 11. Lint rules read constraint
    operands instead of treating the body as opaque.

    QA's finding — a comment right after soft, dist, solve,
    before or 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