-
Notifications
You must be signed in to change notification settings - Fork 156
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
Instance methods without INLINE
pragma blow up multiplexer usage
#657
Comments
If you can get your synthesis software to tell you where in the HDL these resources are being used: You could also try the flag |
I have applied grit where my smarts have failed me, and started bisecting my code across various directions, and recording the number of multiplexers. I have already found something interesting: in this commit the only change is replacing some typeclass methods with direct function calls, and that change alone removes 70% of the multiplexers! In fact, going back to my original code and adding
|
INLINE
pragma blow up multiplexer usage
Unfortunately, it is still not small enough:
|
I have tried |
Is the original problem here resolved by #681? |
@gergoerdi If it does, that was not the intention behind #681; its purpose was to make Clash stop complaining to raise the inline limit when it needs to inline e.g. a |
It has finally happened. I guess it was inevitable, but today I finally got the following error message from my FPGA vendor's synthesis tool:
This is with a version of Space Invaders so "morally" it should be tiny: an Intel 8080, a VGA signal generator backed by a frame buffer, a shift register to buffer video reads, and a barrel shifter as used on the original arcade machine.
So I guess my question is, what approaches can one take to figure out where all the resource usage is coming from? The generated Verilog is quite inscrutable for me, so I wouldn't even know where to start; but from the ten-thousand foot view my hunch is that some Haskell abstractions are not properly compiled away by Clash.
The full list of feature resources for Space Invaders is as follows. Note the huge number of (especially 1-bit) 2-to-1 multiplexers.
The text was updated successfully, but these errors were encountered: