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/ddr-capture-provenance.ts
import {readFileSync} from 'node:fs'
import {resolve} from 'node:path'
import {createHash} from 'node:crypto'
/** Refuse physically comparing artifacts taken from different source captures. */
export function verifyDdrCapture(directory:string) {
const read=(file:string)=>readFileSync(resolve(directory,file))
const manifest=JSON.parse(read('provenance.json').toString())
const snapshot=JSON.parse(read('memory-source-snapshot.json').toString())
if(!manifest.captureHash||manifest.captureHash!==snapshot.captureHash)throw Error('Capture identity missing or inconsistent')
for(const file of ['unrouted.circuit.json','memory-source-snapshot.json','signal-map.json','routing-input.json']) {
const actual=createHash('sha256').update(read(file)).digest('hex')
if(actual!==manifest.files?.[file])throw Error(`Capture provenance mismatch: ${file}`)
}
return {captureHash:manifest.captureHash as string,snapshot}
}