code wiki / _hdl_build / nx_pattern_emit5_demo.nx

nx_pattern_emit5_demo.nx source

↩ module page · 32 lines · 1619 B

1// nx_pattern_emit5_demo.nx -- the TEAM authoring GEOMETRY + PID_LOOP cores (no Claude logic). 2// _pe_mask = mask geometry at the REAL DIY-silicon design rules (5um=5000nm min feature -- the 3// Zeloof/HackerFab floor -- 10um min spacing). _pe_heat = heater PI loop, gains pre-flighted against 4// the plant sim. ALSO proves the refusal rail: dead gains (kp=0 ki=0) must be REFUSED, not authored. 5import "nx_pattern_emit5.nx" 6import "nx_syscalls.nx" 7const K_MAGIC_5000: i64 = 5000 8const K_MAGIC_10000: i64 = 10000 9const K_MAGIC_2000: i64 = 2000 10 11func p5_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 12 13func main() -> i64 { 14 let a: i64 = pe5_author_geometry("_pe_mask" as *u8, 15 "runtime/_hdl_build/_pe_mask.nx" as *u8, 16 "runtime/_hdl_build/_pe_mask_test.nx" as *u8, 17 K_MAGIC_5000, K_MAGIC_10000) 18 let b: i64 = pe5_author_pid("_pe_heat" as *u8, 19 "runtime/_hdl_build/_pe_heat.nx" as *u8, 20 "runtime/_hdl_build/_pe_heat_test.nx" as *u8, 21 K_MAGIC_2000, 20, K_MAGIC_10000) 22 // the oracle must REFUSE gains that cannot drive the plant (kp=0 ki=0 -> x stays 0) 23 let r: i64 = pe5_author_pid("_pe_dead" as *u8, 24 "/tmp/_pe_dead.nx" as *u8, "/tmp/_pe_dead_test.nx" as *u8, 25 0, 0, K_MAGIC_10000) 26 if a == 1 { if b == 1 { if r == 0 { 27 p5_w("TEAM AUTHORED CORES: _pe_mask (geometry 5000/10000nm rules) + _pe_heat (PI 2000/20, sim-converged) + dead-gains REFUSED -- verify with Engineer\n" as *u8) 28 sys_exit(0) 29 } } } 30 p5_w("author failed (or refusal rail broken)\n" as *u8); sys_exit(1) 31 return 1 32}