如何在verilog中制作VPI?
how to make a VPI in verilog?
当我运行上网的时候,我发现了这个问题how to use verilog PLI communicate with c by ncverilog compiler
我按照最后一个答案做了,但它不起作用。
错误之一是 hello_vpi.c:“vpi_user.h 没有这样的文件或目录”
hello_vpi.c 12 : 错误 's_vpi_systf_data' 未声明(首次在此函数中使用)
....
我应该解决什么问题?
更新
@Greg :: 我的模拟器是Incisive15.10.002和Linux6.0.
我遇到了一个问题,当我 运行 这样 gcc hello_vpi.c -fPIC -shared -o hello_vpi.so -I /cadence/Incisive/Incisive15.10.002/tools.lnx86/include
时,我收到了如下消息。
hello_vpi.c : Infunction 'register_hello' :
hello_vpi.c :16: warning: assignment from incompatible pointer type.
当我 运行 这个命令时,我收到了如下错误信息
ncverilog test.v +access+r -v hello_vpi.so
...
*W.LIBNOU : Library "hello_vpi.so given but not used.
...
$hello;
unrecognized system task or function
...
libvpi.so cannot open shaed object file: No such file directory or file is not valid ELFCLASS64 library
...
*E, MSSYSTF : user defined system task or function( $hello) registered during elaboration and used with in the simulation has not been registered during simulation.
我不知道我应该做什么?
去掉-I
后面的空格
gcc hello_vpi.c -fPIC -shared -o hello_vpi.so -I/cadence/Incisive/Incisive15.10.002/tools.lnx86/include
你也可以试试:(注:我猜的是Incisive自带的gcc的路径)
/cadence/Incisive/Incisive15.10.002/tools.lnx86/bin/gcc hello_vpi.c -fPIC -shared -o hello_vpi.so
如果ncverilog test.v +access+r -v hello_vpi.so
不起作用,请尝试:
ncverilog test.v +access+r -loadvpi ./hello_vpi.so:register_hello
当我运行上网的时候,我发现了这个问题how to use verilog PLI communicate with c by ncverilog compiler
我按照最后一个答案做了,但它不起作用。 错误之一是 hello_vpi.c:“vpi_user.h 没有这样的文件或目录” hello_vpi.c 12 : 错误 's_vpi_systf_data' 未声明(首次在此函数中使用) ....
我应该解决什么问题?
更新
@Greg :: 我的模拟器是Incisive15.10.002和Linux6.0.
我遇到了一个问题,当我 运行 这样 gcc hello_vpi.c -fPIC -shared -o hello_vpi.so -I /cadence/Incisive/Incisive15.10.002/tools.lnx86/include
时,我收到了如下消息。
hello_vpi.c : Infunction 'register_hello' :
hello_vpi.c :16: warning: assignment from incompatible pointer type.
当我 运行 这个命令时,我收到了如下错误信息
ncverilog test.v +access+r -v hello_vpi.so
...
*W.LIBNOU : Library "hello_vpi.so given but not used.
...
$hello;
unrecognized system task or function
...
libvpi.so cannot open shaed object file: No such file directory or file is not valid ELFCLASS64 library
...
*E, MSSYSTF : user defined system task or function( $hello) registered during elaboration and used with in the simulation has not been registered during simulation.
我不知道我应该做什么?
去掉-I
gcc hello_vpi.c -fPIC -shared -o hello_vpi.so -I/cadence/Incisive/Incisive15.10.002/tools.lnx86/include
你也可以试试:(注:我猜的是Incisive自带的gcc的路径)
/cadence/Incisive/Incisive15.10.002/tools.lnx86/bin/gcc hello_vpi.c -fPIC -shared -o hello_vpi.so
如果ncverilog test.v +access+r -v hello_vpi.so
不起作用,请尝试:
ncverilog test.v +access+r -loadvpi ./hello_vpi.so:register_hello