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-current-trunk-contract.test.ts
import {test,expect} from 'bun:test'
import {currentDdrTrunkContract} from '../scripts/ddr-current-trunk-contract'
test('clock identity follows updated copper and rejects stale routing coordinates',()=>{
const p=(pointId:string,x:number)=>({pointId,x,y:0,layer:'inner6'})
const frozen={forcedTrunks:[{terminal:'CK_P',firstConnection:'a',secondConnection:'b',ram0Tap:p('r0',0),ram1Tap:p('r1',1),cpuPoint:p('cpu',3)}]}
const input={connections:[{name:'a',pointsToConnect:[p('cpu',3),p('r0',.24)]},{name:'b',pointsToConnect:[p('cpu',3),p('r1',1.24)]}]}
const candidate=[p('r0',.24),p('r1',1.24),p('cpu',3)].map(p=>({...p,pcb_breakout_point_id:p.pointId}))
expect(currentDdrTrunkContract(frozen,input,candidate).forcedTrunks[0].ram0Tap.x).toBe(.24)
expect(frozen.forcedTrunks[0]!.ram0Tap.x).toBe(0)
candidate[0]!.x=0
expect(()=>currentDdrTrunkContract(frozen,input,candidate)).toThrow('differs from actual')
})