tarkyss
Full Member level 6

about PLI
I used the example
https://www.asic-world.com/verilog/pli2.html#Modelsim
but when i run
gcc -c -g -I$MODEL/include pli_full_example_modelsim.c
there are a warning
hello_vpi_modelsim.c: In function `registerHelloSystfs':
hello_vpi_modelsim.c:9: warning: assignment from incompatible pointer type
then i run
ld -shared -E -o pli_full_example.sl pli_full_example_modelsim.o
it is said ther are no -shared and -E parameter, I check my ld, my ld has not the two parameters
then i dont user -shared and -E, used ld -o only
but it display
vpi_printf and vpi_register_systf are not defined
even i excute
cat /user/modelsim6.1a/modeltech/include/vpi_user.h >> hello_vpi.c
it still display
vpi_printf and vpi_register_systf are not defined
why
i try my own code, running gcc, there is no warning, but when running ld it cannot work yet,
in my code srand and rand function is used
so it said srand is not defined
I used the example
https://www.asic-world.com/verilog/pli2.html#Modelsim
but when i run
gcc -c -g -I$MODEL/include pli_full_example_modelsim.c
there are a warning
hello_vpi_modelsim.c: In function `registerHelloSystfs':
hello_vpi_modelsim.c:9: warning: assignment from incompatible pointer type
then i run
ld -shared -E -o pli_full_example.sl pli_full_example_modelsim.o
it is said ther are no -shared and -E parameter, I check my ld, my ld has not the two parameters
then i dont user -shared and -E, used ld -o only
but it display
vpi_printf and vpi_register_systf are not defined
even i excute
cat /user/modelsim6.1a/modeltech/include/vpi_user.h >> hello_vpi.c
it still display
vpi_printf and vpi_register_systf are not defined
why
i try my own code, running gcc, there is no warning, but when running ld it cannot work yet,
in my code srand and rand function is used
so it said srand is not defined