\hypertarget{classpython_1_1Stack_1_1Stack}{\section{Stack Class Reference}
\label{classpython_1_1Stack_1_1Stack}\index{Stack@{Stack}}
}


Draw a \hyperlink{classpython_1_1Stack_1_1Stack}{Stack} of Transistors.  




Inherits object.

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
def \hyperlink{classpython_1_1Stack_1_1Stack_ac775ee34451fdfa742b318538164070e}{\-\_\-\-\_\-init\-\_\-\-\_\-}
\begin{DoxyCompactList}\small\item\em {\bfseries \mbox{[}A\-P\-I\mbox{]}} Constructor \end{DoxyCompactList}\item 
def \hyperlink{classpython_1_1Stack_1_1Stack_ad7f0300aaad3ad8b2de70ae6c106c102}{set\-Wirings}
\begin{DoxyCompactList}\small\item\em {\bfseries \mbox{[}A\-P\-I\mbox{]}} Set the \hyperlink{classpython_1_1Stack_1_1Stack}{Stack} wiring specification. \end{DoxyCompactList}\item 
def \hyperlink{classpython_1_1Stack_1_1Stack_a20b46b43488cc58c302b123a89299d85}{compute\-Dimensions}
\begin{DoxyCompactList}\small\item\em {\bfseries \mbox{[}internal\mbox{]}} Compute \hyperlink{classpython_1_1Stack_1_1Stack}{Stack} dimensions from the technological rules. \end{DoxyCompactList}\item 
def \hyperlink{classpython_1_1Stack_1_1Stack_affc52c42a8c72dc1125ddce55647a6f9}{do\-Layout}
\begin{DoxyCompactList}\small\item\em {\bfseries \mbox{[}A\-P\-I\mbox{]}} Draw the complete layout. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Draw a \hyperlink{classpython_1_1Stack_1_1Stack}{Stack} of Transistors. 

A \hyperlink{classpython_1_1Stack_1_1Stack}{Stack} of Transistors is a set of transistor put into a regular band and connected through their sources/drains. All share the exact same W \& L. The way they are connecteds defines what functionnality the \hyperlink{classpython_1_1Stack_1_1Stack}{Stack} implement.

The abutment box of the stack is adjusted so that both height and width are even multiples of the track pitches, so the device can be easily placed and handled by the mixed router. The extra space needed for padding is added around the active area. Due to the presence of tracks at the top and bottom of the stack, the active area will be horizontally centered but {\bfseries not} vertically.

The drawing of the stack is controlled through a set of variables (attributes) that allows to create it regardless of the technology. The technology is taken into account in the way those variables are computed and, obviously, their values. The following schematics details the main stack drawing variables along with their computations.\hypertarget{classpython_1_1Stack_1_1Stack_secStackLayout}{}\subsection{Stack Layout}\label{classpython_1_1Stack_1_1Stack_secStackLayout}
\hypertarget{classpython_1_1Stack_1_1Stack_secGatePitch}{}\subsubsection{Gate pitch}\label{classpython_1_1Stack_1_1Stack_secGatePitch}

\begin{DoxyItemize}
\item {\ttfamily self.\-gate\-Pitch} \-: the pitch of transistors gates, inside the stack. It also applies to dummy transistors.
\end{DoxyItemize}

 
\begin{DoxyImage}
\includegraphics[width=.9\linewidth]{gate-pitch-1}
\caption{Gate Pitch}
\end{DoxyImage}
\hypertarget{classpython_1_1Stack_1_1Stack_secActiveSideWidth}{}\subsubsection{Active Side Width}\label{classpython_1_1Stack_1_1Stack_secActiveSideWidth}

\begin{DoxyItemize}
\item {\ttfamily self.\-active\-Side\-Width} \-: the distance between the axis of the last transistor gate (on the left or right) and the edge of the active area ({\itshape not} the diffusion area).
\end{DoxyItemize}

 
\begin{DoxyImage}
\includegraphics[width=.9\linewidth]{active-side-width-1}
\caption{Active Side Width}
\end{DoxyImage}
\hypertarget{classpython_1_1Stack_1_1Stack_secHTrackDistance}{}\subsubsection{H-\/\-Track Distance}\label{classpython_1_1Stack_1_1Stack_secHTrackDistance}

