EECS 303 Mailing List
functional programming & hdl's


functional programming & hdl's

From: James Swaine <jamesswaine2010_at_avoiding.spam>
Date: Fri Nov 21 2008 - 14:14:19 EST

the class discussion touched briefly on the recently increasing use of
functional programming languages (e.g. haskell) as an alternative to
strictly imperative languages like C, because they (may or may not) offer a
better alternative for mapping a language description of a function to its
hardware implementation. this reminded me of this
article<http://blogs.msdn.com/dsyme/archive/2008/10/24/from-parallel-f-to-parallel-fpgas-from-avalda.aspx>,
describing a compiler which produces HDL descriptions of FPGA's from source
code written in a functional language similar to haskell (and including
constructs for parallel processing).

this got me thinking about the possibilities of describing circuits in
general with a functional language like haskell - because pure haskell is
side-effect free, the only way you can really code "state" into a function
is via recursion (so the state of a function being executed is always
exclusively defined by its inputs). this seems like it would lend itself
reasonably well to sequential circuit design, where a circuit represents a
function, and the circuit's outputs eventually become its inputs, and thus
determine its state in subsequent "runs". but how would you model a
traditional mealy machine in a language like this? also, would it even be
possible to implement a synchronous circuit this way, since then your
function is dependent on some external state (a clock signal), which
introduces side effects?

i apologize if this is a little off-topic, but i thought it was interesting
(maybe like trying to fit a square peg into a round hole).

-james
Received on Fri Nov 21 14:14:19 2008

This archive was generated by hypermail 2.1.8 : Tue Jan 06 2009 - 18:55:01 EST