X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fdsd-paper.git;a=blobdiff_plain;f=c%CE%BBash.lhs;h=6f158b5edc0b4e04357e51977bfb7a6ca8ab9e3f;hp=438cce4290f1004a5f12713d2dcb243f7f5602d3;hb=ff86fa7f14fb766248ff24849e3621674ba501e8;hpb=5f94742c1854c1d5f47d4e89f8d96bc74d1b20c9 diff --git "a/c\316\273ash.lhs" "b/c\316\273ash.lhs" index 438cce4..6f158b5 100644 --- "a/c\316\273ash.lhs" +++ "b/c\316\273ash.lhs" @@ -1013,7 +1013,27 @@ by an (optimizing) \VHDL\ synthesis tool. \section{\CLaSH\ prototype} -foo\par bar +The \CLaSH language as presented above can be translated to \VHDL using +the prototype \CLaSH compiler. This compiler allows experimentation with +the \CLaSH language and allows for running \CLaSH designs on actual FPGA +hardware. + +\comment{Add clash pipeline image} +The prototype heavily uses \GHC, the Glasgow Haskell Compiler. Figure +TODO shows the \CLaSH compiler pipeline. As you can see, the frontend +is completely reused from \GHC, which allows the \CLaSH prototype to +support most of the Haskell Language. The \GHC frontend produces the +program in the \emph{Core} format, which is a very small, functional, +typed language which is relatively easy to process. + +The second step in the compilation process is \emph{normalization}. This +step runs a number of \emph{meaning preserving} transformations on the +Core program, to bring it into a \emph{normal form}. This normal form +has a number of restrictions that make the program similar to hardware. +In particular, a program in normal form no longer has any polymorphism +or higher order functions. + +The final step is a simple translation to \VHDL. \section{Use cases} As an example of a common hardware design where the use of higher-order @@ -1135,7 +1155,7 @@ tools for formal verification. Lava descriptions are actually circuit generators when viewed from a synthesis viewpoint, in that the language elements of Haskell, such as choice, can be used to guide the circuit generation. If a developer wants to insert a choice element inside an actual -circuit he will have to specify this explicitly as a component. +circuit he will have to explicitly instantiate a multiplexer-like component. In this respect \CLaSH\ differs from Lava, in that all the choice elements, such as case-statements and pattern matching, are synthesized to choice @@ -1145,11 +1165,9 @@ mentioned in this section. The merits of polymorphic typing, combined with higher-order functions, are now also recognized in the `main-stream' hardware description languages, -exemplified by the new \VHDL-2008 standard~\cite{VHDL2008}. \VHDL-2008 has -support to specify types as generics, thus allowing a developer to describe +exemplified by the new \VHDL-2008 standard~\cite{VHDL2008}. \VHDL-2008 support for generics has been extended to types, allowing a developer to describe polymorphic components. Note that those types still require an explicit -generic map, whereas type-inference and type-specialization are implicit in -\CLaSH. +generic map, whereas types can be automatically inferred in \CLaSH. % Wired~\cite{Wired},, T-Ruby~\cite{T-Ruby}, Hydra~\cite{Hydra}. %