X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=matthijs%2Fintroduction.lhs;h=6a55aa26a0b386dc53c280f83dd99124027a732b;hb=cd79bd441561d9000853d2a8e00f325789014e16;hp=a5593d1bc1fd459317d64c5e62afae7fc4c1f25e;hpb=3dbbf959f851797dfe1c6eea2290da933397ad27;p=matthijs%2Fmaster-project%2Ffinal-presentation.git diff --git a/matthijs/introduction.lhs b/matthijs/introduction.lhs index a5593d1..6a55aa2 100644 --- a/matthijs/introduction.lhs +++ b/matthijs/introduction.lhs @@ -1,12 +1,6 @@ %include talk.fmt \section{Presentation Matthijs} -\title{Haskell as a higher order structural hardware description language} -\author{Matthijs Kooijman} -\date{December 14, 2009} - -\frame{\titlepage \setcounter{framenumber}{1}} - - +\subsection{Functions} \frame { \frametitle{Functions} @@ -114,16 +108,102 @@ \item Geen bijwerkingen. } +\subsection{State} + +\frame +{ + \frametitle{Multiply-accumulate} + \begin{columns} + \begin{column}{4cm} + \begin{tabular}{lll} + Input A & Input B & Output \\ + \hline + 1 & 1 & 1 \\ + 1 & 2 & 3 \\ + 1 & 1 & 4 \\ + 2 & 2 & 8 \\ + \end{tabular} + \end{column} + \begin{column}{6cm} + \begin{figure} + \includegraphics[width=7cm]{figures/archs/Mac} + \end{figure} + \end{column} + \end{columns} +} + +\note[itemize] +{ + \item Next sheet: MAC circuit and I/O values + \item MAC is common circuit + \item Multiplies pairs, one pair at a time + \item Stores sum so far + \item Not pure! + \item Depends on inputs \emph{and} current register value + \item Solution: Put register value (state) in argument +} + \frame { - TODO: Impure (stateful) example. + \frametitle{Multiply-accumulate} + \begin{columns} + \begin{column}{4cm} + \begin{block}{} + \vspace{-0.5cm} +\begin{verbatim} +mac (a, b) (State s) = let + sum = s + (a * b) +in (State sum, sum) +\end{verbatim} + \end{block} + \end{column} + \begin{column}{6cm} + \begin{figure} + \includegraphics[width=7cm]{figures/archs/MacExternal} + \end{figure} + \end{column} + \end{columns} +} + +\note[itemize] +{ + \item Next sheet: MAC implementation + \item Current state as argument (annotated) + \item Two parts in the result: New state and output + \item Register is placed ``outside'' + \item We want it inside! + \item Annotation allows compiler to put it inside } +\begin{frame}[fragile] + \frametitle{Simulating} + + \begin{block}{Recursive run function} + run f (i:is) s = let + (o, s') = f i s + in o : (run f is s') + \end{block} + + \begin{block}{Remember \texttt{mac}} +\vspace{-0.5cm} +\begin{verbatim} +mac (a, b) (State s) = let + sum = s + (a * b) +in (State sum, sum) +\end{verbatim} + \end{block} +\end{frame} + \note[itemize] { - \item TODO + \item Next sheet: run function + \item Used for simulation only + \item Recursion ``stores'' state + \item Each recursion step, \texttt{f} is evaluated once. } +\subsection{\texorpdfstring{\clash{}}{CLasH}} + \frame{ \begin{center} {\Huge \clash} @@ -162,6 +242,7 @@ \item Normalisatie: Nog simpeler maken. } +\subsection{Normalization} \frame { \frametitle{Netlists} @@ -282,6 +363,8 @@ \item De goede weg } +\subsection{Summary} + \frame { \frametitle{But now?} @@ -300,6 +383,7 @@ \item Meer testen nodig, } +\subsection{Thanks} \frame { {\Huge Thanks!}