######    ~edatools/setups/scripts/setupCDS.csh      David MacQuigg 02/11/04
#
# Instantly switch between tool setups by simply typing an alias.
# 
############################################################################
# Usage: Insert the following 2 lines in your .cshrc after setting the path:
#   alias cds 'source ~edatools/setups/scripts/setupCDS.csh'
#   # cds          # uncomment this line for automatic setup 
# Type 'cds' for a reminder of what aliases you have defined.
# Type 'cdsxxx <new cdsroot>' to switch to a root not yet on your list. 
# --------------------------------------------------------------------------
# Verification:
#       which icms    ( or whatever tool you plan to use )
#       cds_root icms ( Find root of hierarchy containing icms. )
# Cardinal rules: 
#   NEVER use    set path=($PATH /whatever)     <===this is hard to unset!
#   Bin order is critical. Don't mess with the approved sequences.
#   Keep you .cshrc CLEAN. All Cadence stuff should go in this setup script.
#   Keep paths simple.  Any more than 6 bins in your tools setup, and you
#     should think about running some tools in a separate shell.

############### ( user section ) ###########################################
## Add an alias for each setup: 
alias cdsECE 'setenv CDSHOME /opt/cadence; setup_onebin'
alias cds50  'setenv CDSHOME /opt/cadence/ic50;              \\
             setupICtools'
alias cds446 'setenv CDSHOME /opt/cadence/ic446;              \\
             setupICtools'
alias cdsxxx 'setenv CDSHOME \!:1; setupICtools'
alias cdsLDV 'setenv CDSHOME /usr3/cad/tools/IC50_sun4v;  \\
             setenv LDVHOME /net/hotfix/apps3/cds/LDV34_sun4v; \\
             setupCDSLDV'
alias cdsAMS 'setenv AMSHOME /net/ms_integ/cds/ams/s16; \\
             setenv CDSHOME /net/hotfix/apps3/cds/IC50MSR1_sun4v; \\
             setenv LDVHOME /net/hotfix/apps3/cds/LDV34_sun4v; \\
             setupAMS'
alias defaultsetup cds446

############## ( sysadmin section ) ########################################
## Aliases for each valid bin sequence:
alias setup_onebin 'set _cdsPath=($CDSHOME/bin); _cdsPathAdd'
alias setupICtools  ' \\
  set _cdsPath=($CDSHOME/tools/bin $CDSHOME/tools/dfII/bin); \\
      _cdsPathAdd'
alias setupIC_Assura  ' \\
  set _cdsPath=($CDSHOME/tools/bin $CDSHOME/tools/dfII/bin   \\
                $ASSURAHOME/tools/assura/bin); \\
      _cdsPathAdd'
alias setupCDSLDV  ' \\
  set _cdsPath=($CDSHOME/tools/bin $CDSHOME/tools/dfII/bin   \\
                $LDVHOME/tools{/bin,/dfII/bin,/verilog/bin}  \\
                $LDVHOME/tools/vtools/vfault/bin); \\
      _cdsPathAdd'
alias setupAMS  ' \\
  set _cdsPath=($CDSHOME/tools/bin $CDSHOME/tools/dfII/bin   \\
                $AMSHOME/tools/bin \\
                $LDVHOME/tools{/bin,/verilog/bin,/vtools/vfault/bin}); \\
      _cdsPathAdd'

############## ( don't touch ) #############################################
alias _cdsPathAdd 'set path=($_cdsPath $osPath); \\
  echo "  osPath = $osPath"; echo "  cdsPath = $_cdsPath"'
# show all aliases starting with cds.
echo ""; alias | grep ^cds 
echo ""
## Initial setup (one time only):
if (! $?osPath )  then
  set osPath = ($path)
  defaultsetup
endif
############## ( uncomment only what you need ) ############################
setenv CDS_LOG_VERSION sequential # To create CDS.log.1, CDS.log.2, etc.
# setenv CDS_TOP /cad  # Top of all things cad.
# setenv CDS_SITE $CDS_TOP/setups/site/dummy  # Bypass setup.loc
setenv CDS_LIC_FILE /opt/cadence/licenses/license.dat
setenv LM_LICENSE_FILE /opt/cadence/licenses/license.dat
# setenv LM_LICENSE_FILE $CDS_TOP/licenses/cds/license.dat   # Local License
# setenv CDS_LIC_FILE 5280@mammoth:5280@cds990:5280@cds906 # Network License
# setenv CDS_LIC_FILE 5280@sjflex3:5280@sjflex2:5280@sjflex1 # Network License
# setenv LM_LICENSE_FILE $CDS_TOP/licenses/antrim/license.dat   # Local License
# setenv ANTRIM /usr3/cad/antrim/v2002.4
## Some settings that should be moved to tool startup scripts:
# setenv CDS_Netlisting_Mode "Analog"
# setenv CDS_NUM_USER_COLORS 25
## Some temporary settings:
# setenv CDS_LIC_QA_TesT  /tmp/licensetrace.log # to debug license issues
# setenv LD_LIBRARY_PATH /usr/dt/lib:/etc/lib:/usr/X11/lib:$OPENWINHOME/lib:/usr/lib:$cdsBase/tools/lib
# setenv SPECTRE_DEFAULTS "-E +l %C:r.out"
# Verilog-A include file directory overide:
# setenv CDS_VLOGA_INCLUDE /net/
############## ( KPNS ) ####################################################
# 1) Path changes *after* running this script will be lost when any alias
#    from this script is invoked. $osPath is set once and never changed.
# 2) The \\ line continuation above may not work in some shells.  If
#    necessary, join into one long ugly line.
############## ( Change Log ) ##############################################
#8/24/02:
#1) Added variables $CDSHOME, $LDVHOME, $AMSHOME, etc.
#2) Restructured script so that all changes needed to add or delete a 
#   release are in one place in the "user section".
#3) Added an alias 'cdsxxx' which allows switching to a release without
#   even editing the script.
