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/assemble-ddr-support-current.ts
import {readFileSync,writeFileSync,cpSync,existsSync} from 'node:fs'
import {resolve} from 'node:path'
import {objectHash} from './improve-ddr-a9-power-launches'
import {finalizeDdrEvidenceMetadata} from './finalize-ddr-evidence-metadata'
const[trialArg,outArg,captureArg]=process.argv.slice(2);if(!trialArg||!outArg||!captureArg)throw Error('Usage: qualified-support output capture')
const trial=resolve(trialArg),out=resolve(outArg),read=(p:string)=>JSON.parse(readFileSync(p,'utf8')),r=read(`${trial}/report.json`),parent=resolve(r.parentDirectory)
if(existsSync(out))throw Error('Output already exists')
if(!r.supportGeometryQualified||objectHash(read(`${trial}/candidate.circuit.json`))!==r.candidateCircuitSha256||objectHash(read(`${parent}/candidate.circuit.json`))!==r.parentCircuitSha256)throw Error('Support/parent identity invalid')
cpSync(trial,out,{recursive:true});const write=(n:string,v:any)=>writeFileSync(`${out}/${n}`,JSON.stringify(v,null,2)+'\n')
for(let byte=0;byte<2;byte++){
const name=`ram-byte${byte}-facing-progress.trace-paths.json`,cache=read(`${parent}/${name}`),contract=read(`${parent}/${byte?'ram-byte1-exit-contract.json':'exit-contract.json'}`)
if(contract.ramCacheSha256!==objectHash(cache))throw Error('Stale parent cache contract')
write(name,cache);contract.candidateCircuitSha256=r.candidateCircuitSha256
write(byte?'ram-byte1-exit-contract.json':'exit-contract.json',contract)
}
const provenance={inherited:read(`${parent}/source-provenance.json`),parentDirectory:parent,parentCircuitSha256:r.parentCircuitSha256,candidateCircuitSha256:r.candidateCircuitSha256,supportManifestSha256:objectHash(read(`${trial}/support-replacements.json`)),qualifiedSupportReportSha256:objectHash(r),scope:'Exact qualified support additions on the clock-compatible parent. Physical RAM caches unchanged; contracts rebound to current complete copper.'}
write('source-provenance.json',provenance);r.sourceProvenance=provenance;r.exitContractProvenance={byte0Sha256:objectHash(read(`${out}/exit-contract.json`)),byte1Sha256:objectHash(read(`${out}/ram-byte1-exit-contract.json`))};write('report.json',r)
await finalizeDdrEvidenceMetadata(out,resolve(captureArg));console.log(out)