#!/usr/bin/env bash set -euo pipefail # Yosys 0.52 renamed the RTLIL frontend from read_ilang to read_rtlil. # Apply only this narrowly-scoped SBY generator compatibility substitution. target="${1:-/usr/local/share/yosys/python3/sby_core.py}" test -f "$target" before="$(sha256sum "$target" | awk '{print $1}')" sed -i 's/read_ilang/read_rtlil/g' "$target" after="$(sha256sum "$target" | awk '{print $1}')" printf '{"schema":"prod2u-sby-yosys-compat-v1","target":"%s","before_sha256":"%s","after_sha256":"%s","replacement":"read_ilang->read_rtlil"}\n' "$target" "$before" "$after"