u24c02
Advanced Member level 1
I would like to communicate c with verilog. I find the Verilog PLI can solve my problem. I read this website to learn
https://www.asic-world.com/verilog/pli1.html#How_it_Works*
But I still can't work even a printf function. I use ncverilog for verilog compiler. What I done is below. I can't have a successful compile for this. It says that it can't find the function. Can anyone tell me how to solve my problem. thanks =)
Update
I've got an error.
One of the error is
hello_vpi.c :
"vpi_user.h No such file or directory"
hello_vpi.c 12 :
error 's_vpi_systf_data'undeclared(first use in this function) ....
What should I for solving?
https://www.asic-world.com/verilog/pli1.html#How_it_Works*
But I still can't work even a printf function. I use ncverilog for verilog compiler. What I done is below. I can't have a successful compile for this. It says that it can't find the function. Can anyone tell me how to solve my problem. thanks =)
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 C code: hello.c #include<stdio.h> void hello(){ printf("HELLO"); } make library: gcc hello.c -fPIC -shared -o hello.so verilog code: test.v module test(); initial begin $hello; $10 $finish; end endmodule verilog command: ncverilog test.v +access+r -v hello.so
Update
I've got an error.
One of the error is
hello_vpi.c :
"vpi_user.h No such file or directory"
hello_vpi.c 12 :
error 's_vpi_systf_data'undeclared(first use in this function) ....
What should I for solving?
Last edited by a moderator: