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-memory-support.test.ts

import {test,expect} from 'bun:test'
import {getDdrMemorySupportConnections} from '../src/ddr-memory-support'
const pins=['VDD_A2','VDD_D9','VDDQ_C1','VDDQ_E9','VSS_A1','VSSQ_D8','VREFCA','VREFDQ','ZQ','DQ0'].map((terminal,pin)=>({ball:String(pin),pin,terminal,routed:true}))
const targets={vdd:'net.DDR_1V5',vddq:'net.DDR_1V5',ground:'net.GND',vrefca:'net.DDR_VREF',vrefdq:'net.DDR_VREF',zqResistor:'.RZQ0 > .pin1'}
test('every individual supply ball is joined and ZQ remains a resistor connection',()=>{
 const result=getDdrMemorySupportConnections(pins,targets)
 expect(Object.keys(result)).toHaveLength(9)
 expect(result.VDD_A2).toBe(result.VDD_D9)
 expect(result.VSS_A1).toBe(result.VSSQ_D8)
 expect(result.ZQ).toBe('.RZQ0 > .pin1')
 expect(result.DQ0).toBeUndefined()
})
test('missing support terminals and direct-ground ZQ are rejected',()=>{
 expect(()=>getDdrMemorySupportConnections(pins.filter(p=>p.terminal!=='VREFDQ'),targets)).toThrow('VREFDQ')
 expect(()=>getDdrMemorySupportConnections(pins,{...targets,zqResistor:'net.GND'})).toThrow('240-ohm')
})