patch-sby-yosys-compat.sh 581 B

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