forked from ghdl/ghdl-cosim
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.. program:: ghdl | ||
|
||
.. _COSIM:VHPIDIRECT:Mistakes: | ||
|
||
Common mistakes | ||
=============== | ||
|
||
* Although function overloading is supported in VHDL, it is not possible in C. Hence, it should be avoided to declare | ||
multiple procedures/functions which map to the same foreign subprogram. For the compiler, there is only one definition | ||
of the imported function. So, if different prototypes/profiles are declared, weird things may happen. See :ghdlsharp:`639`. | ||
|
||
* If a procedure/function is decorated with the ``foreign`` attribute, apart from a matching body in VHDL, the foreign | ||
subprogram **must** be defined (linked) for elaboration to succeed. This is required even when it is not used in the | ||
design. In context where conditional inclusion of VHPIDIRECT features is required, it is suggested to provide | ||
alternative (dummy) sources for either VHDL packages or C sources (see :ghdlsharp:`793`). |