Discussion:
[Ghdl-discuss] Status of the VPI / VHPI interfaces implementation
Hipólito Guzmán
2017-04-23 13:23:53 UTC
Permalink
Hi everybody,

I want to communicate a VHDL simulator with some external code for a
research project and I would like to use GHDL.

What is the status of the VPI / VHPI / interfacing to other languages
implementation on GHDL?

I have been able to compile and run the external sin() example here:
http://ghdl.readthedocs.io/en/latest/GHDL_implementation_of_VHDL.html#interfacing-to-other-languages
, but I'm having trouble getting a simple custom .c/.o file linked with
GHDL. ¿Do I need to create a library with my custom functions, or is there
a way to link against a specific object code file during the elaboration
phase?

I am using GHDL 0.34dev with GCC back-end code generator.

Kind regards,

Hipólito
Richter, Arne
2017-04-23 19:54:02 UTC
Permalink
ghdl -e -v -Wl,<O_File_1>.o -Wl,<O_File_2>.o ... -Wl,<O_File_N>.o <Top_Level_Name>


________________________________
Von: Ghdl-discuss [ghdl-discuss-***@gna.org]" im Auftrag von "Hipólito Guzmán [***@us.es]
Gesendet: Sonntag, 23. April 2017 15:23
An: ghdl-***@gna.org
Betreff: [Ghdl-discuss] Status of the VPI / VHPI interfaces implementation

Hi everybody,

I want to communicate a VHDL simulator with some external code for a research project and I would like to use GHDL.

What is the status of the VPI / VHPI / interfacing to other languages implementation on GHDL?

I have been able to compile and run the external sin() example here: http://ghdl.readthedocs.io/en/latest/GHDL_implementation_of_VHDL.html#interfacing-to-other-languages , but I'm having trouble getting a simple custom .c/.o file linked with GHDL. ¿Do I need to create a library with my custom functions, or is there a way to link against a specific object code file during the elaboration phase?

I am using GHDL 0.34dev with GCC back-end code generator.

Kind regards,

Hipólito
Hipólito Guzmán
2017-04-23 21:15:14 UTC
Permalink
Thank you very much! That works perfectly
Post by Richter, Arne
ghdl -e -v -Wl,<O_File_1>.o -Wl,<O_File_2>.o ... -Wl,<O_File_N>.o <Top_Level_Name>
------------------------------
*Gesendet:* Sonntag, 23. April 2017 15:23
*Betreff:* [Ghdl-discuss] Status of the VPI / VHPI interfaces
implementation
Hi everybody,
I want to communicate a VHDL simulator with some external code for a
research project and I would like to use GHDL.
What is the status of the VPI / VHPI / interfacing to other languages
implementation on GHDL?
http://ghdl.readthedocs.io/en/latest/GHDL_implementation_of_
VHDL.html#interfacing-to-other-languages , but I'm having trouble getting
a simple custom .c/.o file linked with GHDL. ¿Do I need to create a library
with my custom functions, or is there a way to link against a specific
object code file during the elaboration phase?
I am using GHDL 0.34dev with GCC back-end code generator.
Kind regards,
Hipólito
_______________________________________________
Ghdl-discuss mailing list
https://mail.gna.org/listinfo/ghdl-discuss
Martin Strubel
2017-04-24 10:32:38 UTC
Permalink
Hi,
Post by Hipólito Guzmán
What is the status of the VPI / VHPI / interfacing to other languages
implementation on GHDL?
For me, the VHPI i/f turned out to be very robust and way more powerful
than what Modelsim has to offer. You will have to dig through some code
though, and you might want to search this list's archive for posts about
whygee's example code or the keyword "ghdlex", the latter being some
kind of loosely knitted together linux library functions for virtual
interfaces (FIFO/pipe/UART) or busses allowing co-simulation with
Python, qemu, et al.

Greetings,

- Martin
w***@f-cpu.org
2017-04-24 11:17:25 UTC
Permalink
Post by Martin Strubel
Hi,
Post by Hipólito Guzmán
What is the status of the VPI / VHPI / interfacing to other languages
implementation on GHDL?
For me, the VHPI i/f turned out to be very robust and way more
powerful than what Modelsim has to offer. You will have to dig through
some code though, and you might want to search this list's archive for
posts about whygee's example code
http://ygdes.com/GHDL/
it's a bit outdated and was designed for the older, GCC, 32-bits version
of GHDL.
Use with caution and please report all your experiences :-)
Post by Martin Strubel
or the keyword "ghdlex", the latter
being some kind of loosely knitted together linux library functions
for virtual interfaces (FIFO/pipe/UART) or busses allowing
co-simulation with Python, qemu, et al.
A pretty crazy project, I admit :-)
Post by Martin Strubel
Greetings,
- Martin
yg
Hipólito Guzmán
2017-04-25 12:37:41 UTC
Permalink
Thanks Martin and yg!

These are very, very interesting examples. It seems GHDL's VHPI is really
powerful, so congratulations Tristan!

yg, your code seems to work with ghdl 0.34dev (I haven't tried the parallel
port example, and have to further tinker with the framebuffer example: I
think I am having permission problems accessing /dev/fb0). Thanks for the
clean code with comments :)

Kind regards,

Hipólito
Post by w***@f-cpu.org
Post by Martin Strubel
Hi,
Post by Hipólito Guzmán
What is the status of the VPI / VHPI / interfacing to other languages
implementation on GHDL?
For me, the VHPI i/f turned out to be very robust and way more
powerful than what Modelsim has to offer. You will have to dig through
some code though, and you might want to search this list's archive for
posts about whygee's example code
http://ygdes.com/GHDL/
it's a bit outdated and was designed for the older, GCC, 32-bits version
of GHDL.
Use with caution and please report all your experiences :-)
or the keyword "ghdlex", the latter
Post by Martin Strubel
being some kind of loosely knitted together linux library functions
for virtual interfaces (FIFO/pipe/UART) or busses allowing
co-simulation with Python, qemu, et al.
A pretty crazy project, I admit :-)
Greetings,
Post by Martin Strubel
- Martin
yg
_______________________________________________
Ghdl-discuss mailing list
https://mail.gna.org/listinfo/ghdl-discuss
Loading...