jvm.chisel
A thin, direct mapping of Chisel primitives into Clojure.
Every public function/macro maps straight onto the corresponding Chisel primitive and Chisel performs the elaboration; there is no intermediate hardware representation. The only non-trivial machinery (implicits, symbolic JVM method names, module constructor scope, emission) lives in jvm.chisel.internal.
Clojure function -> corresponding Chisel primitive -> Chisel elaboration
Example: see src-lang/chisel/examples/predicate_eq.clj.
bundle
(bundle elts)Bundle (Record) from an ordered map/seq of name Data pairs. Read fields with field.
emit-system-verilog
(emit-system-verilog mod)(emit-system-verilog mod chisel-args firtool-opts)Elaborate and emit SystemVerilog. Requires a version-matched firtool (CIRCT); Chisel bundles a resolver that fetches one if absent.
io
(io t)Top-level module IO. When called inside module, registers itself as the module’s IO (named “io”) so Chisel can discover and name the ports.
module
(module opts body-fn)Define a Chisel module. opts carries :name (and :raw? for an explicit clock/reset RawModule). body-fn is a no-arg fn that builds io/wiring. Returns the module instance (pass to emit-system-verilog).
module-instance
(module-instance build-thunk)Instantiate a module, i.e. Module(new Child(…)). build-thunk returns the module (e.g. (fn [](module …))).
vec-as-uint
(vec-as-uint coll)pack a seq of Bool/Bits into a UInt (VecInit(…).asUInt), lsb first
vec-init
(vec-init coll)build a chisel Vec from a seq of Data (VecInit), dynamically indexable
when
macro
(when condition & body)Chisel when conditional construction. Body runs in the when context.
when-else
macro
(when-else condition then else)Chisel when/otherwise. Single-form then and else bodies.