Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector of functions cannot be translated #25

Closed
BosJ opened this issue Jun 4, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@BosJ
Copy link
Contributor

commented Jun 4, 2014

The following code:

import CLaSH.Prelude

topEntity :: Signal Int -> Signal Int
topEntity = processor <^> 0

processor :: Int -> Int -> (Int, Int)
processor s _ = (s', s') where
    s' = (work (3:>2:>1:>Nil))!0

work :: Vec 3 Int -> Vec 3 Int
work xs = vzipWith sel xs funs where
    funs    = fun:>fun:>fun:>Nil
    fun x   = x + 1
    sel x f = f x

Produces the following error:

*** Exception: CLaSH.Netlist.BlackBox(207): Can't translate non-tycon type: GHC.Types.Int -> GHC.Types.Int

It seems as if a vector of functions is not acceptable. If it should be possible; this is a bug?

@christiaanb christiaanb added this to the 1.0 milestone Jun 4, 2014

@christiaanb

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2014

It's not possible now, it should be possible after the release of CLaSH 0.4. NB: it might not work with 0.4, but it should work at some point in time after its release.

@christiaanb christiaanb added the bug label Jun 4, 2014

@christiaanb

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2015

OK, this still doesn't work with 0.4, nor the current 0.5 branch. I hope to get it fixed in the 0.6 branch...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.