\begin{DoxyItemize}
\item {\ttfamily self.\-h\-Track\-Distance} \-: the minimal distance between either the top or bottom edge of the active area and the {\itshape axis} of the first track.
\end{DoxyItemize}

 
\begin{DoxyImage}
\includegraphics[width=.9\linewidth]{htrack-distance-1}
\caption{H-\/\-Track distance}
\end{DoxyImage}
\hypertarget{classpython_1_1Stack_1_1Stack_secOverallVariables}{}\subsubsection{Bounding\-Box \& Overall Variables}\label{classpython_1_1Stack_1_1Stack_secOverallVariables}

\begin{DoxyItemize}
\item {\ttfamily self.\-xpitches} \-: the number of vertical track pitches needed to fully enclose the active area.
\item {\ttfamily self.\-ypitches} \-: the number of horizontal track pitches needed to fully enclose the active area.
\item {\ttfamily self.\-active\-Offset\-X} \& {\ttfamily self.\-active\-Offset\-Y} \-: the offsets of the active area from the bottom left corner of the abutment box.
\item {\ttfamily self.\-diffusion\-Width} \& {\ttfamily self.\-diffusion\-Height} are the minimun dimensions required to fit the active area.
\item {\ttfamily self.\-top\-Tracks\-Nb()} \-: the number of tracks at the top of the stack.
\item {\ttfamily self.\-bot\-Tracks\-Nb()} \-: the number of tracks at the bottom of the stack.
\end{DoxyItemize}

 
\begin{DoxyImage}
\includegraphics[width=.9\linewidth]{stack-layout-3}
\caption{General Stack Layout}
\end{DoxyImage}
\hypertarget{classpython_1_1Stack_1_1Stack_secWiringSpecs}{}\subsection{Wiring Specifications}\label{classpython_1_1Stack_1_1Stack_secWiringSpecs}
\hyperlink{classpython_1_1Stack_1_1Stack}{Stack} routing is done through vertical {\ttfamily metal1} wires coming from the gates and diffusions areas and {\ttfamily metal2} horizontal wires that can be either above or below the active area. {\ttfamily metal2} wires (or track) goes through the whole stack and are assigned to one net only. A net will have at least one track above or below and may have both.

The connections to the diffusions areas and gates of the various fingers are specified through a list. The stack is made of a regular alternation of diffusions and gates. The list tells, for each one starting from the left, to which net and track they are connected. For a stack of $NFs$ transistor fingers, the must wiring specification must contains $ 3 + (NFs-1) \times 2$ elements. The list is given through one {\itshape string} with each elements separated by one or more whitespace. The syntax for {\itshape one} element is detailed \hyperlink{classpython_1_1Stack_1_1Stack_secAtomicWiring}{Atomic Wiring Specification}.

{\bfseries Track numbering scheme}

Tracks above (top) the active area and below (bottom) each have their own numbering. In both case, the count start {\itshape from} the active area. This, the top tracks will be numbered by increasing Y and the bottom tracks by {\itshape decreasing} Y.

{\bfseries Track/\-Net assignement}

