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
scripts/render-ddr-global-planes.ts
import{readFileSync,writeFileSync}from'node:fs'
import{resolve}from'node:path'
import{convertCircuitJsonToPcbSvg}from'circuit-to-svg'
import{Resvg}from'@resvg/resvg-js'
const dir=resolve(process.argv[2]??'dist/ddr-global-plane-reuse-plan'),circuit=JSON.parse(readFileSync(`${dir}/candidate.circuit.json`,'utf8'))
const layers=process.argv[3]?.split(',')??['top','bottom','inner1','inner3','inner5']
if(layers.some(layer=>!['top','bottom',...Array.from({length:8},(_,i)=>`inner${i+1}`)].includes(layer)))throw Error('Unknown physical layer')
for(const layer of layers){const svg=convertCircuitJsonToPcbSvg(circuit,{layer:layer as any,width:1536,height:1008,viewport:{minX:-32,maxX:32,minY:-21,maxY:21},shouldDrawRatsNest:false});writeFileSync(`${dir}/${layer}.svg`,svg);writeFileSync(`${dir}/${layer}.png`,new Resvg(svg).render().asPng())}
console.log(dir)