\subsubsection{Name}

Stratus -- Procedural design language based upon \emph{Python}

\subsubsection{Description}

\emph{Stratus} is a set of \emph{Python} methods/functions dedicated to procedural generation purposes. From a user point of view, \emph{Stratus} is a circuit's description  language that allows \emph{Python} programming flow control, variable use, and specialized functions in order to handle vlsi objects.\\

\indent Based upon the \emph{Hurricane} data structures, the \emph{Stratus} language gives the user the ability to describe netlist and layout views.

\subsubsection{Creation of a cell}

A cell is a hierachical structural description of a circuit in terms of ports (I/Os), signals (nets) and instances.\\
     
\indent The creation of a cell is done by creating a new class, derivating for class \verb-Model-, with different methods :

\begin{itemize}
\item Method \verb-Interface- : Description of the external ports of the cell :
    \begin{itemize}
        \item SignalIn, SignalOut, ...
    \end{itemize}
\item Method \verb-Netlist- : Description of the netlist of the cell :
    \begin{itemize}
        \item Inst, Signal
    \end{itemize}
\item Method \verb-Layout- : Description of the layout of the cell :
    \begin{itemize}
        \item Place, PlaceTop, PlaceBottom, PlaceRight, PlaceLeft ...
    \end{itemize}
\end{itemize}

\indent Two methods are provided :
\begin{itemize}
    \item Method \verb-View- : Opens/Refreshes the editor in order to see the created layout
    \item Method \verb-Save- : Saves the created cell
    \begin{itemize}
        \item no argument : creation of a netlist file (format file thanks to CRL\_OUT\_LO)
        \item PHYSICAL : creation of a netlist file AND a layout file (format files thanks to CRL\_OUT\_LO and CRL\_OUT\_PH)
        \item STRATUS : creation of a python/stratus file
        \begin{itemize}
            \item FileName : optionnal argument when using Save(STRATUS) in order to choose the name of the file to be generated
            \item Be careful : if one wants to create a stratus file AND a netlist, always use Save(STRATUS) before Save() !
        \end{itemize}
    \end{itemize}
\end{itemize}

\subsubsection{Syntax}

A \emph{Stratus} file must have a .py extension and must begin as follow :
\begin{verbatim}
#!/usr/bin/env python

from stratus import *
\end{verbatim}

\indent The creation of a class is done as follow :
\begin{verbatim}
class myClass ( Model ) :
    ...
    
exemple = myClass ( name, param )
\end{verbatim}

\indent In order to execute a \emph{Stratus} file (named \verb-file- for example), one has two choices :
\begin{verbatim}
python file.py
\end{verbatim}
\indent Or :
\begin{verbatim}
chmod u+x file.py
./file.py
\end{verbatim}

\indent The names used in \emph{Stratus}, as arguments to \emph{Stratus} functions, should be alphanumerical, including the underscore. The arguments of \emph{Stratus} are case sensitive, so \textsc{VDD} is not equivalent to \textsc{vdd}.\\
    
\indent Vectorized connectors or signal can be used using the \textsc{[n:m]} construct.\\

\subsubsection{Syntax highlighting}

When using vi, it's possible to have the right syntax highlighting when using vi :

\begin{itemize}
    \item Commands to do when you want to change once the coloration of your file :
\end{itemize}
\begin{small}
\begin{verbatim}
:syntax off
:source /asim/coriolis/share/etc/stratus.vim
\end{verbatim}
\end{small}
\begin{itemize}
    \item Modification of your .vimrc in order to have the syntax highlighting each time you open a file :
\end{itemize}
\begin{small}
\begin{verbatim}
syntax off
autocmd BufRead,BufNewfile *.py so /asim/coriolis/share/etc/stratus.vim
syntax on
\end{verbatim}
\end{small}
        
\subsubsection{Environment variables}

\begin{itemize}
    \item CRL\_IN\_LO, default value : \verb-def-
    \item CRL\_OUT\_LO, default value : \verb-def-
    \item CRL\_IN\_PH, default value : \verb-def-
    \item CRL\_OUT\_PH, default value : \verb-def-
    \item CRL\_CATA\_LIB, default value : \verb-.-
    \item CRL\_CATAL\_NAME, default value : \verb-CATAL-
\end{itemize}

\begin{htmlonly}

\subsubsection{Example}

You can see a concrete example at : \hyperref[ref]{\emph{Example}}{}{Example}{secexample}

\subsubsection{See Also}

\hyperref[ref]{\emph{Netlist}}{}{Netlist}{secnetlist}
\hyperref[ref]{\emph{Layout}}{}{Layout}{seclayout}
\hyperref[ref]{\emph{Place and Route}}{}{Place and Route}{secroute}
\hyperref[ref]{\emph{Virtual libraty}}{}{Virtual library}{seclibrary}
\hyperref[ref]{\emph{Instanciation facilities}}{}{Instanciation facilities}{secfacilities}

\end{htmlonly}