The track/net assignement is deduced from the atomic wiring specifications. It also allows to compute the total number of tracks needed above and below the active area.

 
\begin{DoxyImage}
\includegraphics[width=.9\linewidth]{wiring-spec-2}
\caption{Wiring Specification}
\end{DoxyImage}
\hypertarget{classpython_1_1Stack_1_1Stack_secAtomicWiring}{}\subsubsection{Atomic Wiring Specification}\label{classpython_1_1Stack_1_1Stack_secAtomicWiring}
An atomic wiring specification has the same syntax for either diffusions or gates. It {\itshape must} not comprise any whitespaces. it is made of the following parts\-:
\begin{DoxyItemize}
\item The net name to connect to.
\item Whether the track is above the active area ({\ttfamily \char`\"{}t\char`\"{}}) or below ({\ttfamily \char`\"{}b\char`\"{}}). The special case ({\ttfamily \char`\"{}z\char`\"{}}) means that this element must be left unconnected (is such case possible?).
\item The number of the track.
\end{DoxyItemize}

 
\begin{DoxyImage}
\includegraphics[width=.4\linewidth]{wiring-spec-1}
\caption{Atomic Wiring Specification}
\end{DoxyImage}
\hypertarget{classpython_1_1Stack_1_1Stack_secStackImplDetails}{}\subsection{Stack Implementation Details}\label{classpython_1_1Stack_1_1Stack_secStackImplDetails}
The {\ttfamily \-\_\-\-\_\-setattr\-\_\-\-\_\-()} and {\ttfamily \-\_\-\-\_\-getattr\-\_\-\-\_\-} functions have been redefined so that the technological values (rules) can be accessed has normal attributes of the \hyperlink{classpython_1_1Stack_1_1Stack}{Stack} class, in addition to the regular ones. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classpython_1_1Stack_1_1Stack_ac775ee34451fdfa742b318538164070e}{\index{python\-::\-Stack\-::\-Stack@{python\-::\-Stack\-::\-Stack}!\-\_\-\-\_\-init\-\_\-\-\_\-@{\-\_\-\-\_\-init\-\_\-\-\_\-}}
\index{\-\_\-\-\_\-init\-\_\-\-\_\-@{\-\_\-\-\_\-init\-\_\-\-\_\-}!python::Stack::Stack@{python\-::\-Stack\-::\-Stack}}
\subsubsection[{\-\_\-\-\_\-init\-\_\-\-\_\-}]{\setlength{\rightskip}{0pt plus 5cm}def \-\_\-\-\_\-init\-\_\-\-\_\- (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{device, }
\item[{}]{N\-E\-R\-C, }
\item[{}]{N\-I\-R\-C}
\end{DoxyParamCaption}
)}}\label{classpython_1_1Stack_1_1Stack_ac775ee34451fdfa742b318538164070e}


{\bfseries \mbox{[}A\-P\-I\mbox{]}} Constructor 

param rules The physical rule set. 
\begin{DoxyParams}{Parameters}
{\em device} & The {\bf Hurricane} A\-M\-S device into which the layout will be drawn. \\
\hline
{\em N\-E\-R\-C} & Number of contact rows in external (first \& last) diffusion connectors. \\
\hline
{\em N\-I\-R\-C} & Number of contact rows in middle diffusion connectors. param w The {\bfseries width} of every transistor of the stack (aka {\itshape fingers}). param L The {\bfseries length} of every transistor. param N\-Fs The total number of fingers (dummies includeds). param N\-Ds The number of dummies to put on each side of the stack. \\
\hline
\end{DoxyParams}


References Stack.\-b\-Implant\-Layer, Stack.\-bot\-Tracks, Stack.\-bot\-W\-Tracks, Stack.\-bulk\-Net, Stack.\-bulks, Stack.\-device, Stack.\-dimensioned, Bulk.\-flags, Stack.\-flags, Stack.\-is\-Nmos(), Stack.\-L, Stack.\-meta\-Tnb(), Stack.\-meta\-Transistors, Stack.\-N\-Ds, Stack.\-N\-E\-R\-C, Stack.\-N\-Fs, Stack.\-N\-I\-R\-C, Stack.\-t\-Implant\-Layer, Stack.\-top\-Tracks, Stack.\-top\-W\-Tracks, Stack.\-w, Stack.\-well\-Layer, and Stack.\-wirings.



\subsection{Member Function Documentation}
\hypertarget{classpython_1_1Stack_1_1Stack_ad7f0300aaad3ad8b2de70ae6c106c102}{\index{python\-::\-Stack\-::\-Stack@{python\-::\-Stack\-::\-Stack}!set\-Wirings@{set\-Wirings}}
\index{set\-Wirings@{set\-Wirings}!python::Stack::Stack@{python\-::\-Stack\-::\-Stack}}
\subsubsection[{set\-Wirings}]{\setlength{\rightskip}{0pt plus 5cm}def set\-Wirings (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{wiring\-Spec}
\end{DoxyParamCaption}
)}}\label{classpython_1_1Stack_1_1Stack_ad7f0300aaad3ad8b2de70ae6c106c102}


{\bfseries \mbox{[}A\-P\-I\mbox{]}} Set the \hyperlink{classpython_1_1Stack_1_1Stack}{Stack} wiring specification. 


\begin{DoxyParams}{Parameters}
{\em wiring\-Spec} & A string defining the connections for the gates and diffusion areas.\\
\hline
\end{DoxyParams}
For a comprehensive explanation of the wiring specification, refers to \hyperlink{classpython_1_1Stack_1_1Stack_secWiringSpecs}{Wiring Specifications} . 

References Stack.\-bot\-Tracks, Stack.\-bot\-Tracks\-Nb(), Stack.\-bot\-W\-Tracks, Stack.\-bulk\-Net, Stack.\-compute\-Dimensions(), Stack.\-device, Stack.\-dimensioned, Stack.\-e\-Diff\-Metal1\-Width, Bulk.\-flags, Stack.\-flags, Stack.\-gate\-Pitch, Stack.\-get\-Bot\-Track\-Y(), Stack.\-get\-Horizontal\-Width(), Stack.\-hor\-Pitch, Stack.\-L, Stack.\-metal1\-To\-Gate, Stack.\-meta\-Transistors, Stack.\-side\-Active\-Width, Stack.\-top\-Tracks, Stack.\-top\-Tracks\-Nb(), Stack.\-top\-W\-Tracks, Stack.\-wirings, and Stack.\-ypitches.

\hypertarget{classpython_1_1Stack_1_1Stack_a20b46b43488cc58c302b123a89299d85}{\index{python\-::\-Stack\-::\-Stack@{python\-::\-Stack\-::\-Stack}!compute\-Dimensions@{compute\-Dimensions}}
\index{compute\-Dimensions@{compute\-Dimensions}!python::Stack::Stack@{python\-::\-Stack\-::\-Stack}}
\subsubsection[{compute\-Dimensions}]{\setlength{\rightskip}{0pt plus 5cm}def compute\-Dimensions (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}}\label{classpython_1_1Stack_1_1Stack_a20b46b43488cc58c302b123a89299d85}


{\bfseries \mbox{[}internal\mbox{]}} Compute \hyperlink{classpython_1_1Stack_1_1Stack}{Stack} dimensions from the technological rules. 

{\bfseries Internal function.} Perform the computation of\-:
\begin{DoxyItemize}
\item {\ttfamily self.\-metal1\-Pitch} 
\item {\ttfamily self.\-min\-Width\-\_\-metal1} 
\item {\ttfamily self.\-metal2\-Pitch} 
\item {\ttfamily self.\-min\-Width\-\_\-metal2} 
\item {\ttfamily self.\-gate\-Pitch} 
\item {\ttfamily self.\-side\-Active\-Width} 
\item {\ttfamily self.\-h\-Track\-Distance} 
\item {\ttfamily self.\-xpitches} 
\item {\ttfamily self.\-ypitches} 
\item {\ttfamily self.\-active\-Offset\-X} 
\item {\ttfamily self.\-active\-Offset\-Y} 
\item {\ttfamily self.\-bounding\-Box} 
\end{DoxyItemize}

References Stack.\-active\-Box, Stack.\-active\-Offset\-X, Stack.\-active\-Offset\-Y, Stack.\-bb\-Height, Stack.\-bb\-Width, Stack.\-bot\-W\-Tracks, Stack.\-bounding\-Box, Stack.\-bulks, Stack.\-bulk\-Width, Stack.\-compute\-Layout\-Parasitics(), Stack.\-compute\-Stress\-Effect(), Stack.\-contact\-Diff\-Pitch, Stack.\-contact\-Diff\-Side, Stack.\-D\-G\-G, Stack.\-D\-G\-I, Stack.\-dimensioned, Stack.\-D\-M\-C\-G, Stack.\-D\-M\-C\-G\-T, Stack.\-D\-M\-C\-I, Stack.\-e\-Diff\-Metal1\-Width, Bulk.\-flags, Stack.\-flags, Stack.\-gate\-Pitch, Stack.\-gate\-Via1\-Pitch, Stack.\-get\-Bot\-Track\-Y(), Stack.\-get\-Horizontal\-Width(), Stack.\-get\-Last\-Top\-Track\-Y(), Stack.\-hor\-Pitch, Stack.\-h\-Track\-Distance, Stack.\-i\-Diff\-Metal1\-Width, Stack.\-is\-V\-H, Stack.\-L, Stack.\-metal1\-To\-Gate, Stack.\-metal2\-Pitch, Stack.\-metal2\-Techno\-Pitch, Stack.\-metal3\-Pitch, Stack.\-N\-E\-R\-C, Stack.\-N\-Fs, Stack.\-N\-I\-R\-C, Stack.\-side\-Active\-Width, Stack.\-tracks\-Nb\-Pitch(), Stack.\-v\-Bulk\-Distance, Stack.\-ver\-Pitch, Stack.\-w, Stack.\-wire1\-Width, Stack.\-wire2\-Width, Stack.\-wire3\-Width, Stack.\-wirings, Stack.\-xpitches, and Stack.\-ypitches.



Referenced by Capacitor\-Unit.\-create(), Stack.\-do\-Layout(), Rout\-Matched\-Capacitor.\-route(), and Stack.\-set\-Wirings().

\hypertarget{classpython_1_1Stack_1_1Stack_affc52c42a8c72dc1125ddce55647a6f9}{\index{python\-::\-Stack\-::\-Stack@{python\-::\-Stack\-::\-Stack}!do\-Layout@{do\-Layout}}
\index{do\-Layout@{do\-Layout}!python::Stack::Stack@{python\-::\-Stack\-::\-Stack}}
\subsubsection[{do\-Layout}]{\setlength{\rightskip}{0pt plus 5cm}def do\-Layout (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{bb\-Mode}
\end{DoxyParamCaption}
)}}\label{classpython_1_1Stack_1_1Stack_affc52c42a8c72dc1125ddce55647a6f9}


{\bfseries \mbox{[}A\-P\-I\mbox{]}} Draw the complete layout. 

Draw the commplete layout of the \hyperlink{classpython_1_1Stack_1_1Stack}{Stack}. 

References Stack.\-active\-Offset\-X, Stack.\-active\-Offset\-Y, Stack.\-bb\-Width, Stack.\-bot\-Tracks, Stack.\-bot\-W\-Tracks, Stack.\-bounding\-Box, Stack.\-bulk\-Net, Stack.\-bulks, Stack.\-bulk\-Width, Stack.\-compute\-Dimensions(), Stack.\-contact\-Diff\-Pitch, Stack.\-device, Stack.\-D\-G\-G, Stack.\-D\-G\-I, Stack.\-D\-M\-C\-G, Stack.\-D\-M\-C\-G\-T, Stack.\-D\-M\-C\-I, Stack.\-draw\-Active(), Stack.\-draw\-Gate(), Stack.\-draw\-Source\-Drain(), Stack.\-draw\-Well(), Stack.\-e\-Diff\-Metal1\-Width, Bulk.\-flags, Stack.\-flags, Stack.\-gate\-Pitch, Stack.\-gate\-Via1\-Pitch, Stack.\-get\-Bot\-Track\-Y(), Stack.\-get\-Horizontal\-Axis(), Stack.\-get\-Horizontal\-Width(), Stack.\-get\-Top\-Track\-Y(), Stack.\-get\-Wiring\-Width(), Stack.\-hor\-Pitch, Stack.\-i\-Diff\-Metal1\-Width, Stack.\-is\-Bot\-Track(), Stack.\-is\-V\-H, Stack.\-L, Stack.\-metal1\-To\-Gate, Stack.\-N\-E\-R\-C, Stack.\-N\-Fs, Stack.\-N\-I\-R\-C, Stack.\-side\-Active\-Width, Stack.\-t\-Implant\-Layer, Stack.\-top\-Tracks, Stack.\-top\-W\-Tracks, Stack.\-w, Stack.\-well\-Layer, Stack.\-wire1\-Width, Stack.\-wire2\-Width, Stack.\-wire3\-Width, and Stack.\-wirings.



The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Stack.\-py\end{DoxyCompactItemize}
