code wiki / _hdl_build / nx_pattern_emit_demo.nx
nx_pattern_emit_demo.nx source
↩ module page · 20 lines · 1090 B
1// nx_pattern_emit_demo.nx -- the TEAM authoring real CORES from patterns (no Claude logic). Authors a
2// VERDICT_GATE (a temperature gate, lo=180 hi=230) and an ACCUMULATOR, both with real tests, to disk.
3// Run this, then the Engineer verifies the authored tests -> green = the Builder authored working,
4// gated capability cores autonomously. license_tier: ORIGINAL
5import "nx_pattern_emit.nx"
6import "nx_syscalls.nx"
7
8func pd_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
9
10func main() -> i64 {
11 let a: i64 = pe_author(1, "_pe_vgate" as *u8,
12 "runtime/_hdl_build/_pe_vgate.nx" as *u8,
13 "runtime/_hdl_build/_pe_vgate_test.nx" as *u8, 180, 230)
14 let b: i64 = pe_author(5, "_pe_accum" as *u8,
15 "runtime/_hdl_build/_pe_accum.nx" as *u8,
16 "runtime/_hdl_build/_pe_accum_test.nx" as *u8, 0, 0)
17 if a == 1 { if b == 1 { pd_w("TEAM AUTHORED CORES: _pe_vgate (verdict-gate) + _pe_accum (accumulator) -- verify with Engineer\n" as *u8); sys_exit(0) } }
18 pd_w("author failed\n" as *u8); sys_exit(1)
19 return 1
20}