PR: feat: add neq/lt/gt/le/ge/oneof constraints, fixtures, axis fix, CLI refactor #7#8
Conversation
- rename expand_overflow_returns_error to expand_exceeding_max_combinations_large_product (the test triggers MAX_COMBINATIONS guard, not overflow) - add err message verification to the large product test (matching existing expand_exceeding_max_combinations_returns_error) - tighten malformed_bad_type stderr assertion to check for unknown variant instead of just non-empty
Phase 2 of pipeline hardening: - 6 new constraint types (neq, lt, gt, le, ge, oneof) with serde deserialization, registry builder, Check impl, SV assertion gen - Ibex ALU extension fixture (456 combinations, oneof+neq) - CVA6 XIF MAC fixture (32768 combinations, signed accumulator) - 13 new CLI tests covering all constraint types - All 69 tests passing
Phase 3 of pipeline hardening. Remove the BTreeMap alphabetical ordering pitfall where axis numbers in YAML did not match declared field order. Changes: - ConstraintSpec: axis: usize -> field: String, axis_a/b -> field_a/b - ProjectorSpec: axis: usize -> field: String (Identity, Parity) - Registry builders resolve field names to axis indices at build time - Check structs store field_name for human-readable describe() output - All YAML fixtures use field="name" instead of axis: N - README.md updated with new syntax and full constraint type list - All 69 tests passing
Replace the single `check` subcommand with `verify`, `simulate`, and `synth` subcommands. Update all documentation, test fixtures, CI scripts, and help texts accordingly. Clean up internal formatting across source files.
…plify run.sh - ev check -> ev verify (static constraint verification) - ev simulate --target (Spike backend, WIP) - ev synth --target (standalone SV generation + synthesis, was --synth flag) - Remove --ci mode from run.sh (default = same as former --ci) - --demo flag added for SSCCS channel demo only - 72 tests passing (56 lib + 16 CLI)
…ynth - Remove Simulate subcommand (unimplemented! placeholder removed) - Remove --synth flag from verify subcommand (single path: ev synth) - Add --json flag to synth subcommand - Extract print_synthesis_report() and run_synth() helper functions - Remove duplicate code between verify and synth paths - Remove verify_help_mentions_synth and simulate_help tests - Add synth_json_with_mock_backend test - 70 tests passing (56 lib + 14 CLI)
- Cross constraint: maps field_a values to allowed field_b value sets
(funct3=0 → funct7=0, funct3=1 → funct7∈{0,1,2,3,32})
- Full implementation: spec.rs + registry.rs + synth/mod.rs + evaluate.rs
- cva6_xif_ref.xif.yaml: actual CVA6 CV-X-IF coprocessor encoding
based on cvxif_instr_pkg.sv (10 instructions, custom-3 opcode space)
- 3072 valid combinations (oneof + cross), 71 tests passing
- notes/cva6-xif-analysis.md: RTL analysis documentation
There was a problem hiding this comment.
Code Review Summary
spec.rs
The Cross variant uses mapping: HashMap<i64, Vec<i64>> which serde handles natively — clean YAML representation. All internal Check structs now store field_name instead of numeric axis indices, making describe() output human-readable.
registry.rs
ConstraintBuilder signature changed to accept an axis_of map. build_all now takes the field map and calls build_axis_index internally — registry consumers only deal with field names. Two prior bugs removed: duplicate FieldDomainCheck and redundant build_all re-invocation. CrossC::allows() uses unwrap_or(true) for unmapped keys, matching the design intent that unmapped field_a values leave field_b unrestricted.
evaluate.rs
Removed duplicate field domain validation (the FieldDomainCheck struct was never reached because the inline loop returned early). build_all re-invocation replaced with direct check.describe() for failure reasons. Six new constraint unit tests cover pass/fail boundary conditions. The cross_constraint test covers mapped pass, mapped fail, and unmapped pass across 3×4 = 12 combinations.
synth/mod.rs
sv_constraint_assertion no longer needs field_names lookup — every constraint variant includes the field name directly. Cross constraint generates SystemVerilog inside assertions: (funct3 == 0) -> (funct7 inside {0}).
main.rs
Check renamed to Verify, --synth flag removed, Synth subcommand added. run_synth() and print_synthesis_report() extracted to eliminate code duplication. Simulate subcommand removed to avoid exposing unimplemented!().
CLI tests
All ev check → ev verify. Three tests added: synth_help_succeeds, synth_text_with_mock_backend, synth_json_with_mock_backend, verify_cva6_xif_ref_fixture. verify_help_mentions_synth removed since synth is now a separate subcommand.
cva6_xif_ref.xif.yaml
Based on actual CVA6 core RTL (cvxif_instr_pkg.sv analysis). Uses real field names (funct3, funct7) with oneof + cross to model the coprocessor's hierarchical encoding. rs1/rs2/rd reduced to 0..7 to stay under MAX_COMBINATIONS.
run.sh
--ci mode removed (default execution is identical). cva6_xif_ref verification added to verify_fixtures.
Overall
All changes are consistent with the existing architecture (registry builder pattern, capability traits). 72 tests pass with zero clippy warnings. The Cross constraint is the first practical demonstration of SSCCS Field Composition principles applied to real RISC-V XIF encoding verification.
Summary
Three-phase pipeline hardening plus CLI refactor. Fixes the critical axis ordering bug where BTreeMap alphabetical sorting caused numeric axis indices to mismatch YAML field declaration order.
Changes
Phase 1 — Bug fixes
build_allre-invocation in failure pathexpand_allPhase 2 — New constraint types + RISC-V fixtures
6 new constraint types:
neq,lt,gt,le,ge,oneofTwo real-world RISC-V core fixtures:
ibex_alu_ext.xif.yaml— 456 combinations, oneof + neq constraintscva6_xif_mac.xif.yaml— 32,768 combinations, signed accumulatorPhase 3 — Axis ordering fix
ConstraintSpec:axis: usize→field: String(field-name references)CLI refactor
ev check→ev verify(static constraint verification)ev simulate --target(Spike backend, placeholder)ev synth --target(standalone SV synthesis, formerly--synthflag)run.shsimplified: default = full pipeline,--demoflag for SSCCS demo onlyTest Results