Skip to main content

Event-driven Verilog-A Simulator with a Python compatibility engine and optional evas-rust backend

Project description

EVAS — Event-driven Verilog-A Simulator

PyPI CI Docs License: MIT

A lightweight behavioral simulator for digital/mixed-signal Verilog-A models. EVAS ships with a Python compatibility engine by default and an optional evas-rust backend for supported event-driven designs. No ngspice, no KCL/KVL solver.


Docs: evas.tokenzhang.com


What EVAS does

EVAS simulates voltage-mode, event-driven Verilog-A behavioral models. You provide:

  1. A .va file — your behavioral model (comparator, DAC, SAR logic, DWA controller, …)
  2. A .scs testbench netlist — voltage sources, ahdl_include, and a tran statement
  3. Run evas simulate — get tran.csv waveforms and optional plots

The main simulator is transient-first. Compiled models also expose lightweight behavioral helpers for analysis("ac"), ac_stim(), and Verilog-A noise source functions so source-style models can run AC/noise sweeps from Python without claiming SPICE-style linearized circuit analysis.

The bundled examples are a compact smoke-test set. For your own design, copy the closest example directory, swap in your .va, adjust the stimulus sources and save list, and run. The larger verification example library belongs with the agent workflow in veriloga-skills/evas-sim.

Installation

pip install evas-sim
evas list        # verify install — prints bundled example groups

If evas is not on PATH, use python -m evas.

The packaged default uses the Python engine so examples and user netlists run from PyPI or a fresh source checkout. Compatible Linux wheels also include the evas-rust shared library. To request evas-rust explicitly, pass --engine evas-rust, set EVAS_ENGINE=evas-rust, or add simulatorOptions options evas_engine=evas-rust to the testbench. If your platform installed the pure Python wheel, build the Rust backend from source first. The legacy evas2 and rust2 selectors remain accepted as compatibility aliases.

Simulating your own design

evas simulate path/to/tb.scs -o output/mydesign
evas simulate path/to/tb.scs -o output/mydesign --engine evas-rust

Output in -o dir: tran.csv (waveforms), strobe.txt (log messages), .png plots.

Minimal testbench template (.scs):

simulator lang=spectre
global 0

ahdl_include "my_module.va"

Vvdd (vdd 0) vsource type=dc dc=1.8
Vclk (clk 0) vsource type=pulse val0=0 val1=1.8 period=10n rise=0.1n fall=0.1n width=4.9n

IDUT (clk vdd out) my_module vdd=1.8

tran tran stop=200n maxstep=0.1n
save clk:2e out:6f

Testbench structure reference

The bundled examples contain five small groups and their testbenches. They are the in-package reference for common wiring patterns:

Pattern needed Look at
Clocked digital logic clk_div, digital_basics
Comparator with feedback comparator/cmp_offset_search
ADC + sample-hold adc_dac_ideal_4b
Noise / random stimulus noise_gen
Multi-cycle edge timing comparator/cmp_delay, edge_interval_timer

Supported Verilog-A

Support tiers

EVAS is strongest in the behavioral-event / waveform-oriented tier: voltage reads and drives, event-controlled state, timers, transitions, table/random/file helpers, and small mixed-signal logic/wreal subsets. This tier is implemented by a lightweight event/waveform engine and does not require a full conservative analog solver.

EVAS also accepts a limited behavioral-continuous-time tier. Operators such as ddt(), idt(), laplace_*, zi_*, and limexp() compile and run with explicit behavioral approximations for transient compatibility. They should not be read as Spectre-equivalent continuous-time transfer-function solving.

EVAS does not implement the conservative-current / KCL-MNA tier. Device-style models that rely on I(p,n) <+ ..., branch charge/current contributions, nonlinear device equations, or transistor-level AC/DC matrix solving remain outside the current simulator design.

Feature Status
V(node) <+, V(a,b) differential
@(cross(...)), @(above(...)), @(initial_step)
cross(expr, dir, time_tol, expr_tol) event tolerances ✅ (behavioral approximation)
@(timer(period)), @(final_step)
transition() with delay / rise / fall
slew(x, maxrise, maxfall) transient limiter ✅ (behavioral approximation)
for, repeat, while, do while, if/else, case/endcase, begin/end
arrays, including integer/real 1-D and 2-D state arrays
parameters and variables (real / integer / string)
user-defined functions/tasks, including bounded recursive functions
module, connectmodule, simple behavioral hierarchy
`include, `define, `default_transition
SI suffixes, math: sin cos exp ln log pow floor ceil
$temperature, $vt, $abstime
$bound_step()
$fopen(), $fclose(), $fscanf(), $fstrobe(), $fwrite(), $fdisplay()
$display, $strobe, $sformat(), $swrite()
$random, $dist_*(), $rdist_*() behavioral random helpers
last_crossing(expr, dir, time_tol, expr_tol) ✅ (most-recent event-time approximation)
analysis("ac"), ac_stim() ✅ (behavioral Python sweep helper)
white_noise(), flicker_noise(), noise_table() ✅ (behavioral PSD / integrated-noise helper)
ddt(), idt(), laplace_*(), zi_*(), limexp() ✅ (behavioral transient approximation)
I() <+, q() <+, branch charge/current contributions not supported by design
SPICE-style AC/DC matrix solving, transistors not supported by design
Spectre subckt hierarchy not yet implemented

Accuracy Profiles

You can set simulatorOptions options evas_profile=<mode> in .scs:

  • fast: lower refinement (refine_factor=8, refine_steps=4) for faster runtime
  • balanced: default EVAS behavior (16, 8)
  • precision: higher refinement (32, 16) for tighter event/cross timing

errpreset=conservative/liberal is still respected; evas_profile applies an explicit EVAS-side override when set. Practical correspondence: fast ≈ liberal, balanced ≈ moderate, precision ≈ conservative (guidance only, not solver-equivalence claim).

CSV output format

The save statement accepts per-signal format hints:

save vin:10e vout:6f clk:2e dout:d
Suffix Example
:6e (default) 4.500000e-01
:Nf fixed-point, N decimal places
:d integer (for digital buses)

Bundled examples (reference only)

Five groups ship with the PyPI package for install verification, CLI sanity checks, and small starting templates. The full workflow-oriented example set is maintained outside this simulator package in veriloga-skills/evas-sim.

Group Verilog-A modules Notes
clk_div clk_div
digital_basics and_gate, or_gate, not_gate, dff_rst, inverter
noise_gen noise_gen
adc_dac_ideal_4b adc_ideal_4b, dac_ideal_4b, sh_ideal 3 stimuli: ramp / sine / 1000-pt sine
comparator cmp_ideal, cmp_strongarm, cmp_offset_search, cmp_delay, edge_interval_timer 4 sub-examples

Contributing

git clone https://github.com/Arcadia-1/EVAS.git
cd EVAS
pip install -e ".[dev]"
pytest tests/ -v

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

evas_sim-0.5.2.tar.gz (439.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

evas_sim-0.5.2-py3-none-manylinux2014_x86_64.whl (640.7 kB view details)

Uploaded Python 3

evas_sim-0.5.2-py3-none-any.whl (377.0 kB view details)

Uploaded Python 3

File details

Details for the file evas_sim-0.5.2.tar.gz.

File metadata

  • Download URL: evas_sim-0.5.2.tar.gz
  • Upload date:
  • Size: 439.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evas_sim-0.5.2.tar.gz
Algorithm Hash digest
SHA256 1eff71c8f4cbb616c9e9714fa671319f60349cc719557b8006cf40b6b61ebc09
MD5 5b6f5cabb3613a65a7aeeedb0501456a
BLAKE2b-256 a226a47f180e3dcb20b85f7b81b4ee869964ba103e3905de039520999c8aa41c

See more details on using hashes here.

Provenance

The following attestation bundles were made for evas_sim-0.5.2.tar.gz:

Publisher: publish.yml on Arcadia-1/EVAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file evas_sim-0.5.2-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for evas_sim-0.5.2-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d55e32062d198e6ed28ef0f8512e1e09da8d3c5aa1d7fd3587b98dd868017de0
MD5 ae5dddb4d2d361a29484e729d20c5415
BLAKE2b-256 57e7cf5783092816c862d7ff5d89977cae9e08d4d6d093e035f4cb06bf2b227a

See more details on using hashes here.

Provenance

The following attestation bundles were made for evas_sim-0.5.2-py3-none-manylinux2014_x86_64.whl:

Publisher: publish.yml on Arcadia-1/EVAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file evas_sim-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: evas_sim-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 377.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evas_sim-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 713badf37ef287cf7704784f924c183379b81d5d52658dcdc4184281bc095cb0
MD5 ee6b5742f78897700d582538ddc791f4
BLAKE2b-256 e6047118f2fbfa5aa6d490f0757d55dc03ae6c2288725e9c8ade3c3154975fc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for evas_sim-0.5.2-py3-none-any.whl:

Publisher: publish.yml on Arcadia-1/EVAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page