code wiki / _hdl_build / nx_pattern_emit_netcompose.nx
nx_pattern_emit_netcompose.nx
buildroot/runtime/_hdl_build/nx_pattern_emit_netcompose.nx
about
nx_pattern_emit_netcompose.nx -- PATTERN EMITTER: NETLIST_COMPOSE (shape 24). Authors a K-way fabric FOLD core
that composes the TEAM-OWNED fab_append (nx_fpga_compose, the proven net-remapping primitive) K times -- the
netlist-composition shape (concatenate sub-fabrics with net remapping). Like RANK_FUSE wraps nx_rrf, this wraps
fab_append, so the heavy lifting (the net remap) is already a green team organ; the emitter just bakes the K-fold.
4th of the session's 5-emitter autonomy backlog. TEAM-AUTHORABLE hands-off (author=emitter, no Claude logic).
spec[0]=k (2..8 sub-fabric instances to fold)
Authored fn: <name>_compose(NPI, sub_npi, sub_nc, sub_init, sub_src, sub_kind, inmap, cinit, csrc, ckind) -> i64
appends k copies of the sub-fabric into cinit/csrc/ckind; returns the total composed cell count (k*sub_nc).
EMIT-TIME RAILS: k outside 2..8 -> REFUSED, nothing written. license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_pattern_emit_netcompose_demo.nx
structs
| none |
consts
| none |
functions
| 12 | func prc_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 } |
| 13 | func prc_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 } |
| 15 | func prc_spec_ok(spec: *i64) -> i64 called by 1: pe_nc_author |
| 22 | func pe_nc_emit_core(fd: i64, name: *u8, spec: *i64) -> i64 |
| 37 | func pe_nc_emit_test(fd: i64, name: *u8, spec: *i64) -> i64 |
| 51 | func pe_nc_author(name: *u8, modpath: *u8, testpath: *u8, spec: *i64) -> i64 |