Skip to content
aionhwPublic

About

Open-source SystemVerilog simulator in Rust. 4-state, event-driven, IEEE 1800-2023, runs real UVM.

Resources

Contributing

Stars

136 stars

Watchers

3 watching

Forks

Repository files navigation

Xezim

Xezim — Extensible SystemVerilog Simulator. Zero lock-in.

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.100+ 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
  • Opt-in switches for non-standard constructs, including early module data references (--relax-use-before-decl), and older keyword sets (--keywords 1364-1995)

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
  • $random and $dist_* follow the standard's Annex N, so a seed gives the same sequence as other simulators
  • 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), assertion callbacks and controls, and cocotb 2.0/2.1 Python testbenches
  • Diagnostics that name the file, line and macro a problem came from
  • Opt-in memory tracing during parsing, elaboration and simulation setup

Fast to iterate

  • Elaborates large RISC-V SoCs
  • Warm design cache for repeated runs
  • Checkpoints: save a run at a time (--save-at, $save) and continue it later, for example under another test (--restore)
  • Profile-guided builds, optional JIT and ahead-of-time native compilation

Open

  • Apache 2.0 licensed, developed in the open
  • More than 8,000 regression tests, including comparisons against a reference simulator
  • Built with AI assistance as part of the engineering workflow

The feature list has the details.

What's new in 0.11.7

  • Lower elaboration memory on large designs: compilation-unit declarations, prepared module bodies, declared types, constraint blocks and scope paths are shared instead of copied per instance, and parser tokens take 8 bytes.
  • Faster event scheduling: a process parked on @(...) over signals is examined only when one of them is written, and queue pop_front, push_front, insert and delete(i) no longer take time proportional to the queue.
  • C and C++ DPI sources in the file list, memory files for associative and multidimensional arrays, waveform exclusion with --wave-suppress, VPI assertion callbacks and controls, and cocotb 2.1.
  • Many fixes for unpacked arrays and assignment patterns, real and shortreal values, simulation time above 2^53 ticks, and port connections.

See the release notes for the complete changes.

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, six logical CPUs, Linux). The Xezim 0.11.3 figures were measured with a plain release build and cold caches. Reference figures are from earlier verified runs on the same machine in optimized mode, without debug visibility. Both simulators produce the same results on every row.

Workload Xezim Reference simulator
XuanTie C906 SoC, CoreMark ×1 (295,294 cycles) 82 s, 0.62 GiB peak 82 s, 44 s of it simulating
XuanTie C910 dual-core SoC, memcpy ×200, cold start 121 s, about 12 s of it compiling 136 s, 97 s of it simulating
AXI4 AVIP, UVM base test 7.8 s 97 s, 51 s of it simulating

AXI4 is the median of five runs; each SoC figure is one run. Host load affects elapsed time, so these figures describe the measured workloads rather than a controlled comparison. Compilation and elaboration account for only a small part of these Xezim runs, making startup cost useful to consider separately from simulation time.

To get the most out of a build, measure a profile-guided build trained on your own workload and keep the warm design cache on. Native compilation pays on designs with few, very hot blocks, so measure it on yours.

Elaboration memory

Xezim 0.11.6 also shares net-initializer targets across child instances. On the synthetic #721 fixture (32,768 instances, 32 initialized nets each), median peak RSS fell from 1,431 to 1,105 MiB (22.8%), and compile time from 8.40 to 7.89 seconds. These are three alternating runs per build with tracing and caches disabled, Rust 1.100, no LTO and 64 codegen units. The explicit-assignment control's memory and time changed by less than 1%. This measures one allocation cost; the original full-design OOM remains unverified. See diagnosing memory growth to investigate your own workload.

Xezim 0.11.7 shares or releases much more of the elaborated design. The release notes give each change with its own synthetic fixture; for example, 4,000 module definitions beside 200 compilation-unit declarations now peak at 107 MiB instead of 1,500 MiB, and 1,024 instances of a module whose class has 128 constraint expressions at 44 MiB instead of 1,672 MiB.

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: the default release suite of Xezim 0.11.7 passes 8,159 tests, with five ignored tests that pin known differences; CI also runs two JIT smoke tests. 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, checkpoints, design cache, memory diagnostics, native compilation, timescales, sources written for other simulators
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 contributes code, tests and bug reports to Xezim and xezim-core.

See CONTRIBUTORS.md for what each person contributed, and CONTRIBUTING.md to get involved.

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.

About

Open-source SystemVerilog simulator in Rust. 4-state, event-driven, IEEE 1800-2023, runs real UVM.

Resources

Contributing

Stars

136 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages