-
Notifications
You must be signed in to change notification settings - Fork 155
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
Make clash-ffi
a haskell library + FFI interface tests
#2429
Conversation
A quick drive-by comment: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. Could you add the example to CI? Just GitLab CI should be good. Let me know if you need help.
Thanks! Feel free to (enable auto-)merge. |
c48225d
to
082624f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just glancing through this and notice some natural language thingies.
clash-ffi
a haskell libraryclash-ffi
a haskell library + FFI interface tests
929f3e2
to
b48e56b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the testsuite and the example you've added. LGTM!
This PR reorganizes
clash-ffi
to be used like a normal Haskell library as part of an external project.To this end,
clash-ffi
now gets built as a standard Haskell library, which then is imported by the external project setting up the specific simulator actions. The external project is built as aforeign-library
, which then can be loaded into the simulator. This approach introduces more flexibility in the sense that every specific simulation application results in its own VPI-loadable shared library. This is the way of usage, as it is intended by standardized interfaces, like VPI, VHPI or FLI.A guideline for setting up a project using
clash-ffi
has been added to theREADME.md
.A small example project has been added to the
example
folder. It is a standalone project, since integrating it into theclash-ffi.cabal
causescabal
to shorten theclash-ffi
library link, making it more complicated to load the library inside the simulator.The PR also introduces a test suite, which checks that data does not get corrupted during the transfer via the FFI. After introducing the tests some bugs could be identified, which have been fixed as well.