Skip to content

Neo

A modern HDL for building hardware you can trust

Neo checks pipeline timing, clock domains, and register resets as you write, and uses symbolic validation to check parameterized modules for every valid parameter value. Validated designs compile to readable SystemVerilog or FIRRTL for the tools you already use.

module Multiply(t: Timing) {
  input a(t): Int(32),
  input b(t): Int(32),
  input user(t): Bits(4),
  output result(t + 2): Int(32),
  output result_user(t + 2): Bits(4),
} {
  assign result = Reg(a * b, cycles: 2);
  assign result_user = Reg(user, cycles: 2);
}

error[timing_mismatch]

Expected timing `t + 2`, but got `t + 1`.

You added a pipeline stage to the multiplier, but not to the user ID. It passes tests that send one request at a time. Under back-to-back traffic, every user gets someone else's result.

Try Neo in Your Browser

Explore examples and inspect generated SystemVerilog, FIRRTL, or HW-IR side by side. Enable the live compiler & LSP to edit code with real-time validation, hover types, and autocomplete.

Minimal combinational 32-bit adder module with cycle-accurate timing.
main.neo Neo HDL
Loading editor…
Pre-compiled
Loading output…

Bugs Neo catches before you simulate ​

State machine coverage, handshakes, and clock domains usually live in comments and conventions. Neo makes them part of the language. Every error below is real compiler output.

A state with no way out ​

When a job fails it moves to Error, but no arm handles Error, so one failure would hang the state machine until reset. A case must cover every state, so Neo names the one that's missing.

neo
enum State {
  Idle = 0,
  Busy = 1,
  Done = 2,
  Error = 3,
}

module Job(clk: Clock) {
  input start(Dynamic(clk)): Bits(1),
  input fail(Dynamic(clk)): Bits(1),
  output reg state(Dynamic(clk)): State = .Idle,
} {
  seq clk {
    case state {
      .Idle => { if start { state = .Busy; }; },
      .Busy => { state = if fail { .Error } else { .Done }; },
      .Done => { state = .Idle; },
    };
  }
}
text
error[non_exhaustive_case]: Non-exhaustive `case` on enum `State`: missing variant(s) Error.
  --> main.neo:14:5
   |
14 |     case state {
   |     ^^^^^^^^^^^^

A forgotten handshake signal ​

When a has data, this arbiter never drives b.ready, so b can't tell whether its request was accepted. Every branch of a comb block must drive the same signals, so Neo catches it.

neo
module Arbiter(T: LogicType, clk: Clock) {
  consumes a: Decoupled(T, clk),
  consumes b: Decoupled(T, clk),
  provides out: Decoupled(T, clk),
} {
  comb {
    match a.req {
      Valid(x) => {
        out.req = .Valid(x);
        a.ready = out.ready;
      },
      Invalid => {
        out.req = b.req;
        a.ready = 0;
        b.ready = out.ready;
      },
    }
  }
}
text
error[inconsistent_conditional_assignments]: All branches of a conditional inside `comb` must assign the exact same set of signals.
  --> main.neo:12:18
   |
12 |       Invalid => {
   |                  ^

An accidental clock-domain crossing ​

a runs on t.clock and b runs on slow, so wiring a's output straight into b crosses clock domains without a synchronizer, and the value can go metastable. Neo tracks which clock drives every instance and rejects the connection.

neo
module Stage(t: Timing) {
  input x(t): Bits(8),
  output y(t + 1): Bits(8),
} {
  assign y = Reg(x);
}

module Bridge(t: Timing, slow: Clock) {
  input x(t): Bits(8),
} {
  mod a = Stage(t);
  mod b = Stage(Timing(slow));
  assign a.x = x;
  assign b.x = a.y;
}
text
error[clock_domain_mismatch]: Clock domain mismatch: target expects clock domain `slow`, but source is in clock domain `t.clock`.
  --> main.neo:14:16
   |
14 |   assign b.x = a.y;
   |                ^^^

Learn more ​

Guide

Install Neo and learn the language one feature at a time.

Comparison with other HDLs

How Neo relates to SystemVerilog, Chisel, ROHD, and Filament.

Language reference

Exact rules, bit layouts, and the complete list of checks.