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
tests/ddr-power-via-reuse.test.ts
import{test,expect}from'bun:test'
import{sharedViaApproaches}from'../scripts/plan-ddr-ram-power-via-reuse'
import{auditRouteAngles}from'../scripts/check-route-angles'
const start={route_type:'wire',x:0,y:0,layer:'top',width:.12,start_pcb_port_id:'pad'}
test('shared via approaches retain endpoints with 45degree bends for all quadrants',()=>{
for(const x of[-.4,.4])for(const y of[-1.2,1.2])for(const route of sharedViaApproaches(start,{x,y})){
expect(route[0]).toEqual(start)
expect(route.at(-1)).toMatchObject({x,y,layer:'top'})
expect(auditRouteAngles([{route}]).valid).toBe(true)
expect(route.every(p=>p.route_type==='wire')).toBe(true)
}
})
test('reuse route enforces complete pad-to-via planar budget',()=>{
expect(sharedViaApproaches(start,{x:1.6,y:0})).toEqual([])
expect(sharedViaApproaches(start,{x:1.2,y:1.2})).toEqual([])
expect(sharedViaApproaches(start,{x:.4,y:.4})).toHaveLength(2)
})