#! /bin/sh

# This uses Virtuoso to create the WRspice environment file, as
# WRspiceCdsenvFile.

# The WRspice context files should be up to date, i.e., mkcx should be
# run before running this script.

# Running requires an OASIS development license from Cadence.

# Usage:  ./mkcdsenv

# First back up existing files.

if [ -f WRspiceCdsenvFile ]; then
    mv -f WRspiceCdsenvFile WRspiceCdsenvFile.bak
fi

# Create temporary script file.

cat << EOF > tmp.il
\i asiCreateCdsenvFile('WRspice)
\i exit()
EOF

# Call Virtuoso to do the work, and discard the temporary script.

virtuoso -replay ./tmp.il -nograph
rm tmp.il

