ExaVerif

Exhaustive Verification for Declared Design Spaces

Author
Affiliation

SSCCS Initiative

Code
References
Other Formats

The Project

ExaVerif is an open-core (Apache 2.0) CLI engine for exhaustive verification of a declared discrete space. A single command consumes a YAML specification that names fields, their domains, the constraints between them, and an optional projector. The engine enumerates every point the constraints admit, classifies it, and reports the result deterministically. The CLI provides verify for classification, simulate for a backend recheck, synth for RTL generation and synthesis, and capabilities for the layer stack, plus a fact decode utility.

The engine’s only knowledge of a target is the spec. A target family enters through a layout profile, which supplies bit positions when the target packs its fields into a word, and a backend, which supplies a channel such as simulation or synthesis. The parser and the classifier are seams as well: a caller can supply a format or an engine.

RISC-V is one category in that structure: riscv-r and riscv-r4 are registry entries, and the Spike backend is a simulation backend, both compiled under the riscv feature. The default build includes the target modules that exist, and targets is the aggregate that selects them; RISC-V is its only member today. The pure generic core is --no-default-features, and ev capabilities reports the modules and layers the binary at hand carries. A spec that names riscv-r in the generic core fails with the rebuild named rather than falling back.

The cores and designs named in this documentation, CVA6 (OpenHW Group), Ibex (lowRISC), and the Tagma decoder (syntagma), are samples that exercise the engine. Each is described from that project’s own source. The CVA6 encoding space is re-derived from the hardware decoder mask table at a pinned revision on every test run. The Ibex mapping is a hand transcription with a pinned source, and the pin checks the decoder file and the fixture digests, not the mapping. The Tagma decoder is the sample for the decompose projector.

ev emits a structured Fact. Accumulation, supersession, cross-run corpora, cross-engine comparison, and the design-oracle product belong to the consumer, ExaSpec. ev’s responsibility is the classification itself: complete over the declared space, reproducible, and correctly addressed.

The Layer Stack

The engine is organized as layers, each with one responsibility and a capability seam at its boundary:

Layer What it owns Seam
Spec space fields, domains, constraints, projector, optional word layout FormatCapable
Layout profile named bit layouts; riscv-r, riscv-r4, or a caller’s profile LayoutRegistry
Classification the engine that decides each point; structural is the default, naive is the reference Classify
Record spec_hash, point_id, id, engine, claim, and the verdicts Classification and the Fact envelope
Channels text, JSON, CSV, trace, RTL generation, synthesis, simulation ReporterCapable, GenerateRtl, RunSynthesis, RunSimulation
Consumers accumulation, comparison, supersession, the design oracle outside ev

The default build includes the target modules that exist. A target module adds its layout profile and simulation backend; the generic core (--no-default-features) carries neither, and ev capabilities prints the layer stack for the binary at hand.

A layer can be replaced without changing the ones above or below it. The classification layer is the most recent seam: EV_CLASSIFIER=structural is the default, EV_CLASSIFIER=naive selects the full-expansion reference, and an imported engine implements the same trait.

The Spec Space

The unit of verification is the Spec Space, a tripartite model:

  • Axes: field domains, each a field with its admissible values.
  • Constraints: admissible subspaces over the axes, including oneof, range, bitmask, cross, eq, and neq.
  • Projector: a mapping from each point of the space to a result value.

The model is itself a complete target specification: axes define the inputs, constraints define the legal points, and the projector defines the result mapping. The same YAML compiles to synthesizable SystemVerilog through synth, so exhaustive verification doubles as design generation.

A fourth layer is optional. A word layout maps fields to bit positions when the target packs them into an instruction, a frame, or a record prefix. The layout is data: a spec selects a named profile or declares it inline, and a spec without one has no word. The layout is part of the content address, so the same fields mapped to different bits are different spaces.

The engine compiles constraints into the enumeration itself. The iterator visits the valid space directly instead of the full cross product, so a single spec space verifies in milliseconds, hundreds of times faster than the standard pipeline. A consumer can run many specs, each an observation perspective with its own constraint set and projection target; accumulation and cross-insight belong to that consumer, not to ev.

Identical runs produce identical records, so the classification is comparable across runs. ev emits the record; a consumer decides how to accumulate or query it. The structural enumeration is the source of the speedups measured below, and it is independent of the target: any deterministic system that maps onto axes, constraints, and a projector benefits from the same pipeline.

Why the Gain Is Algorithmic

