Home

Awesome

RISC-V Formal Verification Framework

This is work in progress. The interfaces described here are likely to change as the project matures.

About

riscv-formal is a framework for formal verification of RISC-V processors.

It consists of the following components:

See cores/picorv32/ for example bindings for the PicoRV32 processor core.

A processor core usually will implement RVFI as an optional feature that is only enabled for verification. Sequential equivalence check can be used to prove equivalence of the processor versions with and without RVFI.

The current focus is on implementing formal models of all instructions from the RISC-V RV32I and RV64I ISAs, and formally verifying those models against the models used in the RISC-V "Spike" ISA simulator.

riscv-formal uses the FOSS SymbiYosys formal verification flow. All properties are expressed using immediate assertions/assumptions for maximal compatibility with other tools.

Table of contents

Configuring a new RISC-V processor

  1. Create a riscv-formal/cores/<core-name>/ directory
  2. Write a wrapper module that instantiates the core under test and abstracts models of necessary peripherals (usually just memory)
  3. Write a checks.cfg config file for the new core
  4. Generate checks with python3 ../../checks/genchecks.py from the <core-name> directory
    • Checks are generated in riscv-formal/cores/<core-name>/checks
  5. Run checks with make -C checks j$(nproc)

Notes