【问题标题】:how to find if two verilog modules are connected using VPI PLI - Verilog VCS如何使用 VPI PLI 查找两个 Verilog 模块是否连接 - Verilog VCS
【发布时间】:2012-05-03 01:27:31
【问题描述】:
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

这里基本上输出端口 A:A_inst:A_OPORT_1 连接到 B:B_inst:B_IPORT_1

如何使用 verilog PLI 检索该信息?示例赞赏。

我有一些代码可以获取端口并检索 highconn 并能够获取线/网 A_to_B。

但是我无法使用 vpiPortInst 找出连接到 A_To_B 的端口。我得到一个为空的迭代器。

    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");                      
        }

O/P:

 High conndata type is vpiNet
 High conndata Net type is vpiWire
 High conndata Name is $unit::A_to_B
 Port Iterator is null

【问题讨论】:

  • 在您的代码中,这两个端口没有连接在一起,因为 A_instB_Inst 位于不同的 Tb 模块中。

标签: verilog hdl


【解决方案1】:

上面的代码有效。正如工具指出的那样,必须连接两个端口。

现在可以了,我可以打印出扇出。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    • 1970-01-01
    • 2013-12-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多