Thomasb81/xezim

SystemVerilog (IEEE 1800-2017) Simulator

★ 0Forks 0RustGitHub ↗Compare

README

xezim

An open-source SystemVerilog simulator, written in Rust.
RTL, gate-level and UVM simulation in one command, from source to results.

CI Release sv-tests: 99.0% Rust 1.92+ License: Apache 2.0

User guide · Command line · UVM · DPI & VPI · Release notes · Contributing


Welcome to xezim

From source to results in one command

  • Verilog and SystemVerilog, IEEE 1800-2023 (1800-2017 on request)
  • Preprocess, elaborate and simulate in one step: no library, compile or elaboration stages to manage, and no license server
  • Accepts the compile and run options of existing flows: args files, +define+/+incdir+, -do scripts, parameter overrides

RTL to gate level

  • Event-driven simulation with the full IEEE 1800 scheduling regions
  • UDPs, drive strengths, specify-block delays and timing checks
  • SDF back-annotation (--sdf)
  • IEEE 1801 UPF power intent (--upf)

Verification

  • UVM 1.2, IEEE 1800.2-2017 and 1800.2-2020, with UVM's DPI-C helpers built in
  • Classes, constrained randomization, covergroups and SVA
  • Functional, assertion and code coverage

Debug and integration

  • VCD, FST and XTrace waveforms
  • DPI-C, the IEEE 1800 VPI (routines, callbacks and the design object model), and cocotb Python testbenches
  • Diagnostics that name the file, line and macro a problem came from

Fast to iterate

  • Elaborates a 468-file dual-core RISC-V SoC in about 18 s
  • Warm design cache for repeated runs
  • Profile-guided builds, optional JIT and ahead-of-time native compilation

Open

  • Apache 2.0 licensed, developed in the open
  • More than 3,200 regression tests, many checked against a commercial reference simulator
  • Built with AI assistance as part of the engineering workflow

The feature list has the details.

What xezim does

xezim reads Verilog and SystemVerilog source files and simulates them. It preprocesses and parses the sources, elaborates the design hierarchy, compiles processes and continuous assignments into bytecode, and runs them on an event-driven kernel that follows the IEEE 1800 scheduling semantics. Most logic runs on fast two-state executors, which fall back to full four-state evaluation wherever x and z values appear.

Everything happens in one invocation, so a design goes from source to results without a separate build step, and a test suite made of many short runs gets its answers quickly. The same command line works for an RTL unit test, a gate-level netlist with SDF timing, or a full UVM environment.

Quick start

git clone https://github.com/aionhw/xezim.git
cd xezim
cargo build --release          # or ./scripts/build-pgo.sh for a profile-guided build
// counter.sv
module counter_tb;
  logic clk = 0, rst = 1;
  logic [3:0] count;
  always #5 clk = ~clk;
  always_ff @(posedge clk) count <= rst ? '0 : count + 1;
  initial begin
    #12 rst = 0;
    repeat (3) @(posedge clk) $display("t=%0t count=%0d", $time, count);
    $finish;
  end
endmodule
$ ./target/release/xezim counter.sv
t=15 count=0
t=25 count=1
t=35 count=2
Simulation finished at time 35 ($finish called)

A UVM testbench needs only the UVM sources on the command line:

xezim -s top -I $UVM/src $UVM/src/uvm_pkg.sv <design and testbench files> \
      +UVM_TESTNAME=my_test

See the user guide and the UVM guide for more.

Performance

Whole-run wall-clock time on one machine (Intel Core i7-9800X, 6 cores, Linux): xezim 0.11 as a plain release build, against a commercial reference simulator in its optimized mode (no debug visibility). Both simulators produce the same results on every row.

Workload xezim 0.11 Reference simulator
XuanTie C906 SoC, CoreMark ×1 (295,294 cycles) 91 s 82 s, 44 s of it simulating
XuanTie C910 dual-core SoC, memcpy ×200, cold start 118 s, about 18 s of it compiling 136 s, 97 s of it simulating
AXI4 AVIP, UVM base test 5.8 s 97 s, 51 s of it simulating
  • xezim starts fast. Compiling and elaborating is a small part of a run, so short tests and suites of many runs favour xezim.
  • On long runs the reference kernel is faster, about 2× in the simulation phase on the C906, and more on long UVM runs. Closing this gap is where current work goes: since 0.11, host instructions are down 7% on CoreMark and on the AXI4 AVIP and 11% on the C910 memcpy, and peak memory on the C906 CoreMark run is down from 2.6 GB to 0.6 GB (see the release notes).

