Installation & CLI
Neo is distributed as a single Rust binary (neo) that provides checking, multi-format compilation, and an integrated LSP server.
Prerequisites
To build neo from source you need:
- Rust toolchain (
rustcandcargo, edition 2024) - Z3 development library (
libz3-dev) and libclang (libclang-dev)
On Ubuntu / Debian:
sudo apt-get update
sudo apt-get install libz3-dev libclang-devOptional Hardware Tooling
To simulate or lower Neo's generated outputs, you may optionally install:
- Verilator or Icarus Verilog (
iverilog) for linting and simulating generated SystemVerilog (--format sv) - CIRCT (
firtool) for lowering generated FIRRTL 3.3.0 (--format firrtl)
Building from Source
git clone https://github.com/nklayman/neo
cd neo
cargo build --release --bin neoThe compiled binary is located at target/release/neo. You can install it into your Cargo binary path with:
cargo install --path crates/neo-cliVerify the installation:
neo --helpCLI Commands
neo check
Parse, resolve imports, and run full symbolic Z3 verification (types, bit widths, array/slice bounds, timing, clock domains, assignability, and exhaustiveness) without generating hardware output:
neo check [path] [--root <dir>] [--color auto|always|never]path: A.neosource file, aneo.tomlmanifest, or a project directory (defaults to.).--root <dir>: Overrides the source root directory used to resolve root-relative imports.
neo build
Run full symbolic checking, monomorphizing elaboration into Concrete HW-IR, IR verification, and code generation:
neo build [path] [--root <dir>] [--format sv|firrtl|ir|rohd-stub] [--out <path>] [--color auto|always|never]--format value | Default extension | Description |
|---|---|---|
sv (default) | .sv | Human-readable, synthesizable IEEE 1800-2012/2017 SystemVerilog |
firrtl | .fir | FIRRTL 3.3.0 circuit output suitable for CIRCT (firtool) |
ir | .neo.ir.json | Versioned post-monomorphization Concrete HW-IR in JSON format |
rohd-stub | .rohd.dart | Dart ROHD ExternalSystemVerilogModule wrapper stubs for @top modules |
--out <path>: Writes output to a file, or into an existing directory (naming the file after the top module). When omitted, output is written tostdout.
Examples:
# Check a project directory containing neo.toml
neo check
# Emit SystemVerilog to stdout
neo build src/main.neo --format sv
# Emit FIRRTL 3.3.0 to a file for CIRCT
neo build src/main.neo --format firrtl --out build/design.fir
# Emit Concrete HW-IR JSON
neo build src/main.neo --format ir --out build/design.neo.ir.json
# Emit Dart ROHD interop stubs
neo build src/main.neo --format rohd-stub --out build/design.rohd.dartneo lsp
Starts the Neo Language Server Protocol (LSP) server over stdio (JSON-RPC 2.0):
neo lspThe VS Code extension launches neo lsp automatically and provides:
- Live diagnostics as you type, including
relatedInformationpointing to previous declarations,whereinvariants, or conflicting definitions - Hover information for types, timings, and declarations
- Go to definition (
textDocument/definition) - Find all references (
textDocument/references) - Document outline (
textDocument/documentSymbol) - Context-aware completions (
textDocument/completion)
Compilation Pipeline
Every neo build runs through a staged pipeline:
.neo sources (+ neo.toml)
│
▼
1. Unified Symbolic Z3 Frontend (neo-syntax + neo-workspace + neo-check)
│ Checks types, widths, bounds, timing, CDC, assignability, exhaustiveness
▼
2. Monomorphizing Elaborator (neo-elab)
│ Evaluates compile-time parameters and specializes each module instantiation
▼
3. Versioned Concrete HW-IR (neo-ir) ──▶ --format ir
│ Flat, verified concrete hardware graph
▼
4. Target Backends (neo-sv / neo-firrtl)
├──▶ SystemVerilog (--format sv)
├──▶ FIRRTL 3.3.0 (--format firrtl)
└──▶ ROHD Stubs (--format rohd-stub)