-
Notifications
You must be signed in to change notification settings - Fork 266
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
Add method 'set_objects' #481
Conversation
c4762ba
to
aa21c26
Compare
Maybe the name is to general? Is it assumed to be a VHPI object or just any object? Isnt there Verilog foreign interfaces also? In modelsim and riviera pro there is a |
"Any" object, which is to be linked with GHDL.
Sim option 'pli' should be equivalent. Certainly, 'pli' can be renamed to 'objects', since the expected functionality and UX is the same. Or, the other way, I can rewrite this PR so no new methods/field are added, and 'pli' is renamed and reused instead. VPI is different. GHDL provides specific CLI options to handle it.
I don't think so. C sources are slightly different. The user would need to select which object to add to
It is not needed. Please, see |
I am worried that there is no general purpose definition of what an "object" is in all simulators. If there is no common definition then this just becomes a poor abstraction that will only fit GHDL. As a first rule I try to avoid having wrappers for simulator settings that can just as well be directly done by the user in a simulator flag. Both because often simulators do not have a common standard for concepts but also to avoid a large surface area of potential support questions when the abstraction does not work. If we find some very common setting that has a common concept for all simulators we could consider adding an abstraction for it in VUnit. I am not sure this is the case here and also this PR does not implement the abstraction for all simulators which becomes a risk/technical debt. |
Certainly, after better thinking about this, However, I think that the first two commits in this PR are useful. I will close this and open a new PR for that. Thanks for your insightful comments. |
As commented in #476, this PR allows to provide some pre-built object (typically from C sources) to have them built with the VHDL design. The primary use case for this is to provide VHPI implementations, but it can also be used to just wrap a GHDL simulation.
The objects are saved in a new sim option named
objects
. Currently, these are only used inghdl_interface
. However, in the future it is possible to extend it to ModelSim/QuestaSim and/or Riviera-Pro.Moreover, method
simulator_check
is added totest/common.py
andsupports_vhpi
is added tosimulator_interface
. These allow to evaluate if a simulator supports VHPI, before trying to run an example that requires it.Note that neither tests nor examples are provided in this PR, because those are implemented in #465 and #476.