Hi,

I am attempting to write a multithreaded application in VHDL, using GHDL as
the compiler.  I need to call from C a function written in VHDL and
compiled into object form using GHDL back into the VHDL code somehow, since
I can't get direct access to pthreads from VHDL.

I see that my main function work.init_pkg.init shows up in the symbol table
of the VHDL object file:

000000000000008b g     F .text 00000000000000d0 work__init_pkg__init

I have tried using:

extern void work__init_pkg__init();

in my C code, but at link time the compiler claims that it can't find the
symbol:

ghdl -e --workdir=../../work -Wl,-l:../lib/libc_scandir_.o
-Wl,-l:../lib/clock_posix_.o -Wl,-l:../lib/threader_.o -Wl,-ldl
-Wl,-lpthread controlix
../lib/threader_.o: In function `thread':
/home/jon/controlix-code-0/src/lib/threader_.c:20: undefined reference to
`work__init_pkg__init'

Any ideas what's wrong, or what I should be doing differently?

Jon
_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to