To get the most out of a build, use the profile-guided build (up to 14.5% fewer instructions when trained on your own workload) and keep the warm design cache on. Native compilation pays on designs with few, very hot blocks (Ibex CoreMark −23%), so measure it on yours.

Conformance

  • sv-tests: xezim 0.11.0 passes 4,722 of 4,770 tests (99.0%) of the sv-tests suite.
  • UVM: the mbits-mirafra AVIP base tests for AXI4, APB, I3C, SPI and AXI4-Lite print the same UVM messages as a commercial reference simulator, and 32 of 35 UVM 1800.2-2017 example testbenches pass.
  • Regression suite: more than 3,200 tests, run in CI with and without the JIT. Many are differential tests whose expected values were measured on a commercial reference simulator; see CONTRIBUTING.md.

Documentation

Guide Contents
Supported features Language, UVM, coverage, debug and integration features in detail
User guide Running simulations, waveforms, design cache, native compilation, timescales
Command-line reference Every option and environment variable, and the spellings of other simulators that xezim accepts
UVM guide Running UVM testbenches, supported features, UVM's DPI-C library
DPI and VPI guide Loading C and C++ libraries, the VPI surface
Coverage guide Functional, assertion and code coverage, xezim_cov.json
UPF guide IEEE 1801 power intent
Debugging guide Tracing, diagnosing hangs, comparing against another simulator
Building from source Requirements, profile-guided builds, working on xezim-core
Release notes Changes per release, verified workloads, compliance results

Support

Questions, bug reports and feature requests go to GitHub issues. A small self-checking testcase gets a bug fixed fastest; see CONTRIBUTING.md for what to include. Pull requests are welcome.

Background

xezim explores whether modern tools and AI assistance can sharply reduce the cost of building core EDA infrastructure such as a simulator: work that has traditionally taken large teams many years. It was built incrementally, from simple combinational logic up to SoCs and UVM environments, with every step verified against the language standard and against a commercial reference simulator. Longer term, the project looks at cloud-scale and distributed multi-CPU simulation.

The project was previously developed under the name sisSIM.

Contributors

Thank you to everyone who has improved xezim through pull requests:

  • Thomas Burg — class-system and UVM fixes: static-property chains through object handles (§8.25), associative-array method dispatch and ref-writeback, ClassName::static_prop access, parser-gap self-tests, test-harness hardening, per-process bookkeeping for methods that park mid-body, the condition-waiter drain de-duplication, and the NBA-region lane in the --max-time hang report.
  • Vrajesh Prakhya — real-number modelling: Verilog-AMS wreal nets resolved by summing, user-defined nettypes across the hierarchy and in packages (§6.6.7, §6.6.8), real-ness of members projected from call results, negative-test registrations, and the diagnosis that cover property sites were tallied as failing assertions.
  • Oscar Gustafsson — expanded VPI functionality (vpi_get_value, ObjectValType), CI setup, and clippy cleanups.
  • Chen Ben Haroosh — submodule-inline generate-for elaboration: genvar- dependent declarations and parameter type default resolution, plus the accompanying SystemVerilog compliance cases.
  • Jayaraman RP — cross-platform installation scripts, including the macOS installer with UVM setup.
  • Ganesh T S — wide-number parsing for $sscanf/$fscanf/$value$plusargs and the string conversion methods (arbitrary-precision decimal in the core), loop-variable scoping against same-named identifiers in child instances, and detailed self-checking bug reports for struct and class member access.
  • eenky — declared defaults for parameters a class leaves out when it extends a parameterized class, and virtual-interface reads through class-handle chains (cfg.vif.data).
  • Francesco Urbani — +incdir+ directories in -F args files resolved against the args file's own directory.

New contributors are welcome; see CONTRIBUTING.md.

Acknowledgements

  • The Icarus Verilog project, for its public test suite
  • The sv-tests project
  • The Rust community and the open-source EDA projects xezim builds on

License

xezim is free software, licensed under the Apache License 2.0.

Contributors

aionhwThomasb81codexchenbhilvrajeshprakhyaoscargusGanesh-TNLopensource-elearningeenkyrpjayaramanurbanij

Issues