Skip to content

About

Yosys SystemVerilog 1800-2023 Synthesis that matches Verilator (RTL matches gate-level simulation)

Resources

Code of conduct

Security policy

Stars

8 stars

Watchers

2 watching

Forks

Repository files navigation

UHDM to RTLIL Frontend

Gates (every PR + nightly) — a PR lands only on a clean run:

CI Regression (sharded) Frontend matrix

IP sweeps (every other day; half of them on odd days, half on even days) — one badge per sweep workflow, in the order docs/supported_ip.md lists them; each links to its per-module report:

ibex rp32 fx68k scr1 rggen veer-eh1 tnoc veer-el2 veer-eh2 rsd black-parrot opentitan pavona cva6 cva6 flavours caliptra xiangshan core external IP sv-tests sv-synth-tests sv-yosys-issues sv-elab-issues slang-issues

A Yosys frontend that enables SystemVerilog synthesis through UHDM (Universal Hardware Data Model) by converting UHDM representations to Yosys RTLIL (Register Transfer Level Intermediate Language). Focused on creating post-synthesis (Gate-level) netlists that matches RTL simulation using Verilator as the golden standard.

✅ Every result is verified

Nothing here is counted as "working" on a read-only or vacuous pass. Every synthesized netlist is proven correct by formal equivalence — Yosys equiv_induct plus a sound SAT-from-reset miter against the Yosys Verilog-frontend golden — and/or by high-activity randomized Verilator co-simulation against the original RTL. A SAT miter also adjudicates every divergence so an inductive-proof gap is never mistaken for a real bug. See docs/verification.md.

Quick Start

SystemVerilog (.sv) → [Surelog] → UHDM → [UHDM Frontend] → RTLIL → [Yosys] → Netlist

Two components: Surelog parses and elaborates SystemVerilog into UHDM, and the UHDM Frontend (this repository, src/frontends/uhdm/) imports the elaborated model into Yosys RTLIL. The plugin adds two Yosys commands, read_sv (in-process Surelog compile, recommended) and read_uhdm (a pre-generated .uhdm file):

git clone --recursive https://github.com/chipsalliance/uhdm2rtlil.git && cd uhdm2rtlil
git config core.hooksPath .githooks
make                                  # Surelog, Yosys (+ read_slang) and the plugin
# synthesize one of the regression tests (any .sv works the same way)
./out/current/bin/yosys -m build/uhdm2rtlil.so -p "read_sv -parse -nobuiltin test/simple_counter/dut.sv; synth -top simple_counter"

Prerequisites (GCC ≥ 11, CMake 3.28–3.31, Verilator 5.x) and the full command reference are in docs/getting_started.md.

Documentation

Getting started prerequisites, build, read_sv / read_uhdm usage
Verification methodology & test-suite status formal equivalence, the SAT-from-reset miter, Verilator co-sim; the regression numbers
Supported core IP every swept core and IP family with its measured result
Benchmarking per-core co-simulation vs read_slang, the reference frontend's own record, the 4-frontend matrix
Architecture & supported SystemVerilog the importer's components and the language features it handles
Testing test structure, running the suites and sweeps, known-failure lists, CI, project layout
Development adding a construct, debugging, the AI-assisted workflow, contributing
Changelog the annotated list of landed features and fixes
Test catalog every internal test, incl. the UHDM-only list
sv-tests coverage chipsalliance/sv-tests per test: read_uhdm vs read_verilog vs read_slang
What read_slang cannot read · incomplete test cases the reference frontend's failures with reproduce recipes; tests no frontend can be judged on
To do: cores and IP to bring under the sweeps what is not swept yet, what blocks each, and how it would be swept

Supported core IP

Upstream RTL imported verbatim and swept every other day -- formal equivalence against read_slang, an opt-check for dropped drivers, and Verilator co-simulation of both netlists against the RTL. Results, scopes and commits are in docs/supported_ip.md; the badges above are the sweeps.

Total tally (every PR runs the first two; each sweep runs every other day):

designs / rows passing measured by
Internal SystemVerilog tests 1997 1952 functional, 2 recorded failures (test/failing_tests.txt) the regression (run_parallel.sh), docs/verification.md
Upstream Yosys tests 520 509 functional, 11 recorded failures the same regression
Sweep rows (23 workflows, each every other day) 12985 9859 proven, 10307 co-sim passes (a run whose RTL never changes an output is not counted), 0 undriven — the latest passing run of each sweep (2026-11-13 to 2026-11-20), counted by test/sweep_table.py the sweep reports, docs/benchmarking.md
All 15506

Contributing

This frontend is developed with an AI coding agent, and that is how we prefer contributions too: have your agent (Claude Code is what the project uses; the checked-in skill .claude/skills/verify-uhdm-equivalence loads automatically in this repository) take a divergence from symptom to a fully vetted fix. A pull request is accepted on the same bar whoever wrote it:

  • one change -- one reader defect, one harness change, or one document;
  • a test case and/or a sweep: a test/<name>/ with a dut.sv and its gates (test_structural.ys / test_slang_equiv.ys) that FAILS without the change and passes with it, and, when the defect came from third-party RTL, the sweep that keeps measuring it (an entry in test/ext_ip/<family>.json or a per-core sweep);
  • vetted with the skill's verification process: frontend workflow, Verilator co-sim, equiv_induct, the sound SAT-from-reset miter, the sweep row re-measured, and a green full local regression (cd test && ./run_parallel.sh 6 --no-cva6);
  • a commit message that states symptom, cause, fix, test and row, and ends with Prepared with the assistance of Claude Code. (the CLA bot rejects other trailers).

Hand-written contributions are welcome under the same bar. Setup, the debug-to-fix method and the review checklist are in docs/development.md.

License

See LICENSE file for details.

Related Projects

  • Yosys - Open source synthesis suite
  • Surelog - SystemVerilog parser
  • UHDM - Universal Hardware Data Model
  • sv-elab / yosys-slang and slang - the read_slang frontend used as the formal reference for SV-only designs
  • sv2v - SystemVerilog-to-Verilog converter, the third column of the frontend matrix
  • Verilator - the co-simulation engine behind every co-sim result
  • Verified IP: the cores, SoCs, IP libraries and the conformance corpus listed under Supported core IP above

About

Yosys SystemVerilog 1800-2023 Synthesis that matches Verilator (RTL matches gate-level simulation)

Resources

Code of conduct

Security policy

Stars

8 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages