#/bin/csh
#
#################################################################
#Edited 09/17/2003 by Wai Hong Ho, added an alias for hspice
# to bypass a bug in get_arch which returns wrong os version
#
#Edited 07/17/2003 by Wai Hong Ho, added check to LD_LIBRARY_PATH
# Also changed HSPICE setup to use default version.
#
#Edited 08/29/2004 by Kyongsu Lee, modified env. paths for cadence &
# HSPICE.
#
#Edited 08/30/2004 by Peter A. Beerel, modified path for HSPICE
# to get around bug in get_arch which returned os version for which path
# to hspice does not exist. 
#
#Edited 06/26/2006 by Pankaj Golani, pointed the cadence setup file
#tothe newest cadence version as well as new license servers
#
#Edited 03/01/2007 by T.J. Kwon, modified path for latest
# DesignCompiler, NanoSim, PrimeTime, HSPICE
#
#Edited 02/01/2010 by Jeff Draper, modified path for Cadence
# setup
#
#Edited 03/10/2010 by Ko-Chung Tseng, added path for Cadence
#Conformal Logic Equivalence Checking
#################################################################

if ($?MANPATH) then
  setenv MANPATH ~ee577/cad/man:${MANPATH}
else
  setenv MANPATH ~ee577/cad/man:/usr/man:/usr/local/man
endif

setenv CAD_HOME ~ee577/cad

set path=($CAD_HOME/bin  $path )

################################################################

alias magic '~ee577/cad/bin/magic -d X11 -T SCN5M_SUBM_15_TSMC'
alias irsim '~ee577/cad/bin/irsim tsmc25.15.n99y.2.5.prm'
#alias mpla 'mpla -a -s pseudoCMOStemp -t ~ee577/cad/lib/mpla/p'


###############################################################
# License setup for Cadence tools
# License server - 1800@license.usc.edu
###############################################################
if ( ${?LM_LICENSE_FILE} )then
   echo "${LM_LICENSE_FILE}" | grep 1800@license.usc.edu >& /dev/null
   if ( $status != 0) then
	  setenv LM_LICENSE_FILE 1800@license.usc.edu:$LM_LICENSE_FILE
   endif
else
   setenv LM_LICENSE_FILE 1800@license.usc.edu
endif


###############################################################
# License setup for Synopsys tools
# Licesne server - 1900@license.usc.edu
# The License server used for Synopsys tools was changed to 
# 1900@license.usc.edu from 1800@license29.usc.edu on Aug 12, 2010
# This file was modified by Ehsan on Aug 14 to reflect that change
###############################################################
if ( ${?LM_LICENSE_FILE} )then
   echo "${LM_LICENSE_FILE}" | grep 1900@license.usc.edu >& /dev/null
   if ( $status != 0) then
	  setenv LM_LICENSE_FILE 1900@license.usc.edu:$LM_LICENSE_FILE
   endif
else
   setenv LM_LICENSE_FILE 1900@license.usc.edu
endif


###############################################################
# License setup for HSPICE
# License server - 1800@license.usc.edu
# The License server used for Hspice was changed to 
# 1800@license.usc.edu from 1700@license.usc.edu on Aug 12, 2010
# This file was modified by Ehsan on Aug 14 to reflect that change
###############################################################
if (  ${?LM_LICENSE_FILE} ) then
   echo ${LM_LICENSE_FILE} | grep 1900@license.usc.edu >& /dev/null
   if ( $status != 0  ) then
      setenv LM_LICENSE_FILE 1900@license.usc.edu:$LM_LICENSE_FILE
   endif
else
   setenv LM_LICENSE_FILE 1900@license.usc.edu
endif

################################################################
# Denali setup
###############################################################
setenv DENALI /usr/local/cadence/VIPCAT113/tools.lnx86/denali 

#################################################################
# Cadence setup
#################################################################

set CDS_INST_DIR = /usr/local/cadence/IC615
#set CDS_LICENSE_DIR = /usr/local/cadence/default/license.dir/2003

# set the line below for the location of the cadence hierarchy
set cdsPath=($CDS_INST_DIR/bin \
             $CDS_INST_DIR/tools/bin \
             $CDS_INST_DIR/tools/dfII/bin \
             $CDS_INST_DIR/tools/dfII/pvt/bin)

# for using NC-Verilog
if (${?LD_LIBRARY_PATH}) then
   if ("$LD_LIBRARY_PATH" !~ *"cadence/IFV82"*) then
     setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/cadence/IFV82/tools.lnx86/lib/
   endif   
else
   setenv LD_LIBRARY_PATH /usr/local/cadence/IFV82/tools.lnx86/lib/
endif

set path=(  /usr/local/cadence/IC615/tools/dfII/bin /usr/local/cadence/IFV82/tools.lnx86/bin /usr/local/cadence/IC615/tools/bin $path )

# use analog mode for netlisting
setenv CDS_Netlisting_Mode Analog

#################################################################
# Cadence Encounter (Place adn Route) setup
#################################################################
if (${?LD_LIBRARY_PATH}) then
   if ("$LD_LIBRARY_PATH" !~ *"cadence/SOC81"*) then
     setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/cadence/SOC81/tools/lib/
   endif
