seveibar/am3352-dev-board
A 324-ball TI AM3352 ARM processor with DDR3, LCD, USB, Ethernet, storage, serial, analog, clock, reset, power, and JTAG interfaces, paired with configurable JST-GH board connectors and constrained PCB routing.
- Version
- 1.0.2
- License
- unset
- Stars
- 0
scripts/sync-routing-endpoints.py
"""Refresh replay endpoint snapshots after adding connections, before rerouting/auditing."""
import json
from pathlib import Path
c=json.loads(Path('dist/index/circuit.json').read_text());d=json.loads(Path('design/routed-copper.json').read_text());ports={p['source_port_id']:p for p in c if p['type']=='pcb_port'}
for sid in d['nets']:
traces=[t for t in c if t['type']=='source_trace' and (sid in t.get('connected_source_net_ids',[]) or t['source_trace_id']==sid)]
ps=set(p for t in traces for p in t.get('connected_source_port_ids',[]));d['endpoints'][sid]=[[ports[p]['x'],ports[p]['y']] for p in sorted(ps) if p in ports]
Path('design/routed-copper.json').write_text(json.dumps(d,separators=(',',':'))+'\n')