code wiki / _hdl_build / _pe_mask_test.nx
_pe_mask_test.nx source
↩ module page · 15 lines · 604 B
1// AUTHORED BY THE NISHI BUILDER (pattern: GEOMETRY test) -- design-rule boundary KATs
2import "_pe_mask.nx"
3import "nx_syscalls.nx"
4func main() -> i64 {
5 var bad: i64 = 0
6 if _pe_mask_area(300, 400) != 120000 { bad = bad + 1 }
7 if _pe_mask_area(0 - 1, 400) + 1 != 0 { bad = bad + 1 }
8 if _pe_mask_drc(5000, 5000) != 1 { bad = bad + 1 }
9 if _pe_mask_drc(4999, 5000) != 0 { bad = bad + 1 }
10 if _pe_mask_spacing_ok(1000, 2000, 13000) != 1 { bad = bad + 1 }
11 if _pe_mask_spacing_ok(1000, 2000, 12999) != 0 { bad = bad + 1 }
12 if bad == 0 { sys_exit(0) }
13 sys_exit(1)
14 return 1
15}