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/prepare-ddr-dq2-after-dq6.ts

import{readFileSync,writeFileSync,mkdirSync}from'node:fs';import{resolve}from'node:path';import{objectHash as hash}from'./improve-ddr-a9-power-launches';import{auditCompositeHostTopology}from'./ddr-composite-routing-context';
const read=(p:string)=>JSON.parse(readFileSync(p,'utf8')),common=resolve('dist/ddr-twelve-dq1-partial-timing'),parent=resolve('dist/ddr-dq6-pocket-host'),out=resolve('dist/ddr-dq2-after-dq6-parent'),c=read(parent+'/candidate.circuit.json'),h=read(parent+'/host-bundle.json'),report=read(parent+'/report.json'),prior=read(common+'/report.json'),input=read(common+'/routing-input.json'),base=read(common+'/candidate.circuit.json'),basehost=read(common+'/host-bundle.json'),old=h.traces.find((t:any)=>t.source_trace_id==='source_trace_577');if(!report.accepted||h.traces.length!==13||basehost.traces.some((t:any)=>!h.traces.some((n:any)=>hash(t)===hash(n))))throw Error('Not exact commonparent plusDQ6');const candidate=c.filter((e:any)=>e.pcb_trace_id!==old.pcb_trace_id),host={...h,traces:h.traces.filter((t:any)=>t.pcb_trace_id!==old.pcb_trace_id)},topology=auditCompositeHostTopology(candidate,host.traces,input.connections);if(!topology.valid||topology.physical.connectivity.filter((c:any)=>c.connected).length!==12)throw Error('Retirement geometryinvalid');mkdirSync(out,{recursive:true});const write=(n:string,v:any)=>writeFileSync(out+'/'+n,JSON.stringify(v,null,2)+'\n');write('candidate.circuit.json',candidate);write('host-bundle.json',host);write('routing-input.json',{...input,traces:host.traces});write('report.json',{...prior,candidateCircuitSha256:hash(candidate),topology,physical:topology.physical,retirement:{parentDirectory:parent,parentCircuitSha256:hash(c),commonParentDirectory:common,commonParentCircuitSha256:hash(base),before:old,beforeSha256:hash(old)},scope:'IsolatedDQ2retirement on exactvalidDQ6candidate,12otherhosts retained; newDQ2notconnected.'});console.log(out)