0hmX/am3352

This code suite comprises TypeScript scripts that analyze, verify, and assemble complex DDR memory interface hardware, focusing on physical routing, via and pad placement, electrical clearance, and physical constraints, often involving precise geometric calculations and consistent provenance tracking.

Version
1.0.5
License
unset
Stars
0

scripts/ddr-facing-via-continuation.ts

import {retainViaLaunch} from './ddr-retained-via-route'
/** Expose a solver's implicit via-to-first-wire segment to the full physical checker. */
export function explicitFacingViaContinuation(before:any,raw:any,targetLayer:string){
 const viaIndex=before.route.findIndex((p:any)=>p.route_type==='via')
 if(viaIndex<0||before.route.filter((p:any)=>p.route_type==='via').length!==1)throw Error('Expected one existing physical via')
 const via={...before.route[viaIndex],to_layer:targetLayer}
 const prefix=[...before.route.slice(0,viaIndex),via]
 const after={...before,route:retainViaLaunch(raw.route,prefix)}
 if(after.route.slice(viaIndex+1).some((p:any)=>p.route_type!=='wire'||p.layer!==targetLayer))throw Error('Missing planar via continuation')
 const firstOriginalWire=raw.route.slice(viaIndex+1).find((p:any)=>p.route_type==='wire')
 const omittedCenterDistanceMm=Math.hypot(firstOriginalWire.x-via.x,firstOriginalWire.y-via.y)
 return {after,via,omittedCenterDistanceMm}
}