code wiki / (root) / nx_pcb_drill_gate.nx

nx_pcb_drill_gate.nx

buildroot/runtime/nx_pcb_drill_gate.nx

5891 B148 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic pcb
docsdependenciesstructsconstsfunctions

about

nx_pcb_drill_gate.nx -- R1b GATE of the Omniforge PCB/EDA leg: Excellon drill export. Builds a drill program for the demo board (2 tools, 3 holes at the pad centres), emits via nx_pcb_drill, writes the real .drl artifact, then VERIFIES by reconstructing the canonical ASCII for every tool def + hole from the integer model and asserting EXACT presence (integer round-trip, no float drift). Checks M48/FMAT,2/METRIC/M30 headers, counts hole lines, and a NEGATIVE CONTROL: a hole off by 1um must be ABSENT. Together with nx_pcb_gerber_gate this proves a COMPLETE fab package (copper + drills). 100% sovereign, integer-only. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_pcb_drill.nx nx_pcb_drill_gate.nx

imports: nx_syscalls.nxnx_pcb_drill.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap sw sys_write excellon_emit sys_mmap ↻ g_puts g_puti sys_mmap ↻ g_mm6 g_puti ↻ g_puts ↻ sn sys_write ↻ sys_mmap ↻ sys_openat_wr sys_write ↻ sys_close check sw ↻ contains slen expect_tool sys_mmap ↻ g_mm6 ↻ expect_hole sys_mmap ↻ g_mm6 ↻ count_occur slen ↻ sys_exit

structs

none

consts

none

functions

12func sw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: checkmain calls 1: sys_write
13func sn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
24func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: containscount_occur
26func contains(hay: *u8, haylen: i64, needle: *u8) -> i64
called by 1: main calls 1: slen
40func count_occur(hay: *u8, haylen: i64, needle: *u8) -> i64
called by 1: main calls 1: slen
55func expect_hole(nb: *u8, x_um: i64, y_um: i64) -> i64
called by 1: main calls 2: sys_mmapg_mm6
65func expect_tool(nb: *u8, tcode: i64, dia_um: i64) -> i64
called by 1: main calls 2: sys_mmapg_mm6
74func check(name: *u8, cond: i64, tot: *i64) -> i64
called by 1: main calls 1: sw
81func main() -> i64