X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=introduction.lhs;h=c7b0bca887d2cd4873a66393c3253dd86c5f8a13;hb=d514bd151f4bd5bbb5ae6828902a778222de9738;hp=d959f8d4162d57b1a5b211451fb69585bcd755a9;hpb=bf7c294bcfb5b4528e4daf0bdddd18ab59adc86c;p=matthijs%2Fmaster-project%2Fhaskell-symposium-talk.git diff --git a/introduction.lhs b/introduction.lhs index d959f8d..c7b0bca 100644 --- a/introduction.lhs +++ b/introduction.lhs @@ -1,59 +1,79 @@ %include talk.fmt \section{Introduction} -\subsection{What will you see} -\frame -{ - \frametitle{What will we see?} - \begin{itemize} - \item Small tour: what can we describe in \clash{} - \item Quick real demo - \end{itemize} -} - \subsection{What is \texorpdfstring{\clash{}}{CLasH}} \frame { - \frametitle{What is \clash{}?} + \frametitle{What is \clash{}?}\pause \begin{itemize} - \item \clash{}: CAES Language for Hardware Descriptions - \item Rapid prototyping language - \item Subset of Haskell can be translated to Hardware (VHDL) - \item Structural Description of a Mealy Machine + \item \clash{}: CAES Language for Hardware\pause + \item Rapid prototyping language\pause + \item Subset of Haskell can be translated to Hardware (VHDL)\pause + \item Structural Description of the logic part of a Mealy Machine \end{itemize} } -\subsection{Mealy Machine} -\frame +\note[itemize] { -\frametitle{Mealy Machine} - \begin{figure} - \centerline{\includegraphics[width=\textwidth]{mealymachine}} - \label{img:mealymachine} - \end{figure} +\item We are a Computer Architectures group, this has been a Masters' project, no prior experience with Haskell. +\item \clash{} is written in Haskell, of course +\item \clash{} is currently meant for rapid prototyping, not verification of hardware designs +\item Functional languages are close to Hardware +\item We can only translate a subset of Haskell +\item All functions are descriptions of Mealy Machines } +% \subsection{Mealy Machine} +% \frame +% { +% \frametitle{What is a Mealy Machine again?} +% \begin{figure} +% \centerline{\includegraphics[width=10cm]{mealymachine}} +% \label{img:mealymachine} +% \end{figure} +% } +% \note[itemize]{ +% \item Mealy machine bases its output on current input and previous state +% \item: TODO: Integrate this slide with the next two. First, show the picture +% with the mealyMachine type signature (and rename it to "func"). Then, show the +% run function, without type signature. Focus is on correspondence to the +% picture. +% } + \frame { \frametitle{Haskell Description} +\begin{figure} +\centerline{\includegraphics<1>[width=6.25cm]{mealymachine2} +\includegraphics<2>[width=6.25cm]{mealymachine2-func-red} +\includegraphics<3>[width=6.25cm]{mealymachine2-state-red}} +\label{img:mealymachine} +\end{figure} +\begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox} \begin{code} -mealyMachine :: - InputSignals -> - {-"{\color<2->[rgb]{1,0,0}"-}State{-"}"-} -> - (State, OutputSignals) -mealyMachine inputs {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-} = ({-"{\color<3->[rgb]{0,0,1}"-}new_state{-"}"-}, output) +run func {-"{\color<3>[rgb]{1,0,0}"-}state{-"}"-} [] = [] +run func {-"{\color<3>[rgb]{1,0,0}"-}state{-"}"-} (i:inputs) = o:outputs where - {-"{\color<3->[rgb]{0,0,1}"-}new_state{-"}"-} = logic {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-} input - outputs = logic {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-} input + ({-"{\color<3>[rgb]{1,0,0}"-}state'{-"}"-}, o) = {-"{\color<2>[rgb]{1,0,0}"-}func{-"}"-} i {-"{\color<3>[rgb]{1,0,0}"-}state{-"}"-} + outputs = run {-"{\color<2>[rgb]{1,0,0}"-}func{-"}"-} {-"{\color<3>[rgb]{1,0,0}"-}state'{-"}"-} input \end{code} +\end{beamercolorbox} +} +\note[itemize]{ +\item State is part of the function signature +\item Both the current state, as the updated State } -\subsection{Simulation} + \frame { -\frametitle{Simulating a Mealy Machine} +\frametitle{Haskell Description} +\begin{figure} +\centerline{\includegraphics[width=6.25cm]{mealymachine2-func-red}} +\end{figure} +\begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox} \begin{code} -run func {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-} [] = [] -run func {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-} (i:input) = o:out - where - ({-"{\color<3->[rgb]{0,0,1}"-}state'{-"}"-}, o) = func {-"{\color<2->[rgb]{1,0,0}"-}state{-"}"-} i - out = run func {-"{\color<3->[rgb]{0,0,1}"-}state'{-"}"-} input +func :: + InputSignal -> + State -> + (State, OutputSignal) \end{code} -} \ No newline at end of file +\end{beamercolorbox} +}