From 783cbac7ba4c14aa7e27f28755dccd7e4ee4d54e Mon Sep 17 00:00:00 2001 From: Marlon James Date: Wed, 3 Mar 2021 10:33:56 -0800 Subject: VHPI: add initial minimal implementation Minimal implementation of VHPI provides library loading and error support. Calling most vhpi_* functions will raise a VHPI error condition. Incorporates VHPI thunks into libghdlvpi for linking. --- doc/using/InvokingGHDL.rst | 6 +++--- doc/using/Simulation.rst | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'doc/using') diff --git a/doc/using/InvokingGHDL.rst b/doc/using/InvokingGHDL.rst index 1b5b144e6..29f5e1681 100644 --- a/doc/using/InvokingGHDL.rst +++ b/doc/using/InvokingGHDL.rst @@ -661,10 +661,10 @@ Make a local copy of an existing library. This is very useful if you want to add .. _VPI_build_commands: -VPI build commands -================== +VPI/VHPI build commands +======================= -These commands simplify the compile and the link of a user vpi module. They are all wrappers: the arguments are in fact a +These commands simplify the compile and the link of a user VPI or VHPI module. They are all wrappers: the arguments are in fact a whole command line that is executed with additional switches. Currently a unix-like compiler (like `cc`, `gcc` or `clang`) is expected: the additional switches use their syntax. The only option is `-v` which displays the command before its execution. diff --git a/doc/using/Simulation.rst b/doc/using/Simulation.rst index 807a634e2..6f062a95d 100644 --- a/doc/using/Simulation.rst +++ b/doc/using/Simulation.rst @@ -161,6 +161,25 @@ Here is the list of the most useful options. For further info, see :ref:`DEV:Deb Trace vpi calls. Trace is printed to :file:`FILENAME` if provided, otherwise to stdout. +.. option:: --vhpi=[:] + + Load VHPI library. This option can be used multiple times to load different libraries. + + If an ``ENTRYPOINT`` registration function is provided, it will be called. + Otherwise, any registration functions in the ``vhpi_startup_routines`` array in the library will be called: + + .. code-block:: c + + void (*vhpi_startup_routines[])() = { + register_foreign_app, + register_foreign_func, + 0 + }; + +.. option:: --vhpi-trace[=] + + Trace vhpi calls. Trace is printed to :file:`FILENAME` if provided, otherwise to stdout. + .. option:: --help Display a short description of the options accepted by the runtime library. -- cgit v1.2.3