【问题标题】:How can I use multiple IP cores that both contain modules with the same names with Yosys如何在 Yosys 中使用包含同名模块的多个 IP 核
【发布时间】:2017-07-01 01:20:13
【问题描述】:

考虑具有两个 IP 内核 ip1.vip2.v 的设计,每个内核声明一个(不同的)具有相同名称的模块。

例如ip1.v的内容:

module ip1 (input A, B, C, output X);
  wire T;
  mygate gate_0 (.I0(A), .I1(B), .O(T));
  mygate gate_1 (.I0(T), .I1(C), .O(X));
endmodule

module mygate (input I0, I1, output O);
  assign O = I0 & I1;
endmodule

还有ip2.v的内容:

module ip2 (input A, B, C, output X);
  wire T;
  mygate gate_0 (.I0(A), .I1(B), .O(T));
  mygate gate_1 (.I0(T), .I1(C), .O(X));
endmodule

module mygate (input I0, I1, output O);
  assign O = I0 | I1;
endmodule

然后是使用两个 IP 核的顶级模块 (top.v):

module top (input A, B, C, output X, Y);
  ip1 ip1_inst (.A(A), .B(B), .C(C), .X(X));
  ip2 ip2_inst (.A(A), .B(B), .C(C), .X(Y));
endmodule

我如何处理这样的设计,以便每个 IP 内核都能看到自己的 mygate 版本?

【问题讨论】:

    标签: yosys


    【解决方案1】:

    对于这种情况,有必要将两个 IP 核作为单独的设计进行阅读和阐述,然后通过将各个 IP 核的两个设计“导入”到顶层设计中将它们全部链接在一起:

    # Read IP core 1
    read_verilog ip1.v
    hierarchy -top ip1
    design -stash ip1
    
    # Read IP core 2
    read_verilog ip2.v
    hierarchy -top ip2
    design -stash ip2
    
    # Read top level and link design
    read_verilog top.v
    design -import ip1
    design -import ip2
    synth -top top
    

    命令design -import ip1 将从ip1 设计中导入模块ip1mygate,但它会将mygate 重命名为ip1.mygate。同样design -import ip1 会将mygateip2 重命名为ip2.mygate

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-19
      • 2023-03-17
      • 2018-04-23
      • 1970-01-01
      • 2023-01-14
      • 2011-08-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多