<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\subsubsection{Description}

The virtual library permits to create a cell and map it to different libraries without having to change it.
    
\subsubsection{List of the generators provided}

\begin{itemize}
    \item \verb-a2- : \verb-q &lt;= i0 &amp; i1-
    \item \verb-a3- : \verb-q &lt;= i0 &amp; i1 &amp; i2-
    \item \verb-a4- : \verb-q &lt;= i0 &amp; i1 &amp; i2 &amp; i3-
    \item \verb-na2- : \verb-nq &lt;= ~ ( i0 &amp; i1 )-
    \item \verb-na3- : \verb-nq &lt;= ~ ( i0 &amp; i1 &amp; i2 )-
    \item \verb-na4- : \verb-nq &lt;= ~ ( i0 &amp; i1 &amp; i2 &amp; i3 )-
    \item \verb-o2- : \verb-q &lt;= i0 &amp; i1-
    \item \verb-o3- : \verb-q &lt;= i0 &amp; i1 &amp; i2-
    \item \verb-o4- : \verb-q &lt;= i0 &amp; i1 &amp; i2 &amp; i3-
    \item \verb-no2- : \verb-nq &lt;= ~ ( i0 &amp; i1 )-
    \item \verb-no3- : \verb-nq &lt;= ~ ( i0 &amp; i1 &amp; i2 )-
    \item \verb-no4- : \verb-nq &lt;= ~ ( i0 &amp; i1 &amp; i2 &amp; i3 )-
    \item \verb-inv- : \verb-nq &lt;= ~ i-
    \item \verb-buf- : \verb-q &lt;= i-
    \item \verb-xr2- : \verb-q &lt;= i0 ^ i1-
    \item \verb-nxr2- : \verb-nq &lt;= ~ ( i0 ^ i1 )-
    \item \verb-zero- : \verb-nq &lt;= '0'-
    \item \verb-one- : \verb-q &lt;= '1'-
    \item \verb-halfadder- : \verb-sout &lt;= a ^ b- and \verb-cout &lt;= a &amp; b-
    \item \verb-fulladder- : \verb-sout &lt;= a ^ b ^ cin-\\\indent and \verb-cout &lt;= ( a &amp; b ) | ( a &amp; cin ) | ( b &amp; cin )-
    \item \verb-mx2- : \verb-q &lt;= (i0 &amp; ~cmd) | (i1 &amp; cmd)-
    \item \verb-nmx2- : \verb-nq &lt;= ~( (i0 &amp; ~cmd) | (i1 &amp; cmd) )-
    \item \verb-sff- : \verb-if RISE ( ck ) : q &lt;= i-
    \item \verb-sff2- : \verb-if RISE ( ck ) : q &lt;= (i0 &amp; ~cmd) | (i1 &amp; cmd)-
    \item \verb-sff3- : \verb-if RISE ( ck ) :-\\\verb- q &lt;= (i0 &amp; ~cmd0) | (((i1 &amp; cmd1)|(i2&amp;~cmd1)) &amp; cmd0)-
    \item \verb-ts- : \verb-if cmd : q &lt;= i-
    \item \verb-nts- : \verb-if cmd : nq &lt;= ~i-
\end{itemize}

\subsubsection{Mapping file}

The virtual library is mapped to the sxlib library. A piece of the corresponding mapping file is shown below.\\
\indent In order to map the virtual library to another library, on has to write a .xml file which makes correspond models and interfaces.\\
\indent Note that the interfaces of the cells must be the same (except for the names of the ports). Otherwise, one has to create .vst file in order to make the interfaces match.\\

\indent The environment variable used to point the right file is \verb-STRATUS_MAPPING_NAME-.

\begin{figure}[hbtp]
\centering
\latexhtml{\includegraphics[width=\textwidth]{images/xml}}
          {\includegraphics[width=\textwidth]{images/xml.png}}
\end{figure}

\subsubsection{Generators}

Some generators are also provided in order to use the cells of the library with nets of more than 1 bit. One has to upper the first letter of the model name in order to user those generators. What is simply done is a for loop with the bits of the nets. The parameter \verb-'nbit'- gives the size of the generator.

\subsubsection{Example}

\begin{itemize}
    \item Direct instanciation of a cell
\end{itemize}
\begin{verbatim}
for i in range ( 4 ) :
  Inst ( 'a2'
       , map = { 'i0'  : neti0[i]
               , 'i1'  : neti1[i]
               , 'q'   : netq[i]
               , 'vdd' : netvdd
               , 'vss' : netvss
               }
       )
\end{verbatim}

\begin{itemize}
    \item Instanciation of a generator
\end{itemize}
\begin{verbatim}
Generate ( 'A2', "my_and2_4bits", param = { 'nbit' : 4 } )
Inst ( 'my_and2_4bits'
     , map  = { 'i0'  : neti0
              , 'i1'  : neti1
              , 'q'   : netq
              , 'vdd' : vdd
              , 'vss' : vss
              }
     )
\end{verbatim}

\subsubsection{Errors}
    
Some errors may occur :
\begin{itemize}
    \item \verb-[Stratus ERROR] Inst : the model ... does not exist.-\\\verb-Check CRL_CATA_LIB.-\\The model of the cell has not been found. One has to check the environment variable.
    \item \verb-[Stratus ERROR] Virtual library : No file found in order to parse.-\\\verb-Check STRATUS_MAPPING_NAME.-\\The mapping file is not given in the environment variable.
\end{itemize} 

\begin{htmlonly}
\input{see_also}
\end{htmlonly}
</pre></body></html>