trashernet-soc/fpga/patch_asserts.sh
Markus Koch f21122c54b fpga: Add script to remove $asserts from netlists
For some reason, GHDL adds some (not all) asserts to the
synthesis netlist. This script removes them.
2024-11-08 15:37:15 +01:00

15 lines
263 B
Bash
Executable File

#!/bin/bash
file="$1"
echo "Removing \$assert from $file..."
LOCS=`grep -n '$assert' "$file" | sed 's/:.*//g'`
IFS=$'\n'
for LOC in $LOCS; do
START=$(($LOC-2))
END=$(($LOC+14))
echo "Deleting lines $START -> $END"
sed -i -e "${START},${END}d" "$file"
done