ibex/dv/formal/instrs.json
Louis-Emile c0636dcbde [dv,formal] Add flow for formal equivalence checking with Sail
Here's a high-level overview of what this commit does:
- Compiles Sail into SystemVerilog including patchin compiler bugs
- Create a TCL file that tells JasperGold what to prove and assume
- Check memory operations modelling the LSU
  Most of these properties now prove without time-bound on the response
  from memory due to alternative LSUs
- Check memory even with Smepmp errors:
  Continues on top of https://github.com/riscv/sail-riscv/pull/196
- CSR verification
- Checks for instruction types such as B-Type, I-Type, R-Type
- Check illegal instructions and WFI instructions
- Using psgen language for proof generation
- Documentation on how to use the setup
- Wrap around proof that proves instructions executed in a row still
  match the specification.
- Liveness proof to guarantee instructions will retire within a upper
  bound of cycles.

All of these proofs make heavy use of the concept of k-induction. All
the different properties and steps are necessary to help the tool get
the useful properties it needs to prove the next step. The instruction
correctness, wrap-around and liveness all give us increased confidence
that Ibex is trace-equivalent to Sail.

Throughout this process an issue was found in Ibex where the pipeline
was not flushing properly on changing PMP registers using clear: #2193

Alternative LSUs:
This makes all top level memory properties prove quickly and at a low
proof effort (1 or 2-induction). Three 'alternative LSUs' representing
three stages of memory instructions:
1. Before the first response is received, in the EX stage
2. After the first response is received, but not the second grant,
also in the EX stage
3. Before the last response is received in the WB stage.
In each case we ask 'if the response came now, would the result
be correct?'. Similar is applied for CSRs/PC though less directly.
This is particularly interesting (read: ugly) in the case of a PMP error

wbexc_exists makes Wrap properties fast to prove. The bottleneck becomes
SpecPastNoWbexcPC, which fails only due to a bug. See the comment
in riscv.proof.

Co-authored-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
Signed-off-by: Louis-Emile Ploix <louis-emile.ploix@lowrisc.org>
2025-04-30 13:30:45 +00:00

58 lines
746 B
JSON

[
"UTYPE",
"ITYPE",
"RTYPE",
"FENCE",
"FENCEI",
"LOAD",
"STORE",
"SHIFTIOP",
"ILLEGAL",
"BTYPE",
"CSR",
"DIV",
"EBREAK",
"ECALL",
"MRET",
"MUL",
"REM",
"RISCV_JAL",
"RISCV_JALR",
"WFI",
"C_ADD",
"C_ADDI",
"C_ADDI16SP",
"C_ADDI4SPN",
"C_ADDIW",
"C_ADDW",
"C_AND",
"C_ANDI",
"C_BEQZ",
"C_BNEZ",
"C_EBREAK",
"C_ILLEGAL",
"C_J",
"C_JAL",
"C_JALR",
"C_JR",
"C_LD",
"C_LDSP",
"C_LI",
"C_LUI",
"C_LW",
"C_LWSP",
"C_MV",
"C_NOP",
"C_OR",
"C_SD",
"C_SDSP",
"C_SLLI",
"C_SRAI",
"C_SRLI",
"C_SUB",
"C_SUBW",
"C_SW",
"C_SWSP",
"C_XOR"
]