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-dq7-ordered-retuning.test.ts
import{test,expect}from'bun:test'
import{readFileSync,existsSync}from'node:fs'
import{validateDeclaredDdrReplacements}from'../scripts/improve-ddr-a9-power-launches'
test.skipIf(!existsSync('dist/ddr-dq7-ordered-retuned/candidate.circuit.json'))('DQ7 template matches orderedDM0 with DQS0/DQ4 reserved and no layer/via/endpoint changes',()=>{
const d='dist/ddr-dq7-ordered-retuned',read=(p:string)=>JSON.parse(readFileSync(p,'utf8')),r=read(d+'/report.json'),m=read(d+'/original-copper-replacements.json'),child=read(d+'/candidate.circuit.json'),parent=read(m.parentDirectory+'/candidate.circuit.json'),q=read(d+'/dq7-replacement.json')
expect(validateDeclaredDdrReplacements(parent,child,m).declaredReplacementCount).toBe(4);expect(r.accepted).toBe(true);expect(r.measuredFullMm).toBeCloseTo(28.423158,8);expect(r.measuredFullMm).toBeLessThanOrEqual(r.beforeLengths.nominalMm);expect(r.recipe.addedMm).toBeCloseTo(2.127403915704,8)
expect(q.after.route[0]).toEqual(q.before.route[0]);expect(q.after.route.at(-1)).toEqual(q.before.route.at(-1));expect(q.after.route.every((p:any)=>p.route_type==='wire'&&p.layer==='inner4'&&p.width===.12)).toBe(true)
expect(r.topology.valid).toBe(true);expect(r.topology.physical.errors).toHaveLength(0);expect(r.topology.physical.violations).toHaveLength(0);expect(r.topology.physical.connectivity.filter((c:any)=>c.connected)).toHaveLength(11);expect(r.allAngles.valid).toBe(true);expect(r.allJunctions.valid).toBe(true);expect(r.terminal.valid).toBe(true)
})