Open gsvgit opened 3 years ago
From "The Reduceron: Widening the von Neumann Bottleneck for Graph Reduction using an FPGA":
Another restriction of the implementation is that functions have a maximum of eight parameters. This is because only eight elements of the stack can be accessed simultaneously while instantiating a function body. Again, the limitation can be hidden by the compiler, though our current implementation does not yet do so.
Should the mentioned transformation be implemented in Flite to Red translator? Can it be done without significant changes in the translator?
First the error you got is very obscure. It would be nice to have a message that points more obviously to the issue. Indeed, Flite could (shoud) handle handle this by transforming the code.
Unfortunately I have never done anything non-trivial with the translator so I don't know what it would take, but feel free to give it a go.
Well, the problem is caused by functions with more than 8 arguments.
{
test x1 x2 x3 x4 x5 x6 x7 x8 x9 = x1 + x2 + x3 + x4 + x5 + x7 + x8 + x9;
main = test 1 2 3 4 5 6 7 8 9
}
I see, that this restriction is actively discussed: Memo 12 contains some possible solutions, Memo 25 describes an alternative way. The report says that the algorithm from Memo 12 was implemented. Moreover, Memo 14 (section 5) also says that Memo 12 was implemented. But in RedCompile.hs we can see, that function arity reduction does not implement yet. So, what the current status of function arity reduction? Was it implemented, but removed for some reason? What should I choose to implement arity reduction in the current version of Reduceron (Memo 12 or Memo 25)?
Sorry I haven't had time to look for it, but I thought Flite includes arity reduction. It might be controlled with a flag though.
I try to synthesize the following example from Haskell to Verilog
Steps
../flite/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.2.0.1/build/flite/flite -r ../programs/LinAl.hs
./Red -v LinAl.red
Problem
The last step failed with
Discussion
I found that the problem is related with this guard and with the number of variables used in the code block
form my example.
If I replace
(mAdd isZ g q3 t3)
with(mAdd isZ g q2 t3)
, for example, the last step finish successfully. Alternatively, I can removepopN <= 8
restriction.Unfortunately, I do not realize the essence of the problem. So, how can I fix the original problem?