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)

structs

none

consts

none

functions

27func nx_alusmoke_slen(p: *u8) -> i64
32func nx_alusmoke_puts(p: *u8) -> i64
35func nx_alusmoke_putn(v: i64) -> i64
47func nx_alusmoke_count(buf: *u8, used: i64, needle: *u8) -> i64
65func main() -> i64