Skip to main content
Every error thrown by the library extends WiresError, which extends Error.

CircuitError

A structural problem with a definition. The message is prefixed with the circuit name, and relative paths are used for anything inside it.
string | undefined
The name of the circuit or primitive involved, when known.
Thrown for:
  • invalid names, duplicate port names, duplicate or reserved instance names
  • a connection in the wrong direction, a port that doesn’t exist, or a port of a foreign instance
  • multiple drivers for one sink
  • unconnected child inputs and undriven outputs, all reported together
  • adding a component that isn’t defined yet (add() received undefined)
  • wire loops with no driving gate, found during elaboration
  • builders that are asynchronous, or used after they finish

SimulationError

A runtime problem:
  • set() with an unknown input or an invalid signal value
  • read() with an unknown output
  • invalid simulate() options
  • a primitive evaluator that throws (the original error is kept as cause), returns a non-object, omits an output, returns an unexpected output, or returns an invalid signal

StabilizationError

Thrown by run() when the circuit hasn’t stabilized after maxTicks ticks in one call.
number
The simulation time when the run stopped.
number
The ticks executed by the failing run() call.
number
The configured limit.
readonly SignalTransition[]
Up to the 16 most recent transitions, oldest first. Recorded even when tracing is off.
readonly string[]
The sorted paths of the primitive gates driving those signals.
For the ring oscillator from Sequential logic, with maxTicks: 100:
States are never modified, so after any error the state you called the method on is still valid. Change its inputs so the circuit can settle, or go back to an earlier state.

Handling errors