如何使用VPI PLI-verilog VCS查找两个verilog模块是否连接
这里基本上输出端口A:A_inst:A_OPORT_1连接到B:B_inst:B_IPORT_1 如何使用verilog PLI检索该信息?我赞赏你的榜样 我有一些代码,可以获取一个端口,检索highconn,并能够获取wire/net a到B 但是,我无法找到使用vpiPortInst将哪些端口连接到A到B。我得到一个为null的迭代器如何使用VPI PLI-verilog VCS查找两个verilog模块是否连接,verilog,hdl,Verilog,Hdl,这里基本上输出端口A:A_inst:A_OPORT_1连接到B:B_inst:B_IPORT_1 如何使用verilog PLI检索该信息?我赞赏你的榜样 我有一些代码,可以获取一个端口,检索highconn,并能够获取wire/net a到B 但是,我无法找到使用vpiPortInst将哪些端口连接到A到B。我得到一个为null的迭代器 module A ( output A_OPORT_1 ); endmodule module B ( input B_IPOR
module A (
output A_OPORT_1
);
endmodule
module B (
input B_IPORT_1
);
endmodule
module TestBench;
wire A_to_B;
A A_inst (
.A_OPORT_1 (A_to_B)
);
B B_inst (
.B_IPORT_1 (A_to_B)
);
endmodule
O/p:
上述代码有效。正如toolic指出的,两个端口必须连接
现在可以了,我可以打印出扇形输出。在您的代码中,这两个端口没有连接在一起,因为
A_inst
和B_inst
在单独的Tb模块中。
vpiHandle high = vpi_handle(vpiHighConn, port);
vpi_printf(" High conndata type is %s\n",
vpi_get_str(vpiType, high));
vpi_printf(" High conndata Net type is %s\n",
vpi_get_str(vpiNetType, high));
vpi_printf(" High conndata Name is %s\n",
vpi_get_str(vpiFullName, high));
vpiHandle iter = vpi_iterate(vpiPortInst,high);
vpiHandle p2ref;
if (iter == NULL)
{
vpi_printf(" Port Iterator is null\n");
}
High conndata type is vpiNet
High conndata Net type is vpiWire
High conndata Name is $unit::A_to_B
Port Iterator is null