The speedup is a structural property of the enumeration, not a language effect. Four points state it, and each has a measurement:

  1. Standard evaluate_all checks every combination of the full space N. The structural classifier visits only the valid space V, with the constraints encoded into the iterator.
  2. The iterator is index-free. At fixed V, a 100x increase in the raw product moves the iterator from 1.64 to 1.93 µs; the cost follows V and the field count, not N.
  3. raw_total_combinations is O(k) and flat in N, because FieldSpec::len computes a domain’s cardinality without materializing it. The measured cost is 37 ns across the same 100x range.
  4. The structural filter setup is O(sum of domain sizes). It dominates the end-to-end time when one field carries a large domain: 3.7 µs to 272 µs as that domain grows 100x. The end-to-end pipeline is therefore O(sum domains + V*k), not O(V) alone.

Both pipelines are Rust in the same release build, measured by the same harness, so the ratio is the enumeration strategy alone. riscv-dv (UVM and simulator) and formal tools (SAT and BMC) do not enumerate at all; comparing against them is comparing different objects. The baseline here is a release build Rust standard implementation, and the structural gain stands against that baseline.

Memory is O(V): evaluate_structural collects the valid combinations and the verdicts. The largest committed valid set is 196,608 points. A streaming path would need a sink-based record API and is deferred until a consumer needs a valid set that does not fit memory. There is no probabilistic claim: a run classifies every point of the declared space and nothing else.

Benchmarks

Figure 1: Verification time: standard evaluate vs structural pipeline. With the structural pipeline integrated into the CLI (issue #42), the CVA6 33M space verifies end-to-end in about 0.2 s; the core pipeline (evaluate_structural) is 36.3 ms, ~360x faster than the naive 13.1 s.

Scaling: O(N) vs O(V)

Figure 2: Scaling across fixtures: evaluate runs in O(N), the structural iterator visits O(V). The gap widens as valid density drops; CVA6 full (0.6% density) shows ~700x.

Speedup follows approximately k / D (D = valid density): sparse spaces gain the most (CVA6 full 0.6% density, ~700x; Ibex 17.6%, 32x; dense spaces 1-2x).

Fixture Speedups

Fixture Raw Valid evaluate structural Speedup
Small 27 27 4.87 µs 2.86 µs 1.7x
Medium 32,768 20,480 5.99 ms 3.02 ms 2.0x
Tagma 65,536 11,172 9.74 ms 5.94 ms N/A (reference)
Ibex R-type 524,288 92,160 291 ms 9.10 ms 32x
CVA6 R4 16,384 2,560 3.14 ms 250 µs 13x
CVA6 full 33,554,432 196,608 13.1 s 18.8 ms ~700x
CVA6 full (evaluate_structural) 33,554,432 196,608 13.1 s 36.3 ms 361x

The two synthetic scaling axes in benches/bench.rs isolate the property. At fixed V, the iterator stays flat as the raw space grows; the filter setup grows with the domain size. At fixed V with a growing field count k, the end-to-end cost is linear in k: 0.97, 1.91, 3.69, and 8.15 µs for 4, 8, 16, and 32 fields. cargo bench -- scaling reproduces both.

Status

The engine is the default path. ev verify runs the structural classifier; the naive pipeline is selectable with EV_CLASSIFIER=naive and is the reference the tests compare against. Every record names its engine and claim class, and every point carries a coordinate identity that excludes the verdict.

The RISC-V samples are two reports:

  • CVA6 CV-X-IF (OpenHW): the 33.5M space derives from the hardware decoder mask table at a pinned revision and is re-derived by a gate. Report: CVA6 CV-X-IF Report (Standard Reference).
  • Ibex RV32IMCB (lowRISC): the 524,288-point space is a hand transcription from ibex_decoder.sv at a pinned revision; the pin checks the decoder and the fixture digests, not the mapping. Report: Ibex RV32IMCB Report.

Limits

  • Exhaustive coverage grows exponentially with the number of fields and their domains. The speedup depends on valid-space density, not raw size.
  • The structural filter setup is O(sum of domain sizes). A single very large domain costs its size even though the valid set is small.
  • Memory is O(V). A valid set that does not fit memory needs a streaming path, which is not implemented.
  • Compile-time configuration spaces are out of scope. A configuration selects which instructions exist; a spec models one configuration and states the parameter binding it assumes.
  • The Ibex mapping is a transcription, not a derived artifact. A consumer that needs a mechanically derived Ibex mapping must derive it outside ev.
  • Counts are field-value combinations and equal distinct instruction words where no enable_mask collapses them.

Ev is a project of the SSCCS Initiative. Inquiries: ev@ssccs.org.