Hi Jon,

 I can not call from C.  Your solution can be interesting for me.

I can give you only my commandline. For a Call from VHDL.

ghdl -e -Wl,emulator_src.o -Wl,gdb_sim.o -Wl,-lpthread --ieee=synopsys --workdir=work -Pwork tb_lm_cpu

I see no larger difference.


Perhaps can you write down your function.




Regards

René



On 04/10/2013 01:19 AM, Jon Taylor wrote:
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 .text00000000000000d0 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

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

Reply via email to