Skip to content

Neo
A modern HDL for building hardware you can trust

Neo checks every parameter value, pipeline stage, and clock domain at compile time, then emits clean SystemVerilog.

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 verification, 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 ​

Parameterized hardware hides bugs that only some configurations trigger, and pipeline timing usually lives in comments. Neo makes both part of the language. Every error below is real compiler output.

A configuration nobody tested ​

len is a UInt, so it can be 0, and then len - 1 underflows. Neo reports this in the module itself, even if every current instance uses a nonzero length. Declaring len: Pos fixes it.

neo
module Last(T: LogicType, len: UInt, t: Timing) {
  input data(t): Array(T, len),
  output last(t): T,
} {
  assign last = data[len - 1];
}
text
error[uint_underflow]: `UInt` subtraction `len - 1` may underflow below 0.
 --> main.neo:5:22
  |
5 |   assign last = data[len - 1];
  |                      ^^^^^^^
  = note: for example, when `len = 0`

Values from different pipeline stages ​

product is registered, so it's ready one cycle after acc. Adding them would combine data from two different inputs. Neo tracks the cycle of every signal and rejects the mismatch.

neo
module MacStage(t: Timing) {
  input a(t): Int(32),
  input b(t): Int(32),
  input acc(t): Int(32),
  output out(t + 1): Int(32),
} {
  logic product(t + 1): Int(32) = Reg(a * b);
  assign out = product + acc;
}
text
error[timing_mismatch]: Incompatible timings `t + 1` and `t`.
 --> main.neo:8:16
  |
8 |   assign out = product + acc;
  |                ^^^^^^^^^^^^^

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 => {
   |                  ^

A register that powers up anywhere ​

armed decides whether a button press toggles the light, but nothing resets it, so after power-up the first press may or may not count. Neo follows every register into the decisions it controls and asks for a reset value, or an explicit noreset.

neo
module Toggle(clk: Clock) {
  input press(Dynamic(clk)): Bits(1),
  output reg light(Dynamic(clk)): Bits(1) = 0,
} {
  reg armed(Dynamic(clk)): Bits(1);
  seq clk {
    if armed && press {
      light = !light;
    };
    armed = !press;
  }
}
text
error[unreset_control_register]: `armed` controls the `if` condition on line 7, but has no reset value.
 --> main.neo:5:3
  |
5 |   reg armed(Dynamic(clk)): Bits(1);
  |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: give it a reset value (`= v`), or mark it `noreset` if it is always written before it is read

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 ​