Monday, October 26, 2009

setting the Cadence environment variables from script (how to)?




NOTE: This script was tested, see the images above, you can change it according to your needs.

### setup.IC
# NC // Linux 64 bit Machine 
# to run this script switch from "bash" to "tcsh" OR "csh"
# Example:
# bash_linux_prompt:> tcsh (if not installed tcsh try "csh", else, install one of them, better is to install "tcsh".)
# to install: as root run this command: zypper in tcsh (see google how to install on opensuse) ;)
# tcsh(or csh)_linux_prompt:> source /setup.IC
# tcsh(or csh)_linux_prompt:> icfb &
# the CIW should start ...

# NOTES:
# =. After instalation make sure that you have the follow link in :
#    ln -s tools./platform/ tools
# =. Tooladmin's customizable .cdsinit should be in ${CDS_ROOT}/.cdsinit
# =. The follow line need to be present in $HOME/.cdsinit if you have to run Calibre
#    load("$MGC_HOME/shared/pkgs/icv.ss6/tools/queryskl/calibre.skl")


############################
##        Cadence         ##
## Custom IC Design Tools ##
############################


setenv OS_TYPE   `/bin/uname -s`
setenv HOSTNAME  `/bin/hostname`


#############
## License ##
#############

# NOTE: change the line bellow according to your needs (this is the license path?)
setenv CDS_LIC_FILE /usr/licensas/license_cadence.dat


###############
##  Cadence  ##
##   Setup   ##
###############

if ( $OS_TYPE == 'Linux' ) then
   version_:
# -------------------------------
   echo "=========================================="
   echo "        __== Owner /your_name/ ==__"
   echo "------------------------------------------"
   echo "Custom IC Design Tools ver. 5.1.41     [1]"
   echo "Custom IC Design Tools ver.  6.10      [2]"
#  echo "Custom IC Design Tools ver. ...        [3]"
#  echo "Custom IC Design Tools ver. ...        [4]"
   echo "------------------------------------------"
# -------------------------------
   echo " "
   echo -n "Select version ([q] - quit; default [1]): "
   set ver=$<
   echo " "
   echo "========================="
   echo "INFO: "
# -------------------------------
   if ( $ver == q ) then 
       echo "Exit: DONE!"  
       echo "========================="
       exit 1
   else if ( $ver == 1 || $ver == "" ) then
      setenv CDS_ROOT  /usr/tools/cad/cadence/ic5141/current
      set vername="IC 5.1.41"
      echo "The version is: $vername => License path is: CDS_LIC_FILE = $CDS_LIC_FILE"
      echo "Done!"
   else if ( $ver == 2 ) then
#   Note: configure the path for IC610 version ...
    echo " ---------------------"
    echo "NOTE: You haven't yet configured this script to run IC610 version!"
    echo " -->  Need your intervention!"
    echo "      Please, set the correct path CDS_ROOT and CDS_LIC_FILE (if needed)"
    echo " ---------------------"
#    setenv CDS_ROOT  where_is_your_ic610? 
#    setenv CDS_LIC_FILE 
    set vername="IC 610"
    echo "The version is: $vername => License path is: CDS_LIC_FILE = $CDS_LIC_FILE"
    echo "Done!"
# -------------- have more versions? --------
#   else if ( $ver == 3 ) then
#      setenv CDS_ROOT  
#    set vername="IC xyz"
#    echo "The version is: $vername => License path is: CDS_LIC_FILE = $CDS_LIC_FILE"
#   else if ( $ver == 4 ) then
#      setenv CDS_ROOT  
#    set vername="IC xyz"
#    echo "The version is: $vername => License path is: CDS_LIC_FILE = $CDS_LIC_FILE"
   else
      echo "Wrong version!"
      goto version_
   endif
endif
# ------------------------
#   Is your machine 64 BIT? (some feature in Cadence can be switched to 64 BIT /Layout, spectre, etc. see documentation/)
#   if ( $HOSTNAME == 'your_hostname_here' ) then
#      setenv CDS_AUTO_64BIT  ALL
#   else
#      setenv CDS_AUTO_64BIT  NONE
#   endif

