如何在顶级模块中植入SystemVerilog模块



我想在我的顶级测试台中使用SysWip AXI4Lite Slave验证IP(在SystemVerilog中)和传统的VerilogAXI4Lite主机。

作为SystemVerilog的新手,我在顶层测试台中的端口映射有问题。

我所拥有的:从SysWip,我下载了axi4lite_s_if.sv,这是一个接口和axi4lite_s.sv,这是(http://syswip.com/axi4-lite-verification-ip)。在我的遗留代码中,我有一个dut_top.v和dut_top_tb.sv(为了支持一些sv构造,我将其重命名为.sv——导入、创建从属类对象等)。Verilog AXI4Lite主模块安装在dut_top.v 中

目标:我想将传统Verilog AXI4Lite Master的端口连接到SysWip VIP slave的端口。我收到一条语法错误消息,其中端口映射在dut_top_tb.sv.中

那么,有人能为我指出在上述情况下进行端口映射的正确语法吗?

您的问题令人困惑,因为您混合了moduleinterface,它们是相似但不同的构造。

SystemVerilog接口instance s可以通过接口端口连接到SystemVerilog module s。如果您有一个没有接口端口的传统Verilog模块,您仍然可以通过使用分层引用将SV接口instacne连接到Verilog模块。例如

interface intf;
 wire w;
endinterface
module verilog_dut(input wire w);
  initial $display(w);
endmodule
module SV_dut(intf p);
  initial $display(p.w);
endmodule
module top;
  intf i1();
  verilog_dut i2(.w(i1.w));
  SV_dut i3(.p(i1));
endmodule

最新更新