else
   setenv LD_LIBRARY_PATH /usr/local/cadence/SOC81/tools/lib/
endif

set path=(/usr/local/cadence/SOC81/bin/ $path )

#################################################################
# Cadence Conformal setup
#################################################################
#set path=(/usr/local/cadence/CONFRML8.1/bin/ $path)


##################################################################
# For use with XWin for Magic and Cadence tools
##################################################################
umask 022

if (${?LD_LIBRARY_PATH}) then

if ($?OPENWINHOME) then
  setenv LD_LIBRARY_PATH /usr/lib/X11:$OPENWINHOME/lib:/usr/lib:$LD_LIBRARY_PATH
else
  setenv LD_LIBRARY_PATH /usr/lib/X11:$LD_LIBRARY_PATH
  #setenv LD_LIBRARY_PATH /usr/lib/X11:/usr/lib:$LD_LIBRARY_PATH
endif

else

if ($?OPENWINHOME) then
  setenv LD_LIBRARY_PATH /usr/lib/X11:$OPENWINHOME/lib:/usr/lib
else
  setenv LD_LIBRARY_PATH /usr/lib/X11:/usr/lib
endif

endif

#################################################################
# HSPICE setup
#################################################################

######### HSPICE Global environment variable Thu Feb 22 11:59:59 PDT 2007 #########
# Using FLEXlm license file

setenv installdir /usr/local/synopsys/2011.09/hspice

unsetenv LANG
unsetenv LC_ALL

setenv ARCH      `$installdir/bin/get_arch -q`
setenv HSP_HOME   $installdir
set path = ( $HSP_HOME/$ARCH \
             $HSP_HOME/bin \
             $HSP_HOME/$ARCH/veriloga_utils/veriloga/include \
             $path )
######### End of Global section ##########

#setenv SNPS_SIMIF /usr/usc/synopsys/2006.09/hspice
#if ( "$PATH" !~ *":${SNPS_SIMIF}/bin"* ) then
#       set path = ( $path ${SNPS_SIMIF}/bin )
#endif

if ( $?MANPATH ) then
    if ( "$MANPATH" !~ *"$installdir/docs:/usr/man:/etc/man"* ) then
       setenv MANPATH $installdir/docs:$MANPATH
    endif
else
    setenv MANPATH $installdir/docs:/usr/man:/etc/man
endif

#alias hspice $installdir/sparcOS5/hspice
alias mwaves $installdir/sparcOS5/awaves -laf motif
alias awaves $installdir/sparcOS5/awaves -laf motif

###############################################################
# Synopsys Tools setup
###############################################################
setenv SYNBASE /usr/local/synopsys/

# DesignCompiler
setenv SYNOPSYS_DC      $SYNBASE/2011.09
if ( "$PATH" !~ *":${SYNOPSYS_DC}/bin"* ) then
        set path = ( $path ${SYNOPSYS_DC}/bin )
endif
setenv MANPATH $SYNOPSYS_DC/doc/syn/man:$MANPATH

# PrimeTime
setenv SYNOPSYS_PT      $SYNBASE/primetime_suite
if ( "$PATH" !~ *":${SYNOPSYS_PT}/bin"* ) then
        set path = ( $path ${SYNOPSYS_PT}/bin )
endif
setenv MANPATH $SYNOPSYS_PT/doc/pt/man:$MANPATH

# NanoSim
setenv SYNOPSYS_NS      $SYNBASE/2011.09
if ( "$PATH" !~ *":${SYNOPSYS_NS}/nanosim/bin"* ) then
        set path = ( $path ${SYNOPSYS_NS}/nanosim/bin )
endif
setenv MANPATH $SYNOPSYS_NS/doc/ns/man:$MANPATH

#TETRAMAX
if ( "$PATH" !~ *":${SYNBASE}/2011.09/tetramax/bin"* ) then
        set path = ( $path ${SYNBASE}/2011.09/tetramax/bin)
endif

#Taurus-tsuprem4: This should be modified
if ( "$PATH" !~ *":${SYNBASE}/I_2013.12/taurus-tsuprem4_2013.12.0/bin"* ) then
        set path = ( $path ${SYNBASE}/I_2013.12/taurus-tsuprem4_2013.12.0/bin)
endif
###############################################################
# CosmoScope setup
###############################################################
setenv CSCOPE_PATH /usr/local/synopsys/cosmoscope
alias cscopedoc acroread $CSCOPE_PATH/doc/pdf_docs/CosmosScopeRef.pdf
alias cscope $CSCOPE_PATH/ai_bin/cscope
alias scope $CSCOPE_PATH/ai_bin/scope

if ( "$PATH" !~ *":${CSCOPE_PATH}/ai_bin"* ) then
  set path = ( $path ${CSCOPE_PATH}/ai_bin )
endif


################################################################
#setenv FSDB_ENV_NOVAS_LOCK on
# or
setenv FSDB_ENV_SYNC_CONTROL off


#################################################################
# Setting environment variable for NCSU design kit
#################################################################
setenv CDK_DIR  /home/scf-22/ee577/design_pdk/ncsu-cdk-1.6.0.beta
