Ibex RV32IMCB Report
Exhaustive encoding verification with ExaVerif (ev)
ExaVerif performed exhaustive verification of the lowRISC Ibex core’s register-register (OPCODE_OP) and register-immediate (OPCODE_IMM) ALU encoding spaces, covering the full RV32IMCB instruction set including Zbt (R4-type ternary instructions). The standard pipeline evaluates 524,288 combinations in 291 milliseconds. The structural classifier evaluates the same space in 9.10 milliseconds, 32x faster, by generating only structurally valid combinations; this fixture’s constraints are structural, so it runs no runtime checks. Total valid encodings: 92,160 (R-type) plus 55,616 (I-type).
Verification Target
The Ibex core (lowRISC, OpenHW Group) implements the RISC-V RV32IMCB instruction set with an optional Bit-Manipulation extension. This verification covers the OPCODE_OP (0x33, register-register) and OPCODE_IMM (0x13, register-immediate) decode logic in ibex_decoder.sv under the RV32BFull configuration.
The mapping is a hand transcription from ibex_decoder.sv at commit f4540774. tests/ibex_source_pin.rs pins the decoder file and the fixture digests, so a decoder change or a fixture edit is visible. The pin does not derive the pairs; the tables in this report are the fixture’s claim.
R-type: funct7/funct3 decode (OPCODE_OP)
The decoder selects ALU operations through a 10-entry main case statement plus a Zbt ternary override for funct7 values with bit 1 set:
| funct7 | funct3 | Instruction class | Sub-extensions |
|---|---|---|---|
| 0 | all 8 | RV32I base | ADD, SLL, SLT, SLTU, XOR, SRL, OR, AND |
| 1 | all 8 | RV32M | MUL, MULH, MULHSU, MULHU, DIV, DIVU, REM, REMU |
| 4 | 1, 4, 5, 6, 7 | zbb + zbp + zbe | PACK, PACKH, SHFL, UNSHFL, BCOMPRESS |
| 5 | 1–7 | zbc + zbb | CLMUL, CLMULR, CLMULH, MIN, MINU, MAX, MAXU |
| 16 | 1, 2, 4, 5, 6 | zba + zbp | SH1ADD, SH2ADD, SH3ADD, SLO, SRO |
| 20 | 1, 2, 4, 5, 6 | zbs + zbp | BSET, XPERM_N, XPERM_B, GORC, XPERM_H |
| 32 | 0, 4, 5, 6, 7 | RV32I + zbb | SUB, SRA, XNOR, ORN, ANDN |
| 36 | 1, 4, 5, 6, 7 | zbs + zbb + zbe + zbf | BCLR, BEXT, PACKU, BDECOMPRESS, BFP |
| 48 | 1, 5 | zbb | ROL, ROR |
| 52 | 1, 5 | zbs + zbp | BINV, GREV |
Zbt ternary (R4-type override)
When funct7 bit 1 is set, the decoder selects R4-type ternary instructions (CMIX, CMOV, FSL, FSR) for funct3 values 1 and 5. This adds 64 funct7 values with 2 funct3 values each.
I-type: register-immediate (OPCODE_IMM)
The OPCODE_IMM decoder covers ADDI, SLTI, SLTIU, XORI, ORI, ANDI (any funct7) plus shift and bitmanip variants (SLLI, SRAI, RORI, BSETI, etc.) for funct3 values 1 and 5, including FSRI (funct7 bit 1 set with funct3=101).
Exhaustive Verification Results
Performance: Structural Enumeration vs Standard Pipeline
Scaling Analysis
Benchmark Results (release build, this machine)
How It Works
A YAML specification describes the encoding space. ev verify runs the structural classifier by default: the constraints are encoded into the enumeration, and only the valid points are evaluated. The full-expansion reference is selectable for comparison:
ev verify --target tests/fixtures/ibex/rv32imcb.xif.yaml
EV_CLASSIFIER=naive ev verify --target tests/fixtures/ibex/rv32imcb.xif.yamlThe standard pipeline in the table below is the evaluate_all reference, not a separate CLI mode. EV_CLASSIFIER=naive selects it and produces the same record shape with engine: ev/naive.
Structural vs Standard: the mechanism
| Aspect | Standard (evaluate) |
Structural classifier |
|---|---|---|
| Combinations generated | All 524,288 | Valid only 92,160 |
| Constraint evaluation | per-combination checks | none for this fixture; the cross is structural |
| Invalid detection | check.allows() → false |
Vacant slot in the structural iterator |
| Memory | O(N) combinations | O(V) verdicts plus O(sum domains) setup |
| Time | 291 ms | 9.10 ms |
Layering and provenance
The Ibex report is a sample, not a special mode. The fixture is an ev spec: five fields, a cross constraint between funct7 and funct3, and a sum projector. It declares no word layout, because the report classifies the decode relation rather than a packed instruction word. The RISC-V layout profiles are not involved; the riscv feature matters only for the Spike backend, which this report does not use.
The mapping is a hand transcription from ibex_decoder.sv at f4540774. tests/ibex_source_pin.rs pins the decoder file and the fixture digests, so a decoder change or a fixture edit is visible. The pin does not derive the pairs. The CVA6 fixtures are the set whose accepted set is re-derived by a gate; the Ibex fixtures claim a pinned source.
Compile-time configuration is not an encoding field. The fixture states RV32BFull and RV32MFast with LV_A == LV_B == 0, and a different configuration would be a different spec. Configuration spaces are out of ev’s scope (issue #36 decision).
Limitations
Scope and limitations
- Multi-cycle instruction modelling: rol/ror and zbe/bdecompress/ bcompress complete in 2 cycles. The encoding space is verified, but pipeline timing is not.
- RV32BBalanced vs RV32BFull: The fixture assumes RV32BFull. Balanced mode disables zbc, zbe, zbp, zbr. Compile-time configuration spaces are out of ev’s scope; a different configuration would be a different spec (issue #36 decision).
- RV32E register constraint: Ibex optionally supports RV32E (16 registers). The fixture assumes 32-register RV32I; an RV32E model would be a different spec.
- Pipeline hazards: Write-after-read hazards (rs1==rd) are not modelled at the encoding level.