system verilog dpi遇到一个问题
时间:10-02
整理:3721RD
点击:
b.cpp
#include<iostream>
#include<sstream>
#include "svdpi.h"
using namespace std;
void reportc(){
cout<<"hello"<<endl;
}
test.sv
import "DPI-C" reportc=taks report();
program main();
initial begin
report();
end
endprogram
compile:
ncvlog -sv test.sv
ncelab main
gcc -fPIC -m32 -shared -o libdpi.so b.cpp -I/eda/candence/ius92/tools/inca/include
ncsim main
报错: OSDLERROR: ./libdpi.so : undefined symbol: _ZSt4endLicStllchar_traitsIcEERSt13basic_ostreamIT_T0_Es6_
这是什么问题
#include<iostream>
#include<sstream>
#include "svdpi.h"
using namespace std;
void reportc(){
cout<<"hello"<<endl;
}
test.sv
import "DPI-C" reportc=taks report();
program main();
initial begin
report();
end
endprogram
compile:
ncvlog -sv test.sv
ncelab main
gcc -fPIC -m32 -shared -o libdpi.so b.cpp -I/eda/candence/ius92/tools/inca/include
ncsim main
报错: OSDLERROR: ./libdpi.so : undefined symbol: _ZSt4endLicStllchar_traitsIcEERSt13basic_ostreamIT_T0_Es6_
这是什么问题
将cpp换成.c
cpp代码里的函数要声明一下,改成
extern "C" void reportc(){
cout<<"hello"<<endl;
}
学习了