Conversation
The BSV parser rejected a real literal in a pattern (EUnsupportedNumReal), while the Classic parser accepted one; the elaboration path they share already implements literal patterns as equality filters, and the closed Prelude instance defines Real equality exactly. Accept the literal and let the usual desugaring apply. As everywhere else in the language, matching a Real compares by numeric equality, so 0.0 matches -0.0 (and a negated real literal pattern matches the negated value); a design that wants approximate comparison still writes a guard. The pattern checker already treats Real as an unbounded literal domain, so Real matches participate in exhaustiveness and redundancy checking; a custom RealLiteral target remains locally opaque. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rtt7rnnXC8DShYHhMXmpCG
This was referenced Aug 16, 2026
nanavati
pushed a commit
that referenced
this pull request
Aug 22, 2026
…y flip) The v1 delay refusal becomes a build-mode selection: a model whose --timing inspection dump shows delay constructs verilates with --timing (verilated_timing.o joins the model objects; the shim compiles with the same coroutine flag Verilator's own objects use), everything else stays --no-timing. SHIMGEN_REV 3 -> 4 with one new ABI entry, vlt_advance: for timing models it drains internal delayed events strictly before the target instant -- one eval at each drained slot's own time -- and reports the drained count; for delay-free models it is a plain time set. BviPrim advances time through it at every observation frontier and commit point (including slices that stage nothing for the instance), so delayed NBAs land between the kernel's timeslices exactly where the reference simulators put them. A drain legitimately changes outputs with no input change, so it resets the observe-mode snapshots; TRS_BVI_CHECK=observe stays sound and quiet on timing models. New differential PosDelay (DelayIP.v: #3/#12/#13 NBAs straddling the clock period) is byte-exact against the iverilog oracle interpreted, as a compiled artifact, and under observe mode. The r3 delay-refusal check flips to a timing-build positive on both metadata adapters. Gates: bvi r2 15/15, r3 13/13 (incl. JSON leg on 5.050), r4 4/4, r5 16/16, regress 22/22, cargo tests clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 3 of 3, stacked on #15 (negative literals), which stacks on #14
(core pattern-match checking). One commit; the diff shown is exactly
the Real-literal change. (This PR originally carried the whole series;
it was re-based as the top of the stack when the series split into
three PRs.)
The BSV parser rejected a real literal in a pattern
(
EUnsupportedNumReal), while the Classic parser accepted one; theelaboration path they share already implements literal patterns as
equality filters, and the closed Prelude instance defines Real equality
exactly. Accept the literal and let the usual desugaring apply. As
everywhere else in the language, matching a Real compares by numeric
equality, so
0.0matches-0.0(and a negated real literal patternmatches the negated value); a design that wants approximate comparison
still writes a guard.
The pattern checker already treats Real as an unbounded literal domain,
so Real matches participate in exhaustiveness and redundancy checking;
a custom RealLiteral target remains locally opaque.
Testing
bsc.real/evaluatorpasses (PatternRealelaboration test including
-1.5and signed-zero cases) and thepatterncheck suite passes all 92 checks at this tip, including
RealPatterns (numeric equality, signed zero, closed Integer-to-Real
conversion, opaque custom RealLiteral targets).
byte-identical to the state that passed the full testsuite
(20,338 PASS / 134 XFAIL, zero regressions).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Rtt7rnnXC8DShYHhMXmpCG