1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
#!/usr/bin/tcsh -f
#----------------------------------------------------------
# Qflow layout GDS generation script using magic-8.0
#----------------------------------------------------------
# Tim Edwards, April 2013
#----------------------------------------------------------
if ($#argv < 2) then
echo Usage: display.sh [options] <project_path> <source_name>
exit 1
endif
# Split out options from the main arguments
set argline=(`getopt "nr" $argv[1-]`)
set options=`echo "$argline" | awk 'BEGIN {FS = "-- "} END {print $1}'`
set cmdargs=`echo "$argline" | awk 'BEGIN {FS = "-- "} END {print $2}'`
set argc=`echo $cmdargs | wc -w`
if ($argc == 2) then
set argv1=`echo $cmdargs | cut -d' ' -f1`
set argv2=`echo $cmdargs | cut -d' ' -f2`
else
echo Usage: display.sh [options] <project_path> <source_name>
echo where
echo <project_path> is the name of the project directory containing
echo a file called qflow_vars.sh.
echo <source_name> is the root name of the verilog file, and
exit 1
endif
set projectpath=$argv1
set sourcename=$argv2
set rootname=${sourcename:h}
# This script is called with the first argument <project_path>, which should
# have file "qflow_vars.sh". Get all of our standard variable definitions
# from the qflow_vars.sh file.
if (! -f ${projectpath}/qflow_vars.sh ) then
echo "Error: Cannot find file qflow_vars.sh in path ${projectpath}"
exit 1
endif
source ${projectpath}/qflow_vars.sh
source ${techdir}/${techname}.sh
cd ${projectpath}
if (-f project_vars.sh) then
source project_vars.sh
endif
# Prepend techdir to gdsfile unless gdsfile begins with "/"
set abspath=`echo ${gdsfile} | cut -c1`
if ( "${abspath}" == "/" ) then
set gdspath=${gdsfile}
else
set gdspath=${techdir}/${gdsfile}
endif
# Prepend techdir to techfile unless techfile begins with "/"
set abspath=`echo ${techfile} | cut -c1`
if ( "${abspath}" == "/" ) then
set techpath=${techfile}
else
set techpath=${techdir}/${techfile}
endif
#----------------------------------------------------------
# Done with initialization
#----------------------------------------------------------
cd ${layoutdir}
#---------------------------------------------------
# Generate GDS from the magic file. This time,
# we do not read the LEF file, so that we pick
# up the vendor GDS database for the standard
# cells.
#
# Use magic version 8.0 to make nice labels
#---------------------------------------------------
${bindir}/magic -dnull -noconsole -T ${techpath} <<EOF
drc off
box 0 0 0 0
snap int
gds readonly true
gds rescale false
gds read ${gdspath}
def read ${rootname}
gds write ${rootname}
quit -noprompt
EOF
#------------------------------------------------------------
# Done!
#------------------------------------------------------------
|