Skip to content

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 (rustc and cargo, edition 2024)
  • Z3 development library (libz3-dev) and libclang (libclang-dev)

On Ubuntu / Debian:

bash
sudo apt-get update
sudo apt-get install libz3-dev libclang-dev

Optional 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 ​

bash
git clone https://github.com/nklayman/neo
cd neo
cargo build --release --bin neo

The compiled binary is located at target/release/neo. You can install it into your Cargo binary path with:

bash
cargo install --path crates/neo-cli

Verify the installation:

bash
neo --help

CLI 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:

bash
neo check [path] [--root <dir>] [--color auto|always|never]
  • path: A .neo source file, a neo.toml manifest, 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:

bash
neo build [path] [--root <dir>] [--format sv|firrtl|ir|rohd-stub] [--out <path>] [--color auto|always|never]
--format valueDefault extensionDescription
sv (default).svHuman-readable, synthesizable IEEE 1800-2012/2017 SystemVerilog
firrtl.firFIRRTL 3.3.0 circuit output suitable for CIRCT (firtool)
ir.neo.ir.jsonVersioned post-monomorphization Concrete HW-IR in JSON format
rohd-stub.rohd.dartDart 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 to stdout.

Examples:

bash
# 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.dart

neo lsp ​

Starts the Neo Language Server Protocol (LSP) server over stdio (JSON-RPC 2.0):

bash
neo lsp

The VS Code extension launches neo lsp automatically and provides:

  • Live diagnostics as you type, including relatedInformation pointing to previous declarations, where invariants, 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)