Closed gergoerdi closed 5 years ago
Can you try and compile your package with -fexpose-all-unfoldings -fno-worker-wrapper
? I'm not sure where you'd add it in a stack.yaml
, but you can find a cabal example here. The former makes sure that the compiled files (*.hi*
) also contain the core Clash needs to translate functions. The latter makes sure that no worker versions of your functions are created ($wvgaDriver
), which sometimes confuses Clash.
@gergoerdi Can you confirm adding the flags works?
Yes indeed. I have upgraded CLaSH and started using these flags and now I am able to build space-invaders
and compucolor2
without any shady source-based importing:
https://github.com/gergoerdi/clash-spaceinvaders/commit/d98a9489c1d9dd8667787c2903cd9ecd8b08e7e5
Oh and one more observation: I think the nicest way to do this would be if there was a way to specify CLaSH as the Haskell compiler in Cabal/Stack so that it would come with its own set of default flags.
I've tried that a while ago and I remember it being not completely trivial. I should have written my thoughts down, because I don't remember why it was hard.. But yeah, I agree that it should be possible!
I am trying to modularize my Space Invaders so that the Intel 8080 core can be put into a separate Cabal package. My aim with this is to reuse the Intel 8080 code in a Compucolor II project.
So I've set up a bunch of Cabal packages for
clash-utils
andclash-intel8080
, but when I try to use them in Space Invaders, CLaSH complains about a missing blackbox for my function (I assume it's just the first one it encounters):I've pushed the full repro to a branch; my
stack.yaml
file is as follows: