Event-driven Verilog-A Simulator — pure-Python behavioral simulation
Project description
EVAS — Event-driven Verilog-A Simulator
A lightweight, pure-Python behavioral simulator for digital/mixed-signal Verilog-A models. Event-driven. No C compiler, no ngspice, no KCL/KVL solver.
If you're a human — see the full docs at
📖 Docs: evas.tokenzhang.com | 中文
If you're an AI agent — load
skills/evas-sim/SKILL.md(or copy theskills/evas-sim/folder into your skills directory). It contains the full compatibility table, CLI reference, output format, and common failure modes — everything you need to write and debug EVAS simulations without guessing.
What EVAS does
EVAS simulates voltage-mode, event-driven Verilog-A behavioral models. You provide:
- A
.vafile — your behavioral model (comparator, DAC, SAR logic, DWA controller, …) - A
.scstestbench netlist — voltage sources,ahdl_include, and atranstatement - Run
evas simulate— gettran.csvwaveforms and optional plots
The bundled examples are starting points. For your own design, copy the closest example
directory, swap in your .va, adjust the stimulus sources and save list, and run.
Installation
pip install evas-sim
evas list # verify install — prints bundled example groups
If evas is not on PATH, use python -m evas.
Simulating your own design
evas simulate path/to/tb.scs -o output/mydesign
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 14 bundled example groups contain 27 .va modules and their testbenches.
They are the best reference for how to wire up common patterns:
| Pattern needed | Look at |
|---|---|
| Clocked digital logic | clk_div, digital_basics, lfsr |
| Comparator with feedback | comparator/cmp_offset_search |
| SAR / successive-approximation loop | sar_adc_dac_weighted_8b |
| DAC (binary or thermometer) | dac_binary_clk_4b, dac_therm_16b |
| ADC + sample-hold | adc_dac_ideal_4b |
| Voltage → digital bus (analog to bits) | dwa_ptr_gen/v2b_4b |
| DWA / data-weighted averaging | dwa_ptr_gen |
| Noise / random stimulus | noise_gen |
| Multi-cycle edge timing | comparator/cmp_delay, edge_interval_timer |
Supported Verilog-A
| Feature | Status |
|---|---|
V(node) <+, V(a,b) differential |
✅ |
@(cross(...)), @(above(...)), @(initial_step) |
✅ |
@(timer(period)), @(final_step) |
✅ |
transition() with delay / rise / fall |
✅ |
for, if/else, case/endcase, begin/end |
✅ |
| arrays, parameters (real / integer / string) | ✅ |
`include, `define, `default_transition |
✅ |
SI suffixes, math: sin cos exp ln log pow floor ceil … |
✅ |
$temperature, $vt, $abstime |
✅ |
$bound_step() |
✅ |
$fopen(), $fclose(), $fstrobe(), $fwrite(), $fdisplay() |
✅ |
$display, $strobe, $random, $dist_uniform(), $rdist_normal() |
✅ |
I() <+, ddt(), idt(), q() <+ |
not supported by design |
| AC/DC analysis, transistors | not supported by design |
Spectre subckt hierarchy |
not yet implemented |
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)
14 groups, 27 Verilog-A modules — use them as templates, not as the target.
| Group | Verilog-A modules | Notes |
|---|---|---|
clk_div |
clk_div |
|
clk_burst_gen |
clk_burst_gen |
|
digital_basics |
and_gate, or_gate, not_gate, dff_rst, inverter |
|
lfsr |
lfsr |
|
noise_gen |
noise_gen |
|
ramp_gen |
ramp_gen |
|
edge_interval_timer |
edge_interval_timer |
also reused in comparator |
d2b_4b |
d2b_4b |
thermometer-to-binary decoder |
dac_binary_clk_4b |
dac_binary_clk_4b |
|
dac_therm_16b |
dac_therm_16b |
|
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 |
4 sub-examples |
dwa_ptr_gen |
dwa_ptr_gen, dwa_ptr_gen_no_overlap, v2b_4b |
100 MHz; v2b_4b = voltage→4-bit ADC |
sar_adc_dac_weighted_8b |
sar_adc_weighted_8b, dac_weighted_8b, sh_ideal |
8-bit SAR; DNL/INL |
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file evas_sim-0.4.2.tar.gz.
File metadata
- Download URL: evas_sim-0.4.2.tar.gz
- Upload date:
- Size: 121.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f960dfb82022da4162c4a8d52d68266b84a0998456e44467d03ab2b9eecbf8bd
|
|
| MD5 |
81f7b6de1370f6db18b2d5b9ca4229b6
|
|
| BLAKE2b-256 |
6cfc1f2da63608f527eb55f888e3d6ef158c3334c377c03eb0a87a50f1cc541f
|
Provenance
The following attestation bundles were made for evas_sim-0.4.2.tar.gz:
Publisher:
publish.yml on Arcadia-1/EVAS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
evas_sim-0.4.2.tar.gz -
Subject digest:
f960dfb82022da4162c4a8d52d68266b84a0998456e44467d03ab2b9eecbf8bd - Sigstore transparency entry: 1110564152
- Sigstore integration time:
-
Permalink:
Arcadia-1/EVAS@f52310dd3cbe5fdc1974b66679d928c035964edf -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/Arcadia-1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f52310dd3cbe5fdc1974b66679d928c035964edf -
Trigger Event:
push
-
Statement type:
File details
Details for the file evas_sim-0.4.2-py3-none-any.whl.
File metadata
- Download URL: evas_sim-0.4.2-py3-none-any.whl
- Upload date:
- Size: 159.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcefbe3942ede26cef3e658a9deb99fd004e15f3be2ad6cd8810449b182cee60
|
|
| MD5 |
65f5e1a4d81d8412a9364021a64ca8c7
|
|
| BLAKE2b-256 |
c0a91e4d218d70a897b4de0c3c566eb9c104136f0911cc0c102ec696ee59eaf6
|
Provenance
The following attestation bundles were made for evas_sim-0.4.2-py3-none-any.whl:
Publisher:
publish.yml on Arcadia-1/EVAS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
evas_sim-0.4.2-py3-none-any.whl -
Subject digest:
fcefbe3942ede26cef3e658a9deb99fd004e15f3be2ad6cd8810449b182cee60 - Sigstore transparency entry: 1110564194
- Sigstore integration time:
-
Permalink:
Arcadia-1/EVAS@f52310dd3cbe5fdc1974b66679d928c035964edf -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/Arcadia-1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f52310dd3cbe5fdc1974b66679d928c035964edf -
Trigger Event:
push
-
Statement type: