picorv32/scripts/quartus/table.sh

18 lines
629 B
Bash
Raw Normal View History

2016-08-30 12:12:08 +08:00
#!/bin/bash
dashes="----------------------------------------------------------------"
printf '| %-25s | %-10s | %-20s |\n' "Device" "Speedgrade" "Clock Period (Freq.)"
printf '|:%.25s |:%.10s:| %.20s:|\n' $dashes $dashes $dashes
for x in $( grep -H . tab_*/results.txt )
do
read _ size device grade _ speed < <( echo "$x" | tr _/: ' ' )
case "$device" in
2016-08-30 14:22:53 +08:00
ep4ce) d="Altera Cyclone IV E" ;;
ep4cgx) d="Altera Cyclone IV GX" ;;
5cgx) d="Altera Cyclone V GX" ;;
2016-08-30 12:12:08 +08:00
esac
speedtxt=$( printf '%s.%s ns (%d MHz)' ${speed%?} ${speed#?} $((10000 / speed)) )
printf '| %-25s | %-10s | %20s |\n' "$d" "-$grade" "$speedtxt"
done