code wiki / _hdl_build / nx_pattern_emit_fabricnetlist.nx

nx_pattern_emit_fabricnetlist.nx

buildroot/runtime/_hdl_build/nx_pattern_emit_fabricnetlist.nx

3932 B54 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic pattern
docsdependenciesstructsconstsfunctions

about

nx_pattern_emit_fabricnetlist.nx -- PATTERN EMITTER: FABRIC_NETLIST (shape 25, the LAST of the session's backlog). Authors a gate-level FABRIC BUILDER core: emits a W-bit per-bit LUT4 fabric (W cells, each a baked LUT over a_i,b_i) in the nx_fpga_fabric bitstream layout (inits + 4 src nets + po). This is the foundational fabric shape (cells+nets); the authored fabric runs on the team-owned fab_eval. Completes the 5-emitter autonomy backlog. TEAM-AUTHORABLE hands-off (author=emitter, no Claude logic). spec[0]=W (1..32 lanes) spec[1]=lut (the per-bit 16-bit LUT4 truth table) Authored fn: <name>_build(inits: *i64, src: *i64, po: *i64) -> i64 (fills the fabric; returns npi=2*W) EMIT-TIME RAILS: W outside 1..32 -> REFUSED, nothing written. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_pattern_emit_fabricnetlist. nx_pattern_emit_fabricnetlist_demo

imports: nx_syscalls.nx

imported by: nx_pattern_emit_fabricnetlist_demo.nx

structs

none

consts

none

functions

11func pfn_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd, s, n); return 0 }
called by 1: pe_fn_emit_core calls 1: sys_write
12func pfn_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m; sys_write(fd,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(fd,bb,k); return 0 }
called by 1: pe_fn_emit_core calls 2: sys_mmapsys_write
14func pfn_spec_ok(spec: *i64) -> i64
called by 1: pe_fn_author
21func pe_fn_emit_core(fd: i64, name: *u8, spec: *i64) -> i64
called by 1: pe_fn_author calls 2: pfn_wpfn_wn
33func pe_fn_emit_test(fd: i64, name: *u8, spec: *i64) -> i64
47func pe_fn_author(name: *u8, modpath: *u8, testpath: *u8, spec: *i64) -> i64