Synthesized analog description language for rapid, portable analog/mixed-signal design
cascode is a concise language for describing analog and mixed-signal circuits with explicit
connectivity, typed physical quantities, and a declarative bench system. The toolchain links .cas
source into self-contained .cai artifacts and emits simulator netlists plus bench runs for
constraint checking.
It's designed to be engineer-friendly (reads like a schematic), tool-friendly (typed quantities, deterministic text formats), and reusable (benches bound through interfaces rather than rewritten per topology).
New to Cascode? Start here to understand the core concepts through a practical OTA example:
- Spec overview
- Chapter 1 β Introduction
- Chapter 2 β Core Concepts
- Chapter 3 β Syntax Reference
- Chapter 4 β Bench System
Practical usage guide:
docs/language/README.mddocs/language/style.mddocs/language/bench-cookbook.mddocs/language/connectors.mddocs/language/troubleshooting.md
-
npm (prebuilt binaries, zero .NET runtime required)
npm install -g @cascode/cascode-cli
Notes: The npm wrapper downloads a self-contained
cascodebinary for your platform from GitHub Releases. If your network blocks GitHub, setCASCODE_DOWNLOAD_BASEto a mirror and reinstall. -
.NET global tool (requires .NET 10 SDK)
dotnet tool install -g Cascode.Cli
-
Standalone release (download and add to PATH)
Download the archive matching your OS/arch (e.g.,
cascode-linux-x64.tar.gz) from the Releases page, extract, and placecascodeon your PATH.
After install, verify:
cascode --version
cascode --help-
Stable (latest):
- npm:
npm install -g @cascode/cascode-cli - dotnet tool:
dotnet tool install -g Cascode.Cli
- npm:
-
Pre-release (release candidates, nightly tags):
- npm:
npm install -g @cascode/cascode-cli@next(or pin a specific tag, e.g.@0.5.1-rc.1) - dotnet tool:
dotnet tool install -g Cascode.Cli --version 0.5.1-rc.1 - Direct download: grab the matching asset from the GitHub release marked "Pre-release".
- npm:
- Unified, deterministic artifacts. Link
.casinto.cai(self-contained, diff-friendly). - Explicit connectivity.
--wiring and.Terminal--Netbindings; no implicit connect-by-name. - Typed quantities. Literals like
1.8V,50Ohm,15pF,60deg,40dBare first-class. - Declarative benches. Define
benchonce, bind through interfaces, constrain viabinding::Measurement. - Tooling.
cascode link,emit,bench run,verify,erc,render, plus PDK workspace tools.
Cascode is a unified language: circuits, benches, and primitives share a single syntax. A small,
self-contained example (from tests/golden/cas/bench/RcLowpass.el.cai) looks like this:
VERSION 3.0
primitive Resistor Ideal_Resistor(size primSize) {
device "resistor"
params { R = primSize.R }
}
primitive Capacitor Ideal_Capacitor(size primSize) {
device "capacitor"
params { C = primSize.C }
}
bench DiffToSELowpass {
stim IN : Diff
resp OUT : analog
fill {
net g0 : ground
GND g = new GND() { .GND--g0 }
VAC vp = new VAC(A=1, phase=0deg) { .P--IN.P, .N--g0 }
IN.N--g0
}
analysis {
ACAnalysis ac = new ACAnalysis(space=Log, samples=200, start=1Hz, stop=1GHz)
}
measurements {
measurement LowpassBandwidth : Hz {
TransferFunction H = transfer(ac, IN, OUT)
GainSpectrum G = db20(H.Mag())
return G.FindCrossing(-3dB, dir=falling, cross=1, from=ac.start, to=ac.stop)
}
}
}
circuit RcLowpass {
level EL
input IN : Diff
output OUT : analog
ground GND
fill {
Resistor R1 = new Ideal_Resistor(size(R=1k)) { .P--IN.P, .N--OUT }
Capacitor C1 = new Ideal_Capacitor(size(C=1p)) { .P--OUT, .N--GND }
}
benches {
bind DiffToSELowpass as lp {
bench.IN--dut.IN
bench.OUT--dut.OUT
dut.GND--g0
}
}
constraints {
numeric { c_fc = lp::LowpassBandwidth >= 50MHz }
}
}
cascode linkresolvesincludedirectives and writes.caioutput.cascode emitemits simulator netlists from EL circuits (source.casor linked.cai).cascode bench runruns constraint-selected benches and writesresults.jsonplus per-bench traces.cascode verifychecks numeric constraints against results.
Optional tooling:
cascode ercruns electrical rule checks.cascode renderrenders an SVG schematic from an EL circuit.
Roadmap stages (vision):
cascode synconsumes.hl/.ml.caiplus<name>.synth.yamland produces.el.cai(topology selection and sizing).cascode parconsumes.el.caiand produces physical layout artifacts;.calis reserved for Cascode Layout files (format specified separately).
cascode/
ββ README.md
ββ spec/
β ββ language/
β ββ Ch01_Introduction.md
β ββ Ch02_Core_Concepts.md
β ββ Ch03_Syntax_Reference.md
β ββ Ch04_Bench_System.md
ββ lib/
β ββ std/
β ββ prim/ # Primitive definitions + connector interfaces
β ββ bench/ # Standard bench definitions (declarative)
β ββ amp/ # Amplifier interfaces and circuits
β ββ composites/ # Multi-block composites
β ββ refs/ # Reference circuits (current/voltage references)
ββ tools/
β ββ cli/
β ββ language/
β ββ bench/
β ββ workspace/
β ββ render/
ββ tests/
β ββ golden/ # Canonical Cascode fixtures and results (see below)
β ββ integration/
β ββ unit/
ββ editors/
β ββ vscode/
ββ examples/
ββ harnesses/
tools/cli: CLI entrypoints and UX (no core semantics).tools/language: Grammar, parsing, linking, validation, and IR for the Cascode language.tools/bench: Bench planning/runtime and bench-oriented SPICE emission support.tools/workspace: PDK workspace scanning and persistence (pdk.db).tools/render: Schematic/layout rendering from EL circuits.
- Build artifacts go in
build/(not committed). - Linked Cascode (
.cai) is line-oriented text with explicit units and deterministic ordering.
# Build everything (compiler, CLI, tests)
dotnet build
# Run the CLI directly
dotnet run --project tools/cli/Cascode.Cli.csprojIf you want to build the repo and install it as a global tool on your shell (so you can run cascode directly from anywhere):
scripts/install-dev-tool.shThis script will:
- Pack the CLI project into a NuGet library
- Uninstall any existing global installation of
Cascode.Cli - Install the newly built version as a global .NET tool
After installation, ensure ~/.dotnet/tools is on your PATH, then verify:
cascode --versiontests/golden/ is the canonical store for regression assets that tie Cascode
inputs (*.cai) to expected emitted outputs and constraint-checking results.
Architecture, command modules, and snapshot testing workflow are documented in tools/README.md.
# Link source (resolve includes) to self-contained .cai (default mode)
cascode link tests/golden/cas/stress/OTA5T_Sky130.cas -o build
# Link in include-pruned bench mode (preserve bench bindings, omit bench definitions, keep a minimal include set)
cascode link tests/golden/cas/stress/OTA5T_Sky130.cas -o build --no-link-benches
# Emit simulator netlists from an EL circuit (source .cas or linked .cai)
cascode emit tests/golden/cas/bench/RcLowpass.el.cai --backend ngspice --out build/rc-emit
# Run benches and write consolidated results plus a per-point trace for each bench.
# If a bench name is omitted, all benches declared by the circuit are executed.
cascode bench run tests/golden/cas/bench/RcLowpass.el.cai -o build/rc-run --backend ngspice
# Verify constraints from either results.json or trace.jsonl
cascode verify tests/golden/cas/bench/RcLowpass.el.cai build/rc-run/results.jsonSyntax highlighting for .cas files is available for VS Code, Cursor, and other editors:
# Install for VS Code / Cursor / VSCodium (macOS/Linux)
cd editors/vscode && ./install.sh
# Windows (PowerShell)
cd editors\vscode; .\install.ps1Highlights keywords (circuit, interface, bench, fill, constraints, harness), typed quantities (1.8V, 15pF, 50MHz), the wire operator (--), and more. See editors/README.md for details and GitHub Linguist integration.
For native editor/runtime integrations, see @cascode/native in editors/node:
- Package docs:
editors/node/README.md - Runtime package:
editors/node/package.json - Platform package templates:
editors/node/platform-packages/
Maintainers: native npm package versions are release-tag aligned and validated in .github/workflows/release.yml.
- See
CONTRIBUTING.mdfor coding standards, style, and the language conformance suite. - Library authors: add minimal, runnable examples with each new circuit or interface.
BSD-3-Clause