#!/bin/bash # Copyright 2013, Sinclair R.F., Inc. # Test against Xilinx Spartan 6 and ISE. # # To replicate the performance runs (using uc_led) # - Minimum resource utilization, use -3 speed grade, 10 ns clock, XST and MAP # set for minimum area, and ISE 13.3 or 14.4 # - Maximum speed # -1L 11.4 9.0 ns "-timing -t 52" ==> 9.112 ns (109.7 MHz) # -1L 12.4 9.4 ns "-timing -t 52" ==> 9.434 ns (106.0 MHz) # -1L 13.3 9.5 ns "-timing -t 36" ==> 9.657 ns (103.6 MHz) # -1L 14.4 9.5 ns "-timing -t 36" ==> 9.657 ns (103.6 MHz) # -2 11.4 7.5 ns "-timing -t 50" ==> 7.948 ns (125.8 MHz) # -2 12.4 7.0 ns "-timing -t 6" ==> 7.544 ns (132.6 MHz) # -2 13.3 5.7 ns "-timing -t 69" ==> 5.682 ns (176.0 MHz) # -2 14.4 5.7 ns "-timing -t 69" ==> 5.682 ns (176.0 MHz) # -3 11.4 5.6 ns "-timing -t 50" ==> 5.700 ns (175.4 MHz) # -3 12.4 5.0 ns "-timing -t 28" ==> 5.064 ns (197.5 MHz) # -3 13.3 5.0 ns "-timing -t 12" ==> 5.000 ns (200.0 MHz) # -3 14.4 5.0 ns "-timing -t 12" ==> 5.000 ns (200.0 MHz) TESTED="11.4 12.4 13.3 14.4 14.5"; TEST_BENCHES=""; TEST_BENCHES+=" uc_combine_instr_ds"; TEST_BENCHES+=" uc_led"; TEST_BENCHES+=" uc_peripherals"; PWD="`pwd`"; PWD="${PWD/*\/}"; while getopts "ht:v:" OPTNAME; do case ${OPTNAME} in ( h ) echo "Usage: run [-t uc_name] [-v ISE_version]" > /dev/stderr; echo "Where:" > /dev/stderr; echo " uc_name is one of the .9x8 files in ../uc" > /dev/stderr; echo " ISE_version is an ISE version number" > /dev/stderr; exit 0;; ( t ) TEST_BENCHES="${OPTARG}";; ( v ) TESTED="${OPTARG}";; esac done let nTested=0; for VERSION in ${TESTED}; do TOOL_DIR="/opt/Xilinx/${VERSION}"; if [ ! -e "${TOOL_DIR}" ]; then echo "Xilinx ISE version ${VERSION} not found at ${TOOL_DIR}" > /dev/stderr; continue; fi if [ -d "${TOOL_DIR}/ISE_DS" ]; then TOOL_DIR="${TOOL_DIR}/ISE_DS"; fi for TB in ${TEST_BENCHES}; do let nTested+=1; LOGFILE="log-${VERSION}-${TB}"; if [ ! -z "`./make "${TOOL_DIR}" ${TB} 2>&1 | tee "${LOGFILE}" | sed -n '/ERROR/p'`" ]; then grep "ERROR" "${LOGFILE}" > /dev/stderr; echo "BUILD TEST BENCH FAILED" > /dev/stderr; echo "build directory: ${PWD}" > /dev/stderr; echo "TOOL: ${TOOL_DIR}" > /dev/stderr; echo "TEST: ${TB}" > /dev/stderr; echo "LOG FILE: ${LOGFILE}" > /dev/stderr; exit 1; fi echo "Build results for ${PWD} Xilinx ISE/${VERSION} ${TB}"; sed -n \ -e '/Minimum period/p' \ -e '/^ Number of occupied Slices:/p' \ -e '/^ Number of Slice LUTs:/p' \ -e '/^ Number of RAMB[0-9]*BWERs: *[1-9]/p' \ -e '/TS_i_clk = PERIOD/,+1p' \ "${LOGFILE}" \ ; done done if [ ${nTested} == "0" ]; then echo "No tests performed in ${PWD/*\/}" > /dev/stderr; else echo "${nTested} tool versions successfully tested in ${PWD/*\/}" > /dev/stderr; fi