code wiki / _hdl_build / nx_alu_op_kind.nx

nx_alu_op_kind.nx

buildroot/runtime/_hdl_build/nx_alu_op_kind.nx

3142 B55 linesdepth 5pulls 6 transitivereach 10 importersview sourcekind librarytopic alu
docsdependenciesstructsconstsfunctions

about

nx_alu_op_kind.nx -- SINGLE SOURCE of the ALU op -> .nxgate cell-kind map. SIL-3 closure (the Verifier organ's load-bearing seam). The divergence- causing decision -- which gate kind each RV64IM ALU op lowers to, INCLUDING the DIV/REM-as-ADD seed stub -- lives HERE, in one place, so that BOTH: (a) the shipping text emitter synth_emit_alu_gates.nx, and (b) the in-memory netlist the gate-sim verifies nx_alu_netlist_build.nx derive from it. ONE SOURCE => nx_gsim_run provably verifies the emitter's ACTUAL op->kind decisions, not a hand-kept copy (the old two-sources gap that nx_alu_netlist_test.nx had to re-encode by hand). V1: every op lowers to ONE combinational cell (the seed emitter's shape). When a real divider sub-network lands (nx_alu_divider*.nx, already proven), this generalises to a sub-network emitter and the SAME verifier flips DIV from DIVERGE to MATCH -- the invention loop's first hardware capability. Returns 0 - 1 for INVALID / out-of-range (caller emits nothing).

dependencies 2 imports · 3 importers

nishi_synth_gates.nx rv64im_min_alu.nx nx_alu_op_kind.nx nx_alu_netlist_build.nx nx_alu_select.nx synth_emit_alu_gates.nx

imports: nishi_synth_gates.nxrv64im_min_alu.nx

imported by: nx_alu_netlist_build.nxnx_alu_select.nxsynth_emit_alu_gates.nx

structs

none

consts

none

functions

22func nx_alu_op_to_gate_kind(op: i64) -> i64