Goal
Add conditional field activation to ev's constraint model. Required for CVA6 XIF's CUS_NOP which has no rd, rs1, or rs2 operands — those fields are don't-care when opcode=NOP.
Background
CVA6 cvxif_custom_instr.sv uses set_rand_mode() to disable randomization of rd/rs1/rs2 for specific instructions. CUS_NOP (funct3=001, funct7=0) has has_rd=0, has_rs1=0, has_rs2=0, meaning all operand fields must be 0. ev's current model requires every field to have a value; there is no mechanism to express "when opcode=NOP, rs1/rs2/rd are inactive (forced to 0)."
Design considerations
A conditional field activation mechanism could work as a new constraint type:
- type: enable_mask
field: "opcode"
value: 0x7B # CUS_NOP encoding
disable: ["rs1", "rs2", "rd"]
Or as a field attribute:
fields:
rs1:
range: [0, 31]
enable_when:
field: "opcode"
ne: 0x7B # NOP opcode
Deliverables
- Design and implement field enable masks in
ConstraintSpec
- Add
enable_mask (or equivalent) constraint type
- Update domain expansion to conditionally deactivate fields
- Update C harness generation in spike.rs to emit
if (is_nop) { enc[IDX_rs1] = 0; } style code
- Create a CUS_NOP test case in an updated CVA6 fixture
References
cva6/verif/env/corev-dv/custom/cvxif_custom_instr.sv — set_rand_mode() for NOP
cva6_xif_ref.xif.yaml — current flat model
- CUS_NOP: funct3=001, funct7=0, rd=0, rs1=0, rs2=0
Parent Issue
#13 — Phase 2: Spike simulation backend and CVA6 XIF exhaustive verification
Goal
Add conditional field activation to ev's constraint model. Required for CVA6 XIF's CUS_NOP which has no rd, rs1, or rs2 operands — those fields are don't-care when opcode=NOP.
Background
CVA6
cvxif_custom_instr.svusesset_rand_mode()to disable randomization of rd/rs1/rs2 for specific instructions. CUS_NOP (funct3=001, funct7=0) hashas_rd=0, has_rs1=0, has_rs2=0, meaning all operand fields must be 0. ev's current model requires every field to have a value; there is no mechanism to express "when opcode=NOP, rs1/rs2/rd are inactive (forced to 0)."Design considerations
A conditional field activation mechanism could work as a new constraint type:
Or as a field attribute:
Deliverables
ConstraintSpecenable_mask(or equivalent) constraint typeif (is_nop) { enc[IDX_rs1] = 0; }style codeReferences
cva6/verif/env/corev-dv/custom/cvxif_custom_instr.sv—set_rand_mode()for NOPcva6_xif_ref.xif.yaml— current flat modelParent Issue
#13 — Phase 2: Spike simulation backend and CVA6 XIF exhaustive verification