Some fixes to the prototype chapter.
[matthijs/master-project/report.git] / Chapters / Abstract.tex
1 \title{Abstract}
2
3 Functional hardware description languages have been around for a while,
4 but never saw adoption on a large scale. Even though advanced features
5 like higher order functions and polymorphism could enable very natural
6 parametrization of hardware descriptions, the conventional hardware
7 description languages \VHDL\ and Verilog are still most widely used.
8
9 Cλash is a new functional hardware description language using Haskell's
10 syntax and semantics. It allows structurally describing synchronous
11 hardware, using normal Haskell syntax combined with a selection of
12 built-in functions for operations like addition or list operations. More
13 complex constructions like higher order functions and polymorphism are
14 fully supported.
15
16 Cλash supports stateful descriptions through explicit descriptions of a
17 function's state. Every function accepts an argument containing its
18 current state and returns its updated state as a part of its result.
19 This means every function is called exactly once for each cycle,
20 limiting Cλash to synchronous systems with a single clock domain.
21
22 A prototype compiler for Cλash has been implemented that can generate
23 an equivalent \VHDL\ description (using mostly structural \VHDL). The
24 prototype uses the front-end (parser, type-checker, desugarer) of the
25 existing \GHC\ Haskell compiler. This front-end generates a \emph{Core}
26 version of the description, which is a very small typed functional
27 language. A normalizing system of transformations brings this Core
28 version into a normal form that has any complex parts (higher order
29 functions, polymorphism, complex nested structures) removed. The normal
30 form can then be easily translated to \VHDL. This design has proven to
31 be very suitable. In particular the transformation system allows for
32 some theoretical analysis and proofs about the compiler design itself
33 (which have been left as future work).
34
35 Using Haskell syntax, semantics and existing tools has enabled the rapid
36 creation of the prototype, but it also became clear that Haskell is not
37 the ideal language for hardware specification. The problems encountered
38 could be solved with syntax extensions and major improvements to
39 Haskell's dependent typing support, or be circumvented entirely by
40 developing a completely new language.
41
42 Cλash already allows for implementing real world systems, but has not
43 seen much testing yet. There is much room for improvement, but there is
44 also a clear path forward for further research.