diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex | 152 |
1 files changed, 139 insertions, 13 deletions
diff --git a/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex b/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex index 51901421f07..bf3ec67f415 100644 --- a/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex +++ b/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex @@ -1,3 +1,4 @@ +% Architectures examples: http://hal.archives-ouvertes.fr/docs/00/14/95/27/PDF/RR.pdf \pdfminorversion=5 \pdfobjcompresslevel=2 \documentclass{ltxdoc} @@ -8,11 +9,11 @@ \usepackage[ruled, lined,linesnumbered]{algorithm2e} %% Use the tikz package and loading the library -\usepackage{tikz} -\usetikzlibrary{switching-architectures} +%\usepackage{tikz} +%\usetikzlibrary{switching-architectures} %% Loading only the package -%\usepackage{sa-tikz} +\usepackage{sa-tikz} \usepackage{calc} \usepackage{imakeidx} @@ -50,8 +51,8 @@ /pdflinks/show labels=false, } \makeindex -\newcommand{\version}{0.5} -\newcommand{\versiondate}{January 3, 2013} +\newcommand{\version}{0.6} +\newcommand{\versiondate}{September 28, 2013} \title{\saTikZ\footnote{This package has version number \textit{v}\version\ of \versiondate; it is released under and subject to the \href{http://www.latex-project.org/lppl/}{\LaTeX\ Project Public License (LPPL)}.}} \author{Claudio Fiandrino \\ \small\href{mailto:claudio.fiandrino@gmail.com}{\texttt{claudio.fiandrino@gmail.com}}} @@ -63,7 +64,7 @@ \section*{Introduction} \addcontentsline{toc}{section}{Introduction} -The \saTikZ\ library helps in drawing \emph{switching-architectures}. In particular, one of its aims, is to help students to verify the correctness of their exercises, but it could also help teachers in preparing lecture notes. The repository of the library is \href{https://github.com/cfiandra/Sa-TikZ}{https://github.com/cfiandra/Sa-TikZ}. +The \saTikZ\ library helps in drawing \emph{switching-architectures}. In particular, one of its aims, is to help students to verify the correctness of their exercises. It could also help teachers in preparing lecture notes. The repository of the library is \href{https://github.com/cfiandra/Sa-TikZ}{https://github.com/cfiandra/Sa-TikZ}. The \saTikZ\ library can be loaded in the preamble by means of: \begin{flushleft} @@ -79,7 +80,7 @@ or by means of: \end{flushleft} In both cases the libraries \bgroup\color{red!75!black}\verb|calc|\egroup{}, \bgroup\color{red!75!black}\verb|positioning|\egroup\ and \bgroup\color{red!75!black}\verb|decorations.pathreplacing|\egroup\ are loaded automatically and in the latter case also the \Tikz\ package is loaded. -The version \textit{v}\version\ provides a way to draw Clos Networks Strictly-non-Blocking (snb) and Rearrangeable (rear) and Benes Networks; moreover, there is the possibility to fully customize the aspect of the network drawn starting from the dimensions of module, their distance and the font used. Finally, \saTikZ\ let the user to draw connections among the stages by accessing the single ports of the modules. +The version \textit{v}\version\ provides a way to draw Clos Networks Strictly-non-Blocking (snb) and Rearrangeable (rear), Benes Networks and Banyan Networks (in particular Omega\footnote{Implementation of Omega Networks by João Gabriel Reis.} and Flip Networks); moreover, the package provides the possibility to fully customize the aspect of the drawn network: the dimensions of module, their distance and the font used are some examples. Finally, \saTikZ\ let the user to draw connections among the stages by accessing the single ports of the modules. \section{Basic usage} The simplest use of the package is to define a @@ -99,6 +100,12 @@ with one of the following options \begin{key}{/tikz/benes complete} Option for drawing a Benes Network with the lowest level of recursion. \end{key} +\begin{key}{/tikz/banyan omega} + Option for drawing an Banyan-Omega Network. +\end{key} +\begin{key}{/tikz/banyan flip} + Option for drawing an Banyan-Omega Network with inverse shuffle exchange (Flip). +\end{key} inside a |tikzpicture| environment: \begin{environment}{{tikzpicture}\opt{\oarg{options}}} \end{environment} @@ -154,12 +161,32 @@ is a Benes Network in which there are 8 input and output ports. To draw a Benes The algorithm in which the internal connections of the |benes complete| networks are drawn is explained in detail in the appendix \ref{sec:benesconnalg}. +\subsection{Examples of Banyan Networks} + +The following examples show the two Banyan Network architectures handled by the library. + +\begin{minipage}{0.99\textwidth} +\tikzset{every node/.append style={scale=0.95,transform shape}} +\begin{codeexample}[] +\begin{tikzpicture} + % Omega Network on the left + \node[banyan omega] {}; + \begin{scope}[xshift=7.25cm] + % Flip network on the right + \node[banyan flip]{}; + \end{scope} +\end{tikzpicture} +\end{codeexample} +\tikzset{every node/.append style={scale=1,transform shape}} +\end{minipage} + \section{The options} \subsection{Designing choices} -This subsection illustrates which are the parameters that could be customized to draw Clos and Benes Networks. In particular: +This subsection illustrates which are the parameters that could be customized to draw Clos, Benes and Omega Networks. In particular: \begin{itemize} \item Clos Networks are analysed in \ref{subsubsec:clos}; -\item Benes Networks are analysed in \ref{subsubsec:benes}. +\item Benes Networks are analysed in \ref{subsubsec:benes}; +\item Banyan Networks are analysed in \ref{subsubsec:banyan}. \end{itemize} In each part the keys will be presented and simple examples will be provided. @@ -244,7 +271,26 @@ Here is an example of Benes Network with |P|=16: \end{tikzpicture} \end{codeexample} -It holds the same concept already said for Clos Networks: set the parameter |P| before declaring the \cs{node} be a |Benes| Network. +It holds the same concept already said for Clos Networks: set the parameter |P| before declaring the \cs{node} be a Benes Network. + + +\subsubsection{Banyan Networks} +\label{subsubsec:banyan} +Banyan Networks are architectures based on Benes Networks: they have particular interconnections properties. As well as Benes Networks, only the number of inputs and outputs ports can be selected and it is |P|. + +\saTikZ is able to represent Omega and Flip Banyan Networks. An example of $4\times 4$ |banyan omega| network: +\begin{codeexample}[] +\begin{tikzpicture} + \node[P=4,banyan omega] {}; +\end{tikzpicture} +\end{codeexample} + +An example of $4\times 4$ |banyan flip| network: +\begin{codeexample}[] +\begin{tikzpicture} + \node[P=4,banyan flip] {}; +\end{tikzpicture} +\end{codeexample} \subsection{Output customization} @@ -336,6 +382,16 @@ Here is a Benes Network $4 \times 4$ with an extremely large font size for the m \node[benes complete] {}; \end{tikzpicture} \end{codeexample} + +Consider the following $16 \times 16$ Omega Network: +\begin{codeexample}[] +\tikzset{module size=0.6cm,pin length factor=0.6, + module ysep=0.65, module xsep=3.5,} +\begin{tikzpicture}[P=32] + \node[banyan omega] {}; +\end{tikzpicture} +\end{codeexample} + \pagebreak An example of Benes Network $32 \times 32$: @@ -359,7 +415,11 @@ and its complete form: \section{Advanced usage} -In this section some more advanced examples are shown. +This section presents some more advanced examples. More in detail, it is described how to add elements to the basic architecture; elements can be: +\begin{itemize} +\item labels for the input and output ports; +\item paths interconnecting input and output ports. +\end{itemize} \subsection{Identifying front input/output ports} In this subsection it is shown how to reference the front input and output ports for the first and last stage. Each front input port could be accessed by means of: @@ -424,7 +484,7 @@ The same applies also for Benes Networks: } \end{tikzpicture} \end{codeexample} -and for the complete form: +and to the correspondent complete form: \begin{codeexample}[] \begin{tikzpicture} \node[benes complete={module label opacity=0}] {}; @@ -447,6 +507,45 @@ and for the complete form: \end{codeexample} Notice that in this case to access the \verb|front output| ports, the stage number correct is 5 and not 3 as usual. +Ti\textit{k}Z has very useful \verb|bin(|$x$\verb|)| function: it converts $x$ (it is assumed to be a 10 base integer) into its binary representation. Exploiting this function for Omega or Flip Networks is very convenient. An example of Omega Network: +\begin{codeexample}[] +\begin{tikzpicture} + \node[banyan omega={module label opacity=0}] {}; + \newcounter{porta} + \setcounter{porta}{0} + \foreach \module in {1,...,4}{ + \foreach \port in {1,...,2}{ + \stepcounter{porta} + \pgfmathbin{\theporta-1} + \node[left] at (r0-\module-front input-\port) + {\scriptsize{\pgfmathresult}}; + \node[right] at (r3-\module-front output-\port) + {\scriptsize{\pgfmathresult}}; + } + } +\end{tikzpicture} +\end{codeexample} + +An example of Flip Network: +\begin{codeexample}[] +\begin{tikzpicture} + \node[banyan flip={module label opacity=0}] {}; + \newcounter{portb} + \setcounter{portb}{0} + \foreach \module in {1,...,4}{ + \foreach \port in {1,...,2}{ + \stepcounter{portb} + \pgfmathbin{\theportb-1} + \node[left] at (r0-\module-front input-\port) + {\scriptsize{\pgfmathresult}}; + \node[right] at (r3-\module-front output-\port) + {\scriptsize{\pgfmathresult}}; + } + } +\end{tikzpicture} +\end{codeexample} +Notice that for Banyan Networks the first module is characterized by number 0 and not 1. + \subsection{Identifying input/output ports per module} It is also possible to access, for each module of each stage, its input and output ports. The syntax is similar to the one used for the front input and output ports; each input port could be accessed by means of: @@ -499,7 +598,34 @@ and in its complete form: \end{tikzpicture} \end{codeexample} -\section{Didactic purposes} +For Banyan Networks, due to the way in which the interconnections are established, it is advised to proceed as follows: +\begin{codeexample}[] +\begin{tikzpicture} + \node[banyan omega={module label opacity=0}] {}; + \newcounter{portc} + \setcounter{portc}{0} + \foreach \module in {1,...,4}{ + \foreach \port in {1,...,2}{ + \stepcounter{portc} + \pgfmathbin{\theportc-1} + \node[left] at (r0-\module-front input-\port) + {\scriptsize{\pgfmathresult}}; + \node[right] at (r3-\module-front output-\port) + {\scriptsize{\pgfmathresult}}; + } + } + \draw[red,ultra thick] + (r0-1-front input-2)--(r0-1-front output-2)-- + (r1-2-front input-1)--(r1-2-input-1)-- + (r1-2-output-2)--(r1-2-front output-2)-- + (r2-4-front input-1)--(r2-4-input-1)-- + (r2-4-output-1)--(r2-4-front output-1)-- + (r3-3-front input-2)-- (r3-3-input-2)-- + (r3-3-output-2)--(r3-3-front output-2); +\end{tikzpicture} +\end{codeexample} + +\section{Architectures for didactic purposes} \label{sec:dida} To quickly draw a Clos Network it is possible to exploit: \begin{key}{/tikz/clos snb example} |