The vajax command-line interface provides ngspice-style access to circuit simulation.
After installing vajax, the CLI is available:
# Install with uv
uv sync
# Verify installation
vajax --version
vajax --help# Run simulation on a circuit file
vajax circuit.sim
# Specify output file
vajax circuit.sim -o results.raw
# Run with specific output format
vajax circuit.sim -o results.csv --format csvRun circuit simulation. This is the default command when a circuit file is provided.
# These are equivalent:
vajax circuit.sim
vajax run circuit.simOptions:
| Option | Description |
|---|---|
-o, --output FILE |
Output file path (default: circuit.raw) |
-f, --format FMT |
Output format: raw, csv, json (default: raw) |
--tran DT TSTOP |
Override transient analysis parameters |
--ac TYPE PTS FSTART FSTOP |
AC analysis (dec/lin/oct, points, freq range) |
--sparse |
Force sparse solver (for large circuits) |
--no-scan |
Disable lax.scan (use Python loop) |
--gpu |
Force GPU backend |
--cpu |
Force CPU backend |
--x64 |
Force float64 precision |
--x32 |
Force float32 precision |
--profile |
Enable profiling |
Examples:
# Transient analysis with custom parameters
vajax circuit.sim --tran 1n 100u
# AC analysis
vajax circuit.sim --ac dec 100 1k 1G
# Large circuit with sparse solver on GPU
vajax large_circuit.sim --sparse --gpu
# Force float64 precision on CPU
vajax circuit.sim --cpu --x64Run benchmark circuits from the VACASK test suite.
# List available benchmarks
vajax benchmark --list
# Run a specific benchmark
vajax benchmark ring
# Run with profiling
vajax benchmark ring --profileOptions:
| Option | Description |
|---|---|
-l, --list |
List available benchmarks |
--sparse |
Force sparse solver |
--x64 |
Force float64 precision |
--x32 |
Force float32 precision |
--profile |
Enable timing profiling |
Convert SPICE netlists to VACASK format.
vajax convert input.sp output.simDisplay system information.
vajax infoShows:
- JAX backend (CPU, CUDA, Metal)
- Float64 support status
- Available devices
Binary format compatible with ngspice tools and gwave waveform viewer.
vajax circuit.sim -o results.raw --format rawRead with ngspice:
ngspice> load results.raw
ngspice> plot v(out)
Read with gwave:
gwave results.rawComma-separated values, compatible with spreadsheets and data analysis tools.
vajax circuit.sim -o results.csv --format csvFormat:
time,node1,node2,...
0.0,0.0,1.2,...
1e-9,0.1,1.1,...JSON format for programmatic processing.
vajax circuit.sim -o results.json --format jsonFormat:
{
"times": [0.0, 1e-9, ...],
"voltages": {
"node1": [0.0, 0.1, ...],
"node2": [1.2, 1.1, ...]
}
}| Variable | Description |
|---|---|
JAX_PLATFORMS |
Force JAX platform: cpu, cuda, gpu |
JAX_ENABLE_X64 |
Enable float64: 1 or 0 |
NGSPICE_BIN |
Path to ngspice binary (for convert) |
# Basic transient simulation
vajax ring_oscillator.sim --tran 1n 10u
# Large circuit with sparse solver
vajax c6288.sim --tran 1n 100n --sparse
# GPU acceleration
vajax ring_oscillator.sim --gpu --tran 1n 10u# Decade sweep, 100 points per decade
vajax amplifier.sim --ac dec 100 1k 1G
# Linear sweep
vajax filter.sim --ac lin 1000 1k 10k# Run ring oscillator benchmark with profiling
vajax benchmark ring --profile
# Compare sparse vs dense solver
vajax benchmark mul --profile
vajax benchmark mul --profile --sparse# Process multiple circuits
for f in circuits/*.sim; do
vajax "$f" -o "results/$(basename "$f" .sim).raw"
done# Check system info
vajax info
# Force CPU fallback
vajax circuit.sim --cpuFor difficult circuits, try:
# Use sparse solver for better conditioning
vajax circuit.sim --sparse
# Force double precision
vajax circuit.sim --x64For large circuits:
# Use sparse solver (required for >1000 nodes)
vajax large_circuit.sim --sparse- README.md - Getting started guide
- Architecture Overview - System design
- GPU Solver Architecture - Performance optimization