code wiki / _hdl_build / nx_pattern_emit_fabricnetlist_demo.nx
nx_pattern_emit_fabricnetlist_demo.nx
buildroot/runtime/_hdl_build/nx_pattern_emit_fabricnetlist_demo.nx
about
nx_pattern_emit_fabricnetlist_demo.nx -- DEMO/GATE: the Builder runs the FABRIC_NETLIST emitter on a spec and it
AUTHORS a working W-bit LUT4 fabric builder (shape 25, no Claude logic). Spec: W=4, lut=32768 (AND at index 15).
T1 author succeeds for a valid spec (W=4) and REFUSES a bad spec (W=0).
T2 the AUTHORED module is real fabric code: contains _build + the baked lut '32768' + 'po[i]=npi+i'.
T3 determinism: re-authoring -> byte-identical module.
(Building fn_authored_test via the runner then proves the AUTHORED fabric COMPILES, runs on fab_eval, + PASSES.)
expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_pattern_emit_fabricnetlist.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 10 | const K_MAGIC_65536: i64 = 65536 |
| 11 | const K_MAGIC_16384: i64 = 16384 |
| 12 | const K_MAGIC_32768: i64 = 32768 |
functions
| 14 | func dw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func dn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} 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{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 16 | func read_all(path: *u8, lenbox: *i64) -> i64 |
| 22 | func has_sub(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64 called by 1: main |
| 28 | func main() -> i64 |