code wiki / _hdl_build / nx_nrtl.nx

nx_nrtl.nx

buildroot/runtime/_hdl_build/nx_nrtl.nx

5464 B108 linesdepth 5pulls 7 transitivereach 5 importersview sourcekind librarytopic nrtl
docsdependenciesstructsconstsfunctions

about

nx_nrtl.nx -- LIB: NHDL H3+H4 -- sovereign RTL + SYNTHESIS (the Yosys competitor). H1/H2 gave a netlist format + hierarchy that you EMIT from a fabric; this is the layer you AUTHOR in: a tiny RTL where you write bus-level equations, and a SYNTHESIZER that LOWERS them to the LUT4 fabric -- reusing the proven fabric builders (ripple adder, per-bit logic LUTs) + fab_append (R32a) to compose. Author 3 lines of RTL -> a 32-gate netlist, sovereignly. NRTL GRAMMAR (v1): single-char bus names (a,b,t,u,y...), 3-address combinational statements. .nrtl 1 .module <name> <W> # bus width W .in a b # input buses (each W bits; assigned PI nets in order) .out y # the output bus t = a & b # one binary op per statement: & (AND) | (OR) ^ (XOR) + (ADD), bit-parallel @ W u = a ^ b y = t + u .end SYNTHESIS: each statement -> build the op's fabric sub-network (logic LUTs or the ripple adder), fab_append it wiring its inputs to the operand buses' nets; the result bus = the appended outputs. The output bus -> the POs. NEVER-BRICK (#26): pure memory, bounded, deterministic, zero hardware-state writes. license_tier: ORIGINAL

dependencies 6 imports · 5 importers

nx_nhdl.nx nx_fpga_compose.nx nx_fpga_adder.nx nx_fpga_lut.nx nx_fpga_fabric.nx nx_syscalls.nx nx_nrtl.nx nx_nbit_gate.nx nx_nhdl_perf_gate.nx nx_nhdl_scorecard_gate.nx nx_nrtl_gate.nx nx_nrtl_opt_gate.nx

imports: nx_nhdl.nxnx_fpga_compose.nxnx_fpga_adder.nxnx_fpga_lut.nxnx_fpga_fabric.nxnx_syscalls.nx

imported by: nx_nbit_gate.nxnx_nhdl_perf_gate.nxnx_nhdl_scorecard_gate.nxnx_nrtl_gate.nxnx_nrtl_opt_gate.nx

structs

none

consts

none

functions

26func nr_rdc(buf: *u8, pp: *i64, len: i64) -> i64 { let p: i64=nh_skip_ws(buf,pp[0],len); let c: i64=buf[p] as i64; pp[0]=p+1; return c }
called by 1: nrtl_synth calls 1: nh_skip_ws
29func build_bitop(W: i64, flk: i64, init: *i64, src: *i64, po: *i64) -> i64
called by 1: nrtl_synth calls 1: fl_gate_to_lut4
38func nrtl_synth(buf: *u8, len: i64, cinit: *i64, csrc: *i64, ckind: *i64, cpo: *i64, outnpi: *i64, outnpo: *i64, outW: *i64) -> i64