blob: d393e1b23f8b7ab33cb3a25265a0aef1207231bc [file] [log] [blame]
#!/bin/bash
export RUNSET_DIR=$(cd ./V1.3.0/PEX/xRC; pwd)
export PDK_HOME=$(cd ./V1.3.0; pwd)
export LOG
export JOB_NAME
export JOB_HOME
#Sets the LOG variable and creates the log directory if it doesn't exist.
if [ ! -d ./log ]; then
mkdir log
LOG=./log
else
LOG=./log
fi
#Removes the outputs if the script is run again. Otherwise it creates the output directory and all of its subdirectories
if [ ! -d "./output/" ]; then
echo "Making output directory...."
mkdir -p output/{report,ext,pex,spice,pxi}
else
echo "Building Directories...."
mkdir -p output/{report,ext,pex,spice,pxi}
fi
#If the gds files weren't generated, this if statement extracts all of the gds files from the cells within the lib folder.
if [ ! -d "../lib/gds" ]; then
cd ../lib/magic
./extract_all
cd -
fi
cd ../lib/gds
JOB_HOME=$PWD
cd -
if [ ! -z "$1" ]; then
export i=$(echo $1 | cut -f 1 -d '.') #i is used as the input variable
else
export i="$(basename -s .gds $(ls $JOB_HOME/*.gds))" #i is used as the input variable
fi
#Loops through the input gds files. If no user input is supplied, all gds files are put through the DRC process.
for JOB_NAME in $i ; do
#Checks to make sure the file supplied exists. If not, then it exits the bash script.
if [ ! -e $JOB_HOME/$JOB_NAME.gds ]; then echo "Did not find '$JOB_HOME/$JOB_NAME.gds'"
exit 1
fi
echo -e "\nexport JOB_HOME='$JOB_HOME'"
echo -e "export JOB_NAME='$JOB_NAME'"
echo -e "====================================="
set -x #Turns on debugging
echo $PDK_HOME
calibre -gui -pex -runset $RUNSET_DIR/s8_xRC_runset -batch > $LOG/s8_pex_runset.log 2>&1
set +x #Turns off debugging
done #End of the loop
echo "Moving output files to ./output"
mv -v *.report ./output/report/
mv -v *.pex ./output/pex/
mv -v *.spice ./output/spice/
mv -v *.pxi ./output/pxi/
mv -v *.ext ./output/ext/
mv -v *erc* ./output/
mv -v _xrcControlFile_s8_ ./output/
mv -v svdb/ ./output/
mv -v *bat* ./output/
exit 0