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-ground-plane-antipads.test.ts
import{test,expect}from'bun:test'
import{planDdrGroundAntipads}from'../scripts/ddr-ground-plane-antipads'
const plane={type:'pcb_copper_pour',pcb_copper_pour_id:'gnd',shape:'brep',brep_shape:{outer_ring:{vertices:[{x:-5,y:-5},{x:-5,y:5},{x:5,y:5},{x:5,y:-5}]},inner_rings:[]}}
test('new power via gets a conservative hole, ground does not, original stays intact',()=>{const r=planDdrGroundAntipads([plane],[{x:0,y:0,net:'DDR_1V5'},{x:2,y:0,net:'GND'}]);expect(r.added).toHaveLength(1);expect(r.planes[0].brep_shape.inner_rings[0].vertices).toHaveLength(64);expect(r.added[0].radiusMm*Math.cos(Math.PI/64)-.4572/2).toBeCloseTo(.1016,10);expect(plane.brep_shape.inner_rings).toHaveLength(0);expect(r.planes[0].brep_shape.outer_ring).toEqual(plane.brep_shape.outer_ring)})
test('boundary or neighboring void collisions cannot silently split the plane',()=>{expect(()=>planDdrGroundAntipads([plane],[{x:4.9,y:0,net:'P'}])).toThrow('web');const a=planDdrGroundAntipads([plane],[{x:0,y:0,net:'P'}]);expect(()=>planDdrGroundAntipads(a.planes,[{x:.5,y:0,net:'P'}])).toThrow('web');expect(()=>planDdrGroundAntipads([plane],[],{clearanceMm:.1})).toThrow('0.1016')})