code wiki / _hdl_build / synth_emit_alu_gates_smoke.nx

synth_emit_alu_gates_smoke.nx

buildroot/runtime/_hdl_build/synth_emit_alu_gates_smoke.nx

5197 B109 linesdepth 11pulls 13 transitivereach 0 importersview sourcekind smoketopic synth
docsdependenciesstructsconstsfunctions

about

synth_emit_alu_gates_smoke.nx -- structural smoke for the ALU .nxgate emitter. ROOT-CAUSE FIX (2026-06-20): synth_emit_alu_gates.nx is a LIBRARY (no main); building it standalone fails "UNDEFINED label: main" -- that was a build-as-executable mistake, NOT an nxasm regression. A library organ is verified by its SMOKE GATE (with main), exactly like synth_emit_regfile_gates_smoke.nx. This is that missing tool: it builds the rv64im_min ALU HDL module, runs nx_emit_alu_gates into a sink, prints the netlist, then asserts the structural invariants the emitter MUST satisfy -- well-formed (.NXGATE/.MODULE/.END), complete (4 ports, ~4125 cells, divider-backed), and ON-ENUM (UNKNOWN x 0 = no cell emitted an out-of-enum kind). .PORT x 4 (op_in, a_in, b_in, result) .CELL ~4125 (divider-backed: full restoring divider for DIV/DIVU/REM/REMU + 29-op cascade) .CONST ~498 (opcode + divider/widening constants) .NET ~4623 (width-complete: every cell drives a declared net; cells <= nets) UNKNOWN x 0 (the correctness invariant: no out-of-enum cell kind) NOTE: output is ~270KB -> the sink buffer must be MB-scale (an earlier 262KB buf silently dropped all cells because nx_synth_emit_bytes is all-or-nothing). Exact cell count tracks the emitter; the gate floors at >100 + checks ports/end/unknown/width-completeness. Exit 0 = green. CORRECTNESS gate. Mirrors the proven regfile smoke (same import set, dedup-safe). 100% sovereign. license_tier: ORIGINAL expect_exit: 0

dependencies 6 imports · 0 importers

nx_syscalls.nx nishi_hdl_primitives.nx nishi_synth.nx nishi_synth_gates.nx rv64im_min_alu.nx synth_emit_alu_gates.nx synth_emit_alu_gates_smoke.nx

imports: nx_syscalls.nxnishi_hdl_primitives.nxnishi_synth.nxnishi_synth_gates.nxrv64im_min_alu.nxsynth_emit_alu_gates.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nx_hdl_module_init nx_rv64im_alu_build nx_hdl_input nx_hdl_signal_alloc nx_hdl_kind_is_valid nx_hdl_width_is_valid nx_hdl_output nx_hdl_signal_alloc ↻ nx_synth_sink_init nx_emit_alu_gates nx_gate_emit_header nx_synth_emit_str nx_synth_emit_bytes sys_mmap ↻ nx_synth_sink_init ↻ nx_sink_init_text nx_alu_build_select nx_sink_const nx_hdl_wire nx_hdl_signal_alloc ↻ nx_div_synth_sink nx_sink_const ↻ nx_sink_cell nx_hdl_wire ↻ sys_mmap ↻ nx_alu_mulh_sink nx_mul_wide_sink nx_sink_const ↻ nx_sink_cell ↻ nx_sink_const ↻ nx_sink_cell ↻ nx_wdiv_u_sink nx_sink_const ↻ nx_sink_cell ↻ nx_div_synth_sink ↻ nx_sext32_sink nx_sink_const ↻ nx_sink_cell ↻

structs

none

consts

none

functions

27func nx_alusmoke_slen(p: *u8) -> i64
32func nx_alusmoke_puts(p: *u8) -> i64
called by 1: main calls 2: sys_writenx_alusmoke_slen
35func nx_alusmoke_putn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
47func nx_alusmoke_count(buf: *u8, used: i64, needle: *u8) -> i64
called by 1: main calls 1: nx_alusmoke_slen
65func main() -> i64