tommythorn / Reduceron

FPGA Haskell machine with game changing performance. Reduceron is Matthew Naylor, Colin Runciman and Jason Reich's high performance FPGA softcore for running lazy functional programs, including hardware garbage collection. Reduceron has been implemented on various FPGAs with clock frequency ranging from 60 to 150 MHz depending on the FPGA. A high degree of parallelism allows Reduceron to implement graph evaluation very efficiently. This fork aims to continue development on this, with a view to practical applications. Comments, questions, etc are welcome.
421 stars 29 forks source link

Problems with Flite examples. #33

Open VitorCBSB opened 8 years ago

VitorCBSB commented 8 years ago

Hello, I've been trying to run the examples in Flite, but some of them are giving unexpected results. For instance, the Fibonacci one gives the following output:

C:\Users\VitorCBSB\Reduceron\flite>stack exec -- flite examples/Fib.hs
fib(10) =

If I compile it to C and run it, these are the results:

C:\Users\VitorCBSB\Reduceron\flite>stack exec -- flite -c examples/Fib.hs > Fib.c

C:\Users\VitorCBSB\Reduceron\flite>gcc Fib.c -o Fib

C:\Users\VitorCBSB\Reduceron\flite>Fib
fib(10) = ERROR: bottom!

I have also found problems with Taut.hs (empty output) and Countdown.hs (either doesn't stop running or takes a long time). Sudoku.hs, however, apparently works correctly. Have not attempted to run the others yet.

Thanks.

tommythorn commented 7 years ago

First, thanks for the report and I'm so very very sorry for not noticing this report until now (I have no idea how that happened).

Indeed, the examples aren't run as part of the regression suite and are in fact broken (the examples in programs all pass). It would seem that I broke it. If you replace

emitStr [] k = k;

with

emitStr Nil k = k;

it works.

I'll look into this.