Skip to main content

rvsched

Before you run formal verification on an RTL module, ask two questions:

  1. Has this exact structure already been proved? If so, skip it.
  2. If not, will formal finish, or should this go to simulation?

rvsched answers both in about a second, without running any solver and without an AI model.

pip install rvsched
rvsched route rtl/*.v
rvsched -h                  # every command has -h with examples

Docs: Usage · Architecture

{ "module": "riscv_alu_multiplier",
  "decision": { "action": "RUN", "engine": "SIMULATION",
    "reason": "2 nonlinear op(s) with operands up to 32 bits. Unbounded formal will not converge." } }

How it works

  • Recognize. It reads the source and looks for what makes formal proofs blow up: variable × variable multiply, divide or modulo on wide operands, and large flip-flop state. It doesn't solve anything.
  • Fingerprint. It hashes each module's structure. Renaming signals or modules, comments and whitespace don't change the hash; changing logic does. A parent's hash includes its children's hashes.
  • Remember. After your tool runs, you record what happened. Next time the same structure appears, in this repo or a renamed copy anywhere else, the recorded result is used directly.
rvsched record rtl/*.v --module fifo --engine FORMAL --status proved --evidence https://ci/run/42
rvsched route rtl/*.v          # fifo -> SKIP, already proved
rvsched calibrate              # how often the predictions were wrong

Recorded outcomes override predictions. If formal timed out on a structure once, that structure goes to simulation from then on. Every verdict says why, and every skip points to its evidence.

Share results

The store is a plain folder (.rvsched/). Commit it, and anyone can read it from its raw URL without installing a server:

rvsched route rtl/*.v --store https://raw.githubusercontent.com/you/repo/main/.rvsched

In CI

- uses: 0x-auth/rv-verification-scheduler@v0.1.1
  with:
    files: rtl/*.v

Measured

bench/run.py gives each module to a real formal tool (Yosys equivalence checking: RTL against its own synthesized netlist, 60 s limit) and compares the outcome with the prediction made beforehand. The run covered 28 modules: PicoRV32, the examples, and small probe modules written for this test.

scored 25 (3 PicoRV32 wrappers predicted correctly but can't be cached, see below)
wrong 2: counter_128 and picorv32_pcpi_mul, sent to simulation but formal proved them
multipliers 8-bit operands proved, 10-bit and wider did not

Read honestly. The multiplier threshold was fixed using this same run, so those rows are not an independent test. This kind of check matches flip-flops by name, so it says little about the state-size rule; both misses come from that rule. A property-checking benchmark is the next test.

To reproduce (needs yosys or pip install yowasp-yosys): python3 bench/run.py path/to/picorv32.v, then rvsched calibrate --store bench/.rvsched.

Limits

  • It reads source; it doesn't elaborate the design. Unresolvable widths are assumed to be 32 bits, because guessing too high is the safe direction.
  • A module that depends on something it can't see (an unknown module, a package, an undefined macro) gets no fingerprint. It is never cached, only recognized.
  • If your flow uses -D defines, pass the same ones (-D FORMAL). They are folded into the fingerprint.
  • Thresholds live at the top of rvsched/verilog.py. Tune them to your tool, or let calibrate show you where they're wrong.

Extend it

The core (rvsched/core.py) is three functions and one record format, and it doesn't change. New languages and stores are plugins (details):

# your package's pyproject.toml
[project.entry-points."rvsched.languages"]
vhdl = "my_pkg.vhdl"          # registers itself with @rvsched.language("vhdl")

[project.entry-points."rvsched.stores"]
s3 = "my_pkg.s3store"         # registers itself with @rvsched.store("s3")

A language provides split, recognize and fingerprint. A store provides get, put and all. The record format is rvsched/1; see Record in core.py.

License

Apache 2.0

Metadata

Release files for rvsched 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rvsched 0.1.1
File Size Uploaded Provenance Actions
rvsched-0.1.1.tar.gz 24.0 kB Without provenance Details for rvsched-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rvsched 0.1.1
File Interpreter ABI Platform Actions
rvsched-0.1.1-py3-none-any.whl Python 3 none any Details for rvsched-0.1.1-py3-none-any.whl

Total release size: 45.3 kB

Release files / rvsched-0.1.1.tar.gz

Download URL rvsched-0.1.1.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ea5923f54c4c5d13862e5749fc3a8832661ad8af9028f208645471c106f8f3e9
BLAKE2b-256 checksum
How to use checksums
634d868a9c12a2f51d7ef56e1820ae6144da32d28761d8ad1d44effb944c7b3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / rvsched-0.1.1-py3-none-any.whl

Download URL rvsched-0.1.1-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfee2aa027650e33509251167dcb67feb51471600cb97ccc32d6ed5e3c6609ea
BLAKE2b-256 checksum
How to use checksums
eda5b270958209aec7ec2e46309ed352acb54684354a917d6af7e6522319f3b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for rvsched 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page