code wiki / _hdl_build / nx_nbit.nx

nx_nbit.nx

buildroot/runtime/_hdl_build/nx_nbit.nx

3999 B67 linesdepth 3pulls 4 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_nbit.nx -- LIB: NHDL H5 -- sovereign PLACE-and-ROUTE + BITSTREAM for the VIRTUAL FPGA (the nextpnr/prjtrellis competitor). H4 synthesizes a logical netlist (cells + nets); this is the BACK-END that maps it onto a PHYSICAL 2-D grid of LUT tiles (PLACEMENT) with inputs addressed by grid coordinate (ROUTING), serializes a sovereign BITSTREAM (our own, like prjtrellis is for ECP5), and the VIRTUAL FPGA loads + evaluates it. The placement is a real permutation (column-major), so correctness proves routing follows arbitrary placement -- not a relabel. "Simulate the chip+board BEFORE buying": the whole RTL->synth->P&R->bitstream->virtual-board chain runs in-sim. NEVER-BRICK (#26): pure memory, bounded, deterministic, zero hardware-state writes. license_tier: ORIGINAL HONEST scope: 1 LUT/tile, full routability assumed (every tile reachable). The CONSTRAINED-routing optimization (limited channels + simulated annealing -- nextpnr's hard part) is the depth rung; this proves the P&R DATA FLOW (place -> route -> bitstream -> virtual eval == netlist) sovereignly + correctness-preservingly.

dependencies 3 imports · 3 importers

nx_nhdl.nx nx_fpga_lut.nx nx_syscalls.nx nx_nbit.nx nx_nbit_gate.nx nx_nhdl_perf_gate.nx nx_nhdl_scorecard_gate.nx

imports: nx_nhdl.nxnx_fpga_lut.nxnx_syscalls.nx

imported by: nx_nbit_gate.nxnx_nhdl_perf_gate.nxnx_nhdl_scorecard_gate.nx

structs

none

consts

none

functions

17func nbit_place(ncells: i64, R: i64, C: i64, tile_of: *i64) -> i64
called by 3: mainrun_flowmain
24func nbit_resolve(s: i64, npi: i64, pi: *i64, tile_of: *i64, tileval: *i64) -> i64
called by 1: nbit_eval
30func nbit_eval(ncells: i64, npi: i64, npo: i64, tile_of: *i64, init: *i64, src: *i64, po: *i64, pi: *i64, tileval: *i64, out: *i64) -> i64
called by 2: vfpga_runmain calls 2: nbit_resolvelut4_eval
46func nbit_wsrc(buf: *u8, o: i64, s: i64, npi: i64, tile_of: *i64) -> i64
called by 1: nbit_emit calls 2: nh_wsnh_wi
54func nbit_emit(buf: *u8, R: i64, C: i64, npi: i64, npo: i64, ncells: i64, tile_of: *i64, init: *i64, src: *i64, po: *i64) -> i64
called by 2: mainrun_flow calls 3: nh_wsnh_winbit_wsrc