mirror of
https://github.com/Polprzewodnikowy/SummerCart64.git
synced 2024-11-22 05:59:15 +01:00
FPGA frequency extraction
This commit is contained in:
parent
a9ee74f480
commit
0fcdecfd6b
2
build.sh
2
build.sh
@ -8,6 +8,7 @@ PACKAGE_FILE_NAME="sc64-extra"
|
||||
|
||||
TOP_FILES=(
|
||||
"./fw/ftdi/ft232h_config.xml"
|
||||
"./fw/project/lcmxo2/impl1/fpga_max_frequency.txt"
|
||||
"./sw/tools/primer.py"
|
||||
"./sw/tools/requirements.txt"
|
||||
"./sc64-firmware-${SC64_VERSION}.bin"
|
||||
@ -90,6 +91,7 @@ build_update () {
|
||||
rm -f ../../sc64-firmware-*.bin
|
||||
fi
|
||||
GIT_INFO=""
|
||||
GIT_INFO+=$'\n'"freq: $(cat ../../fw/project/lcmxo2/impl1/fpga_max_frequency.txt)"
|
||||
if [ ! -z "${SC64_VERSION}" ]; then GIT_INFO+=$'\n'"ver: $SC64_VERSION"; fi
|
||||
if [ ! -z "${GIT_BRANCH}" ]; then GIT_INFO+=$'\n'"branch: $GIT_BRANCH"; fi
|
||||
if [ ! -z "${GIT_TAG}" ]; then GIT_INFO+=$'\n'"tag: $GIT_TAG"; fi
|
||||
|
@ -1,5 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
source $bindir/diamond_env
|
||||
|
||||
diamondc build.tcl
|
||||
|
||||
MINIMUM_FREQ=$(cat impl1/sc64_impl1.twr \
|
||||
| grep 'Preference: FREQUENCY NET "clk"' \
|
||||
| head -1 \
|
||||
| awk -F ' ' '{print $5}' \
|
||||
)
|
||||
|
||||
DESIGN_FREQ=$(cat impl1/sc64_impl1.twr \
|
||||
| sed -n '/Preference: FREQUENCY NET "clk"/,$p' \
|
||||
| grep 'is the maximum frequency for this preference' \
|
||||
| head -1 \
|
||||
| awk -F ' ' '{print $2}' \
|
||||
| sed 's/MHz//' \
|
||||
)
|
||||
|
||||
echo "Minimum required frequency: $MINIMUM_FREQ MHz"
|
||||
echo "Maximum design frequency: $DESIGN_FREQ MHz"
|
||||
|
||||
if (( $(echo "$DESIGN_FREQ < $MINIMUM_FREQ" | bc -l) )); then
|
||||
echo "Timing error detected, build failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "$DESIGN_FREQ MHz" > impl1/fpga_max_frequency.txt
|
||||
|
Loading…
Reference in New Issue
Block a user