code wiki / _hdl_build / nx_encfab.nx
nx_encfab.nx source
↩ module page · 28 lines · 1367 B
1// nx_encfab.nx -- LIB: COMPLETE enclosed-fab feasibility twin. An enclosure fixes PARTICLES (nx_cleanroom), but a real
2// fab needs more controlled: CHEMICAL/gas purity, VIBRATION (litho alignment), THERMAL/humidity, the enclosure's own
3// OUTGASSING (bare printed plastic sheds particles -> must be clean-grade), and STEP INTEGRATION / sealed transfer.
4// Feasibility = ALL dimensions controlled. Computes the enclosed-fab capital (~$15k env) vs a clean room (~$10M) and how
5// many times cheaper -- the number that makes the doomsday CPU fab affordable. Composes nx_cleanroom for the particle
6// axis. never-brick #26: pure logic, deterministic. license_tier: ORIGINAL
7import "nx_cleanroom.nx"
8import "nx_syscalls.nx"
9
10// the enclosed fab is feasible iff EVERY environment dimension is adequately controlled.
11func encfab_all_controlled(controlled: *i64, n: i64) -> i64 {
12 var i: i64 = 0
13 while i < n { if controlled[i] == 0 { return 0 } i = i + 1 }
14 return 1
15}
16
17// total enclosed-fab environment capital (cents).
18func encfab_capital(cost: *i64, n: i64) -> i64 {
19 var t: i64 = 0; var i: i64 = 0
20 while i < n { t = t + cost[i]; i = i + 1 }
21 return t
22}
23
24// how many times cheaper the enclosed fab is than a clean room.
25func encfab_cheaper_x(enclosed: i64, cleanroom: i64) -> i64 {
26 if enclosed <= 0 { return 0 }
27 return cleanroom / enclosed
28}