code wiki / _hdl_build / nx_mask_geom.nx

nx_mask_geom.nx

buildroot/runtime/_hdl_build/nx_mask_geom.nx

5635 B119 linesdepth 4pulls 4 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_mask_geom.nx -- Arc D2: GDSII-class MASK GEOMETRY + DESIGN-RULE CHECK (the chip-fab equivalent of STL->G-code for the printer). The assignment generator queued this from the chip-fab research; this is the team building what it assigned itself. A mask is a set of rectangular FEATURES on a layer, in NANOMETER coordinates (nx_micron_geom). The S-class gate is DRC -- the design-rule check every real chip layout must pass before a fab will run it: * MIN WIDTH -- no feature thinner than the process can resolve (the critical dimension, CD) * MIN SPACING-- no two features closer than the process can separate (or they short together) * NO OVERLAP -- features on the same layer must not illegally intersect The CD ties straight to the CPU goal via nx_metrology: a layout is MAKEABLE only if the machine's resolution <= the layout's critical dimension (SUBMICRON makes transistors; FDM cannot). HONEST SCOPE: rectangles only (Manhattan); arbitrary polygons + the GDSII BINARY record emit are the flagged next rungs -- the geometry + DRC math here is exact. Rects stored as parallel i64 arrays x[],y[],w[],h[] (nm). LAWS: struct-free, integer-only. license_tier: ORIGINAL

dependencies 3 imports · 2 importers

nx_micron_geom.nx nx_metrology.nx nx_syscalls.nx nx_mask_geom.nx nx_litho_stepper.nx nx_mask_geom_test.nx

imports: nx_micron_geom.nxnx_metrology.nxnx_syscalls.nx

imported by: nx_litho_stepper.nxnx_mask_geom_test.nx

structs

none

consts

18const MK_DRC_OK: i64 = 0
19const MK_DRC_THIN: i64 = 1 // a feature narrower than min width
20const MK_DRC_CLOSE: i64 = 2 // two features closer than min spacing
21const MK_DRC_OVERLAP: i64 = 3 // illegal overlap on the same layer

functions

23func mk_max2(a: i64, b: i64) -> i64 { if a > b { return a } return b }
24func mk_min2(a: i64, b: i64) -> i64 { if a < b { return a } return b }
called by 2: mk_gap_xmk_gap_y
26func mk_right(x: i64, w: i64) -> i64 { return x + w }
called by 2: mk_gap_xmk_bbox
27func mk_top(y: i64, h: i64) -> i64 { return y + h }
called by 2: mk_gap_ymk_bbox
30func mk_area(w: i64, h: i64) -> i64 { return w * h }
called by 1: main
33func mk_critical_dimension(w: *i64, h: *i64, n: i64) -> i64
called by 2: mk_makeablemain
47func mk_makeable(w: *i64, h: *i64, n: i64, resolution_nm: i64) -> i64
53func mk_gap_x(x1: i64, w1: i64, x2: i64, w2: i64) -> i64
56func mk_gap_y(y1: i64, h1: i64, y2: i64, h2: i64) -> i64
61func mk_overlap(x1: i64, y1: i64, w1: i64, h1: i64, x2: i64, y2: i64, w2: i64, h2: i64) -> i64
called by 2: mk_drcmain calls 2: mk_gap_xmk_gap_y
67func mk_spacing(x1: i64, y1: i64, w1: i64, h1: i64, x2: i64, y2: i64, w2: i64, h2: i64) -> i64
called by 2: mk_drcmain calls 3: mk_gap_xmk_gap_ymk_max2
77func mk_drc(x: *i64, y: *i64, w: *i64, h: *i64, n: i64, min_width: i64, min_spacing: i64, out: *i64) -> i64
called by 1: main calls 2: mk_overlapmk_spacing
105func mk_bbox(x: *i64, y: *i64, w: *i64, h: *i64, n: i64, out: *i64) -> i64
called by 1: main calls 2: mk_rightmk_top