Skip to content
Snippets Groups Projects
Commit 882d966b authored by Daniel van der Schuur's avatar Daniel van der Schuur
Browse files

-Added seed option to run_qcomp;

-Added fmax extraction.
parent 54340441
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
###############################################################################
#
# Copyright (C) 2015
# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
# Purpose:
# . Extract fMax from Timequest report file
# Usage:
# . $ quartus_fmax [project].sta.rpt [clk]
# . [clk] is the full path of the clock of interest; copy/paste this from Timequest GUI.
if [ ! -z $1 ]
then
# $1 was given
RPT_FILE=$1
else
: # $1 was not given
echo 'Pass a .sta.rpt file as first argument.'
exit 1
fi
if [ ! -z $2 ]
then
: # $2 was given
CLK=$2
else
: # $2 was not given
echo 'Pass (part of) the clock path as second argument.'
exit 1
fi
nof_clk=`awk '/; Slow 900mV 85C Model Fmax Summary/,/This panel reports FMAX/' $RPT_FILE | grep -c $CLK`
if [ $nof_clk = 0 ]
then
echo 'Clock not found; check provided clock path'
exit 1
elif [ $nof_clk -gt 1 ]
then
echo 'Multiple clocks found; check provided clock path.'
exit 1
else
# Good; only one clock found mathing user passed clk path.
awk '/; Slow 900mV 85C Model Fmax Summary/,/This panel reports FMAX/' $RPT_FILE | grep $CLK | cut -d';' -f2
fi
...@@ -55,6 +55,7 @@ shift # shift left commandline args: $2 becomes $1 ... ($0 is untouched) ...@@ -55,6 +55,7 @@ shift # shift left commandline args: $2 becomes $1 ... ($0 is untouched)
project= project=
rev= rev=
SEED=1 SEED=1
CLK=
os= os=
# parse cmdline # parse cmdline
for arg ; do for arg ; do
...@@ -74,6 +75,12 @@ for arg ; do ...@@ -74,6 +75,12 @@ for arg ; do
seed=*) seed=*)
SEED=`echo ${arg} | sed 's/^seed=//'` SEED=`echo ${arg} | sed 's/^seed=//'`
;; ;;
--clk=*)
CLK=`echo ${arg} | sed 's/^--clk=//'`
;;
clk=*)
CLK=`echo ${arg} | sed 's/^clk=//'`
;;
*=* ) *=* )
# it was an option. skip it - if we wanted to, # it was an option. skip it - if we wanted to,
# we could process them over here # we could process them over here
...@@ -127,9 +134,34 @@ else ...@@ -127,9 +134,34 @@ else
mem_width= mem_width=
fi fi
#for i in $(seq $SEED); do echo $i; done
for i in $(echo $SEED | sed "s/,/ /g")
do
# Add the seed value to the QSF. We can simply append it because Quartus removes previous (duplicate) assignments. # Add the seed value to the QSF. We can simply append it because Quartus removes previous (duplicate) assignments.
unb_info $0 "Adding fitter seed value of ${SEED} to ${project_rev}.qsf" unb_info $0 "Adding fitter seed value of ${i} to ${project_rev}.qsf"
echo -e "set_global_assignment -name SEED ${SEED}\n" >> ${quartusdir}/${project_rev}.qsf echo -e "set_global_assignment -name SEED ${i}\n" >> ${quartusdir}/${project_rev}.qsf
unb_info $0 "Performing full compile of project ${project_rev}" unb_info $0 "Performing full compile of project ${project_rev}"
quartus_sh $mem_width --flow compile ${project_rev} quartus_sh $mem_width --flow compile ${project_rev}
if [ $? -eq 0 ]
then
unb_info $0 "Full compile successful."
else
unb_error $0 "Full compile failed."
fi
if [ -z "${CLK}" ]
then
:
else
fmax_str=`quartus_fmax.sh ${quartusdir}/${project_rev}.sta.rpt $CLK`
fmax=`echo $fmax_str | cut -f1 -d"." | sed 's/[^0-9]//g'`
unb_info $0 "fMax of ${CLK}: ${fmax} MHz"
cp -r ${quartusdir} ${quartusdir}_${fmax}MHz
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment