code wiki / _hdl_build / nx_div_pick.nx
nx_div_pick.nx
buildroot/runtime/_hdl_build/nx_div_pick.nx
about
nx_div_pick.nx -- the HARDWARE-ADAPTIVE divider picker: the Nishi Seed's
"grow to meet the hardware's capabilities optimally" mechanism, concretely.
For a target described by (width W, multiplier model use_wide_mul), it BUILDS
each candidate divider gate-net (radix-2, radix-4, Newton/Goldschmidt),
MEASURES each one's HONEST critical-path latency with the real gate-delay cost
model (nx_lat_honest: AND=1, ADD=log2 W, MUL=2*log2 W), and RETURNS the kind
with the minimum -- the optimal divider FOR THAT HARDWARE. This is pure
search + cost model (no LLM): the Fitness leg ranking Generator variants, the
same loop a deployed Seed runs to auto-tune its stack to the silicon it lands
on (a chip with a fast wide multiplier picks Goldschmidt; a minimal one picks a
radix divider). Reuses the proven dividers + the proven honest latency metric.
license_tier: ORIGINAL
dependencies 3 imports · 1 importers
imports: nx_newton_struct.nxnx_alu_divider_r4.nxnx_latency_metric.nx
imported by: nx_div_pick_test.nx
structs
| none |
consts
| 18 | const NXDP_MAGIC_4096: i64 = 4096 |
| 20 | const NXDP_R2: i64 = 0 |
| 21 | const NXDP_R4: i64 = 1 |
| 22 | const NXDP_NEWTON: i64 = 2 |
functions
| 25 | func nxdp_gsim(ninputs: i64) -> *NxGsim called by 1: nx_div_pick |
| 38 | func nxdp_newton_iters(W: i64) -> i64 |
| 43 | func nx_div_pick(W: i64, use_wide_mul: i64, depth: *i64) -> i64 called by 1: main calls 6: nxdp_newton_itersnxdp_gsimnx_div_synthnx_lat_honestnx_div_synth_r4nx_newton_struct |