#!/bin/sh # # sdl_prep V 2.0 10/25/96 # ################################################################### # # program: sdl_prep # purpose: Prepare SDL schematic for analog simulation and layout. # input: # output: viewpoint sdl # authors: David M. Zar # ################################################################### version="2.0" ################################################################# # function: help ################################################################### help() { cat < [ -technology -verbose -help ] where is the name of your mentor design directory -technology - 2.0 1.2 0.8 0.6 where the default is 0.8 -verbose - Run the script in verbose mode. All output messages will be shown on monitor as well as piped to sdl_prep.log file. -help - Displays this message Note: Your MGC_WD environment variable must be set to the location of your design. Examples: sdl_prep mydesign sdl_prep mydesign -verbose sdl_prep me_design -0.8 EOF help_ret=1 return_code } ################################################################# # function: return_code ################################################################# return_code() { if [ $ret -ne 0 ]; then if [ $program = "none" ] ; then echo "Errors found." echo "Check sdl_prep.log file." else echo "Errors found while running $program." echo "Check sdl_prep.log file." fi fi rm -f $mmgc_wd/.retcode echo $ret > $mmgc_wd/.retcode MGC_WD=$old_mgc_wd export MGC_WD echo "sdl_prep ended with return code " $ret echo "Done." exit $ret } ################################################################### rm_run() { program="rm" cmd="rm -f $1" echo "$cmd" echo "$cmd" >> $log_file 2>&1 $cmd >> $log_file 2>&1 ret=$? if [ $ret -ne 0 ]; then return_code fi } ################################################################# # start main shell ################################################################# cat <> $log_file 2>&1 ret=1 help fi if [ ! -d $mmgc_wd ]; then echo "Error: MGC_WD = $mmgc_wd , directory not found." echo "Error: MGC_WD = $mmgc_wd , directory not found." >> $log_file 2>&1 ret=1 help fi if [ null$MGC_HOME = "null" ]; then echo "Error: MGC_HOME needs to be set to the MGC_HOME tree." echo "Error: MGC_HOME needs to be set to the MGC_HOME tree." >> $log_file 2>&1 echo "" ret=1 help fi if [ ! -d $MGC_HOME ]; then echo "Error: MGC_HOME = $MGC_HOME , directory not found!" echo "Error: MGC_HOME = $MGC_HOME , directory not found!" >> $log_file 2>&1 echo "" ret=1 help fi ################################################################# # check command line options and arguments ################################################################# if [ null$design = "null" ]; then echo "Error: not specified on command line" echo "Error: not specified on command line" >> $log_file 2>&1 ret=1 help fi if [ ! -d $design ]; then echo "Error: = $design , directory not found!" echo "Error: = $design , directory not found!" >> $log_file 2>&1 echo "" ret=1 help fi ################################################################### # function: if verbose option is specified then start the tail # process. # input: sdl_prep.log # output: ################################################################### if [ $verbose_opt = "true" ]; then echo "tail -f " $log_file " &" >> $log_file 2>&1 tail -f $log_file & trap return_code 2 tail_flag="true" fi ######################## Main Design Flow ######################## ######################## dve #################################### ################################################################### # function: run dve on $design # condition: dve needs to be run only once. # If $design/sdl.Eddm_design_viewpoint.attr file exists, # then don't run dve. # input: $design # output: $design/sdl.Eddm_design_viewpoint.attr ################################################################### if [ ! -f ${design}/sdl.Eddm_design_viewpoint.attr ]; then program="dve" echo "dve $design" echo "dve $design" >> $log_file 2>&1 dve $design -nodisplay < /dev/null ret=$? if [ $ret -eq 0 ] ; then ret=1 return_code fi fi ###################################################################