Skip to content

Instantly share code, notes, and snippets.

@Sfinx
Created August 8, 2025 11:04
Show Gist options
  • Select an option

  • Save Sfinx/9b4005f3bf5d11648c6a77aacf2ae74c to your computer and use it in GitHub Desktop.

Select an option

Save Sfinx/9b4005f3bf5d11648c6a77aacf2ae74c to your computer and use it in GitHub Desktop.
Convert quartus pin file to qsf format
#!/bin/bash
FILE_PATH="$1"
count=0
if [[ -f "$FILE_PATH" ]]; then
while IFS= read -r line; do
((++count))
# Current pin file format starts data from 66 line
if [ $count -ge 66 ]; then
pin_data=($line)
if [ "${pin_data[0]}" != "GND" ] && [[ "${pin_data[0]}" != "RESERVED"* ]] && [[ "${pin_data[0]}" != "VCC"* ]] && [ "${pin_data[0]}" != "TMS" ] && [ "${pin_data[0]}" != "TDI" ] && [ "${pin_data[0]}" != "TCK" ] && [ "${pin_data[0]}" != "TDO" ]; then
echo set_location_assignment PIN_"${pin_data[2]}" -to "${pin_data[0]}"
fi
fi
done < "$FILE_PATH"
else
echo "Error: File not found: '$FILE_PATH'"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment