1 |
2 |
sinclairrf |
#!/bin/bash
|
2 |
7 |
sinclairrf |
# Copyright 2013-2014, Sinclair R.F., Inc.
|
3 |
2 |
sinclairrf |
# Test against Xilinx Spartan 6 and ISE.
|
4 |
|
|
#
|
5 |
|
|
# To replicate the performance runs (using uc_led)
|
6 |
|
|
# - Minimum resource utilization, use -3 speed grade, 10 ns clock, XST and MAP
|
7 |
|
|
# set for minimum area, and ISE 13.3 or 14.4
|
8 |
7 |
sinclairrf |
# - results for ISE 13.3 and 14.4 or 14.7 are identical
|
9 |
|
|
# - Maximum speed (rounded down)
|
10 |
|
|
# -1L 11.4 9.6 ns "-timing -t 53" ==> 9.575 ns (104.4 MHz)
|
11 |
|
|
# -1L 12.4 9.6 ns "-timing -t 52" ==> 9.906 ns (100.9 MHz)
|
12 |
|
|
# -1L 13.3 9.8 ns "-timing -t 8" ==> 9.844 ns (101.5 MHz)
|
13 |
|
|
# -2 11.4 8.2 ns "-timing -t 37" ==> 8.166 ns (122.4 MHz)
|
14 |
|
|
# -2 12.4 7.7 ns "-timing -t 56" ==> 7.955 ns (125.7 MHz)
|
15 |
|
|
# -2 13.3 5.8 ns "-timing -t 80" ==> 5.781 ns (172.9 MHz)
|
16 |
|
|
# -3 11.4 5.9 ns "-timing -t 45" ==> 5.927 ns (167.7 MHz)
|
17 |
|
|
# -3 12.4 5.4 ns "-timing -t 63" ==> 5.162 ns (193.7 MHz)
|
18 |
|
|
# -3 13.3 5.3 ns "-timing -t 14" ==> 5.162 ns (193.7 MHz)
|
19 |
2 |
sinclairrf |
|
20 |
7 |
sinclairrf |
TESTED="11.4 12.4 13.3 14.7";
|
21 |
2 |
sinclairrf |
|
22 |
|
|
TEST_BENCHES="";
|
23 |
|
|
TEST_BENCHES+=" uc_combine_instr_ds";
|
24 |
|
|
TEST_BENCHES+=" uc_led";
|
25 |
|
|
TEST_BENCHES+=" uc_peripherals";
|
26 |
|
|
|
27 |
|
|
PWD="`pwd`";
|
28 |
|
|
PWD="${PWD/*\/}";
|
29 |
|
|
|
30 |
|
|
while getopts "ht:v:" OPTNAME; do
|
31 |
|
|
case ${OPTNAME} in
|
32 |
|
|
( h ) echo "Usage: run [-t uc_name] [-v ISE_version]" > /dev/stderr;
|
33 |
|
|
echo "Where:" > /dev/stderr;
|
34 |
|
|
echo " uc_name is one of the .9x8 files in ../uc" > /dev/stderr;
|
35 |
|
|
echo " ISE_version is an ISE version number" > /dev/stderr;
|
36 |
|
|
exit 0;;
|
37 |
|
|
( t ) TEST_BENCHES="${OPTARG}";;
|
38 |
|
|
( v ) TESTED="${OPTARG}";;
|
39 |
|
|
esac
|
40 |
|
|
done
|
41 |
|
|
|
42 |
|
|
let nTested=0;
|
43 |
|
|
for VERSION in ${TESTED}; do
|
44 |
|
|
TOOL_DIR="/opt/Xilinx/${VERSION}";
|
45 |
|
|
if [ ! -e "${TOOL_DIR}" ]; then
|
46 |
|
|
echo "Xilinx ISE version ${VERSION} not found at ${TOOL_DIR}" > /dev/stderr;
|
47 |
|
|
continue;
|
48 |
|
|
fi
|
49 |
|
|
if [ -d "${TOOL_DIR}/ISE_DS" ]; then
|
50 |
|
|
TOOL_DIR="${TOOL_DIR}/ISE_DS";
|
51 |
|
|
fi
|
52 |
|
|
for TB in ${TEST_BENCHES}; do
|
53 |
|
|
let nTested+=1;
|
54 |
|
|
LOGFILE="log-${VERSION}-${TB}";
|
55 |
|
|
if [ ! -z "`./make "${TOOL_DIR}" ${TB} 2>&1 | tee "${LOGFILE}" | sed -n '/ERROR/p'`" ]; then
|
56 |
|
|
grep "ERROR" "${LOGFILE}" > /dev/stderr;
|
57 |
|
|
echo "BUILD TEST BENCH FAILED" > /dev/stderr;
|
58 |
|
|
echo "build directory: ${PWD}" > /dev/stderr;
|
59 |
|
|
echo "TOOL: ${TOOL_DIR}" > /dev/stderr;
|
60 |
|
|
echo "TEST: ${TB}" > /dev/stderr;
|
61 |
|
|
echo "LOG FILE: ${LOGFILE}" > /dev/stderr;
|
62 |
|
|
exit 1;
|
63 |
|
|
fi
|
64 |
|
|
echo "Build results for ${PWD} Xilinx ISE/${VERSION} ${TB}";
|
65 |
|
|
sed -n \
|
66 |
|
|
-e '/Minimum period/p' \
|
67 |
|
|
-e '/^ Number of occupied Slices:/p' \
|
68 |
|
|
-e '/^ Number of Slice LUTs:/p' \
|
69 |
|
|
-e '/^ Number of RAMB[0-9]*BWERs: *[1-9]/p' \
|
70 |
|
|
-e '/TS_i_clk = PERIOD/,+1p' \
|
71 |
|
|
"${LOGFILE}" \
|
72 |
|
|
;
|
73 |
|
|
done
|
74 |
|
|
done
|
75 |
|
|
|
76 |
|
|
if [ ${nTested} == "0" ]; then
|
77 |
|
|
echo "No tests performed in ${PWD/*\/}" > /dev/stderr;
|
78 |
|
|
else
|
79 |
|
|
echo "${nTested} tool versions successfully tested in ${PWD/*\/}" > /dev/stderr;
|
80 |
|
|
fi
|