PR: fix: structural enumeration correctness and RTL-derived CVA6 verification #43 - #45
Merged
Conversation
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
Fixes structural enumeration correctness and re-derives the CVA6 fixtures from the actual hardware decoder, making the reported numbers reproducible and honest.
Changes (9 commits)
StructuralEnumhad a cross-constraint wrap bug (emitted stale child values after a parent advance; funct3=2 was emitted with funct7=0 instead of 96). Rewritten as a topologically ordered odometer with O(1)fix_suffixvia precomputed first-valid indices. Now emits exactly the valid set (regression-tested).cvxif_instr_pkg.sv/instr_decoder.svat CVA6 commit6544a714c. Accepted custom-3 space: funct3=000/funct7=0 (NOP), funct3=001/funct7 in {0..4} (ADD family). Full: 196,608 valid (0.6% density); R4: 2,560./tests.cargo bench -- cva6_full;struct_enum_validityguard; the suite is now the performance reference (fixture table, methodology, O(N) vs O(V)).Measured results (release build, this machine)
Same-language (Rust release, criterion) baseline: the ratio is the O(N) vs O(V) enumeration-strategy gain, not a language effect.
Finding for the CVA6 team
The DV class (
cvxif_custom_instr.sv) generates encodings the reference coprocessor decoder rejects: CUS_U_ADD (funct3=000/funct7=2), CUS_S_ADD (funct7=6), CUS_ADD_MULTI (funct7=8), CUS_EXC (funct3=010). Documented in the report.Quality
cargo bench -- cva6_fullon the committed fixtures.assemble_instrtwice when a layout exists; cyclic cross constraints fall back silently).Related
veri-testharness,spiketandem flow)