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-facing-mask-artifact.test.ts
import{test,expect}from'bun:test'
import{readFileSync,existsSync}from'node:fs'
import{fanoutTracePath}from'@tscircuit/props'
import{auditRouteAngles}from'../scripts/check-route-angles'
const dir='dist/ddr-facing-dm0-power54',capture='dist/ddr-system/host-taps-54af3e346b5e'
test.skipIf(!existsSync(`${dir}/exit-contract.json`))('facing mask cache preserves71paths, physical barrels and fanout bounds',()=>{
const read=(p:string)=>JSON.parse(readFileSync(p,'utf8')),paths=read(`${dir}/ram-byte0-facing-mask.trace-paths.json`),old=read(`${capture}/memory-source-snapshot.json`).pathsByByte[0],contract=read(`${dir}/exit-contract.json`),report=read(`${dir}/report.json`)
expect(paths).toHaveLength(72)
for(let i=0;i<paths.length;i++){
expect(()=>fanoutTracePath.parse(paths[i])).not.toThrow()
if(paths[i].connection!=='U1.ball_B7')expect(paths[i]).toEqual(old[i])
}
const path=paths.find((p:any)=>p.connection==='U1.ball_B7'),last=path.route.at(-1),via=path.route.find((p:any)=>p.route_type==='via')
expect(last.layer).toBe('inner4');expect(last.x).toBeLessThan(0)
expect(via.to_layer).toBe('inner4');expect(via.via_diameter).toBe(.4572);expect(via.via_hole_diameter).toBe(.254)
expect(auditRouteAngles(paths).valid).toBe(true)
expect(contract.paddingChangeMm).toBe(0)
expect(report.lengthBudget.nominalFloorPass).toBe(true)
expect(report.lengthBudget.optimisticTotalMm).toBeLessThan(report.lengthBudget.nominalMm)
expect(report.physical.errors).toHaveLength(0);expect(report.physical.violations).toHaveLength(0);expect(report.physical.joinedBends).toHaveLength(0)
})