code wiki / _hdl_build / nx_alu_netlist_full_test.nx

nx_alu_netlist_full_test.nx

buildroot/runtime/_hdl_build/nx_alu_netlist_full_test.nx

3656 B99 linesdepth 7pulls 9 transitivereach 0 importersview sourcekind gate/prooftopic alu
docsdependenciesstructsconstsfunctions

about

nx_alu_netlist_full_test.nx -- SIL-3 VERIFIER over the FULL 29-op ALU. Builds the ALU op-select netlist via nx_alu_netlist_build (the ONE source the text emitter also derives from), then for EVERY op K in 1..28 runs the gate-level functional sim and diffs vs the behavioral oracle nx_rv64im_alu_compute(K, a, b). This is the closure of "consume the ACTUAL emitter topology + diff vs behavioral over all 29 ops": where the seed emitter is faithful the sim MATCHES; where it stubs (DIV/REM->ADD, mulh->MUL) the sim DIVERGES -- the verifier CATCHES every silent gate-emit hole, not just DIV. That divergence set is the 5W1H feedback the Generator consumes. a=20 b=4. Known answer (FAIL LOUD): "covered=28 match=17 diverge=11" rc=0. 17 faithful: ADD SUB AND OR XOR SLL SRL SRA SLT SLTU MUL ADDW SUBW SLLW SRLW SRAW MULW (all single-cell ops the seed lowers exactly) 11 holes: MULH MULHSU MULHU (low-product MUL, want high) + DIV DIVU REM REMU DIVW DIVUW REMW REMUW (ADD stub, want divider) When a real divider sub-network replaces the DIV stub in nx_alu_op_to_gate_kind, this same gate flips DIV from DIVERGE to MATCH -- the first HW invention.

dependencies 2 imports · 0 importers

nx_alu_netlist_build.nx rv64im_min_alu.nx nx_alu_netlist_full_test.nx

imports: nx_alu_netlist_build.nxrv64im_min_alu.nx

imported by: nobody (leaf or entry point)

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

main nx_alu_netlist_build nx_alu_nl_set nx_alu_op_to_gate_kind nx_gsim_run nx_gsim_kind_supported nx_gsim_eval_cell nx_rv64im_alu_compute nx_rv64im_lshr nx_rv64im_ltu nx_rv64im_sext32 nx_rv64im_mulh_signed nx_rv64im_mulh_unsigned nx_rv64im_lshr ↻ nx_rv64im_mulh_signed_unsi nx_rv64im_mulh_unsigned ↻ nx_rv64im_mulh_unsigned ↻ nx_rv64im_udiv nx_rv64im_ltu ↻ nx_rv64im_urem nx_rv64im_udiv ↻ _emit_cstr _emit_dec

structs

none

consts

none

functions

23func _emit_cstr(s: *u8) -> i64
called by 1: main
30func _emit_dec(v: i64) -> i64
called by 1: main
44func main() -> i64