0hmX/mt41k512m8da-107-it-p-fanout
This code defines the physical footprint, routing, and layout configuration for a DDR3 memory module using surface-mount pads, vias, and copper traces on a printed circuit board (PCB).
- Version
- 0.2.3
- License
- unset
- Stars
- 0
src/profiles.ts
export const LAYOUT_PROFILES = ["outward_north", "outward_south", "inward_north", "inward_south"] as const
export type LayoutProfile = typeof LAYOUT_PROFILES[number]
export const PROFILE_LAYOUTS = {
outward_north: { xDirection: "outward", yDirection: "north" },
outward_south: { xDirection: "outward", yDirection: "south" },
inward_north: { xDirection: "inward", yDirection: "north" },
inward_south: { xDirection: "inward", yDirection: "south" },
} as const
export const RULES = { traceWidth: 0.12, clearance: 0.1, viaDiameter: 0.45, viaDrill: 0.2, layers: 4 } as const
export function assertLayoutProfile(value: string): asserts value is LayoutProfile {
if (!(LAYOUT_PROFILES as readonly string[]).includes(value)) throw new Error(`Unknown RAM layoutProfile: ${value}`)
}
// Local breakout boundary, independent of the preview/host board edge.
export const PACKAGE_BODY = { width: 8, height: 10.5 } as const
export const FANOUT_PADDING_MM = 1
export const BREAKOUT = { halfWidth: PACKAGE_BODY.width/2+FANOUT_PADDING_MM, halfHeight: PACKAGE_BODY.height/2+FANOUT_PADDING_MM } as const
export function getExitLayer(ball: string): "top" | "inner1" | "inner2" {
return ({1:"top",2:"inner2",3:"inner1",7:"inner1",8:"inner2",9:"top"} as const)[Number(ball.slice(1)) as 1|2|3|7|8|9]
}