echo " "
echo "========================="
#echo "Comment this if solved"
echo "Note: Try 'setenv LD_ASSUME_KERNEL 2.6.19'"
echo "Cadence set this variable in 'icfb' startup script"
echo "You should change it in the startup script"
echo "if not, the setenv is overwriten, resulting no effect!"
echo "========================="

### Variables
# ------------------------
setenv CDS_INST_DIR                    $CDS_ROOT/tools/dfII
setenv CDS_LIB_PATH                    ${CDS_ROOT}/tools/lib:${CDS_ROOT}/lib:${CDS_ROOT}/dfii/lib:${CDS_ROOT}/spectre/lib/mdl
setenv CDS_Netlisting_Mode             Analog                                ;# also can be: Digital or Compatibility
setenv CDS_NUM_USER_COLORS             85
setenv CDS_SITE                        $CDS_ROOT/share
setenv CDS_USE_PRIVATE_CAMP            True
setenv CDS_VHDL                        $CDS_ROOT/tools/leapfrog
setenv CLS_CDSD_COMPATIBILITY_LOCKING  NO
setenv SPECTRE_DEFAULTS                " +param $CDS_ROOT/tools/spectre/etc/limits/range.lmts"
setenv TNT_INST_DIR                    $CDS_ROOT


### Libraries
# ------------------------
if ( $?LD_LIBRARY_PATH ) then
    if ( $LD_LIBRARY_PATH == "" ) then
 setenv LD_LIBRARY_PATH ${CDS_LIB_PATH}
    endif
    if ( $LD_LIBRARY_PATH !~ *${CDS_LIB_PATH}*) then
 setenv LD_LIBRARY_PATH ${CDS_LIB_PATH}:${LD_LIBRARY_PATH}
    endif
else
    setenv LD_LIBRARY_PATH  ${CDS_LIB_PATH}
endif


### Mans
# ------------------------
if ( $?MANPATH ) then
    if ( $MANPATH == "" ) then
 setenv  MANPATH ${CDS_ROOT}/share/man:${CDS_ROOT}/tools/stream_mgt/man
    endif
    if ( $MANPATH !~ *${CDS_ROOT}/share/man*) then
 setenv  MANPATH ${CDS_ROOT}/share/man:${MANPATH}
    endif
    if ( $MANPATH !~ *${CDS_ROOT}/tools/stream_mgt/man*) then
        setenv  MANPATH ${CDS_ROOT}/tools/stream_mgt/man:${MANPATH}
    endif
else
 setenv  MANPATH ${CDS_ROOT}/share/man:${CDS_ROOT}/tools/stream_mgt/man
endif


### Paths
# ------------------------
if ( " $path" !~ *\ ${CDS_ROOT}/tools/bin\ * ) then
set path = ($CDS_ROOT/tools/bin $path)
endif
if ( " $path" !~ *\ ${CDS_ROOT}/tools/concice/bin\ * ) then
set path = ($CDS_ROOT/tools/concice/bin $path)
endif
if ( " $path" !~ *\ ${CDS_ROOT}/tools/plot/bin\ * ) then
set path = ($CDS_ROOT/tools/plot/bin $path)
endif
if ( " $path" !~ *\ ${CDS_ROOT}/tools/dracula/bin\ * ) then
set path = ($CDS_ROOT/tools/dracula/bin $path)
endif
if ( " $path" !~ *\ ${CDS_ROOT}/tools/dfII/bin\ * ) then
set path = ($CDS_ROOT/tools/dfII/bin $path)
endif

# ------------------------
# NOTES:
# =. After instalation make sure that you have the follow link in :
#    ln -s tools./platform/ tools
# =. Tooladmin's customizable .cdsinit should be in ${CDS_ROOT}/.cdsinit
# =. The follow line need to be present in $HOME/.cdsinit if you have to run Calibre
#    load("$MGC_HOME/shared/pkgs/icv.ss6/tools/queryskl/calibre.skl")

No comments:

Post a Comment