Alp*_*neo 6 hardware verification verilog system-verilog system-verilog-dpi
我有一个基于verilog的测试平台,使用DPI连接到'C源代码.现在使用DPI我打算编写我的整个固件.要做到这一点,我需要3件事
我检查了大多数cadence文档,发现没有有用的提示.我还注册了cadence用户社区,但似乎在他们批准我的注册之前我不能提出问题.
万一有人意识到这一点,将不胜感激他们的帮助.
其实我想出了这样的事情。
//--From RTL ---
export "DPI" task reg_read;
task reg_read;
input int nAddr;
output int nVal;
// -- read implementation --
endtask
// -- From C code
extern void reg_read (int nAddr, int *pVal);
void test_read (void)
{
int nRegVal;
// Dummy checking !!
reg_read (0x100, &nRegVal);
}
// -- Again in RTL --
import "DPI" context task test_read ();
Run Code Online (Sandbox Code Playgroud)
这对我使用 ncverilog 有用。