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/bind-endpoints.py

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());traces=[t for t in c if t['type']=='source_trace']
for n in c:
 if n['type']!='source_net':continue
 sid=n['source_net_id'];ids={p for t in traces if sid in t.get('connected_source_net_ids',[]) for p in t['connected_source_port_ids']};d['endpoints'][sid]=[[p['x'],p['y']] for p in c if p['type']=='pcb_port' and p['source_port_id'] in ids]
Path('design/routed-copper.json').write_text(json.dumps(d,separators=(',',':')))