code wiki / _hdl_build / synth_emit_alu.nx

synth_emit_alu.nx

buildroot/runtime/_hdl_build/synth_emit_alu.nx

9060 B167 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind orphan librarytopic synth
docsdependenciesstructsconstsfunctions

about

synth_emit_alu.nx -- per-module Verilog logic emitter for the ALU. First per-RTL-module logic emitter -- demonstrates the pattern the remaining 5 (decoder, regfile, csr, clint, uart) will follow. Reads the declared NxRv64imAluPorts handles (op_in, a_in, b_in, result) + emits a combinational `always_comb` block with a case statement over the 29 NX_RV64IM_ALU_* op codes. Plugged into the nishi_synth skeleton between the BEGIN/END logic-injection markers. Status: SEED. 2026-05-26. Pattern reference for the remaining 5 module emitters per hdl/HACKING.md "Adding a per-module logic emitter" recipe.

dependencies 4 imports · 0 importers

nx_syscalls.nx nishi_hdl_primitives.nx nishi_synth.nx rv64im_min_alu.nx synth_emit_alu.nx

imports: nx_syscalls.nxnishi_hdl_primitives.nxnishi_synth.nxrv64im_min_alu.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

21func nx_synth_emit_hex64(s: *NxSynthSink, value: i64) -> i64
38func nx_synth_emit_op_case_line(s: *NxSynthSink, op_kind: i64, expr: *u8) -> i64
60func nx_synth_emit_logic_alu(s: *NxSynthSink) -> i64
135func nx_synth_module_to_verilog_alu(m: *NxHdlModule, s: *NxSynthSink) -> i64