code wiki / _hdl_build / nx_mask_geom.nx
nx_mask_geom.nx
buildroot/runtime/_hdl_build/nx_mask_geom.nx
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
imports: nx_micron_geom.nxnx_metrology.nxnx_syscalls.nx
imported by: nx_litho_stepper.nxnx_mask_geom_test.nx
structs
| none |
consts
| 18 | const MK_DRC_OK: i64 = 0 |
| 19 | const MK_DRC_THIN: i64 = 1 // a feature narrower than min width |
| 20 | const MK_DRC_CLOSE: i64 = 2 // two features closer than min spacing |
| 21 | const MK_DRC_OVERLAP: i64 = 3 // illegal overlap on the same layer |
functions
| 23 | func mk_max2(a: i64, b: i64) -> i64 { if a > b { return a } return b } |
| 24 | func mk_min2(a: i64, b: i64) -> i64 { if a < b { return a } return b } |
| 26 | func mk_right(x: i64, w: i64) -> i64 { return x + w } |
| 27 | func mk_top(y: i64, h: i64) -> i64 { return y + h } |
| 30 | func mk_area(w: i64, h: i64) -> i64 { return w * h } called by 1: main |
| 33 | func mk_critical_dimension(w: *i64, h: *i64, n: i64) -> i64 |
| 47 | func mk_makeable(w: *i64, h: *i64, n: i64, resolution_nm: i64) -> i64 |
| 53 | func mk_gap_x(x1: i64, w1: i64, x2: i64, w2: i64) -> i64 |
| 56 | func mk_gap_y(y1: i64, h1: i64, y2: i64, h2: i64) -> i64 |
| 61 | func mk_overlap(x1: i64, y1: i64, w1: i64, h1: i64, x2: i64, y2: i64, w2: i64, h2: i64) -> i64 |
| 67 | func mk_spacing(x1: i64, y1: i64, w1: i64, h1: i64, x2: i64, y2: i64, w2: i64, h2: i64) -> i64 |
| 77 | func mk_drc(x: *i64, y: *i64, w: *i64, h: *i64, n: i64, min_width: i64, min_spacing: i64, out: *i64) -> i64 |
| 105 | func mk_bbox(x: *i64, y: *i64, w: *i64, h: *i64, n: i64, out: *i64) -> i64 |