VAJAX CLI Reference¶
The vajax command-line interface provides ngspice-style access to circuit simulation.
Installation¶
After installing vajax, the CLI is available:
Basic Usage¶
# 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 csv
Commands¶
run (default)¶
Run circuit simulation. This is the default command when a circuit file is provided.
Options:
| 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 --x64
benchmark¶
Run 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 --profile
Options:
| Option | Description |
|---|---|
-l, --list |
List available benchmarks |
--sparse |
Force sparse solver |
--x64 |
Force float64 precision |
--x32 |
Force float32 precision |
--profile |
Enable timing profiling |
convert¶
Convert SPICE netlists to VACASK format.
info¶
Display system information.
Shows: - JAX backend (CPU, CUDA, Metal) - Float64 support status - Available devices
Output Formats¶
Raw (ngspice-compatible)¶
Binary format compatible with ngspice tools and gwave waveform viewer.
Read with ngspice:
Read with gwave:
CSV¶
Comma-separated values, compatible with spreadsheets and data analysis tools.
Format:
JSON¶
JSON format for programmatic processing.
Format:
Environment Variables¶
| 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) |
Examples¶
Transient Analysis¶
# 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
AC Analysis¶
# Decade sweep, 100 points per decade
vajax amplifier.sim --ac dec 100 1k 1G
# Linear sweep
vajax filter.sim --ac lin 1000 1k 10k
Benchmarking¶
# Run ring oscillator benchmark with profiling
vajax benchmark ring --profile
# Compare sparse vs dense solver
vajax benchmark mul --profile
vajax benchmark mul --profile --sparse
Batch Processing¶
# Process multiple circuits
for f in circuits/*.sim; do
vajax "$f" -o "results/$(basename "$f" .sim).raw"
done
Troubleshooting¶
GPU Not Detected¶
Convergence Issues¶
For difficult circuits, try:
# Use sparse solver for better conditioning
vajax circuit.sim --sparse
# Force double precision
vajax circuit.sim --x64
Out of Memory¶
For large circuits:
See Also¶
- README.md - Getting started guide
- Architecture Overview - System design
- GPU Solver Architecture - Performance optimization