【问题标题】:How do I get multi-bit ports to work in Yosys when the module is BLIF?当模块是 BLIF 时,如何让多位端口在 Yosys 中工作?
【发布时间】:2017-02-04 19:41:14
【问题描述】:

我不知道如何在 Yosys 中单独合成模块。考虑这个简单的两模块示例:

bottom.v

module bottom(x, out);
    input  [0:7] x;
    output [0:7] out;
    assign out = x+1;
endmodule

top.v

module top(x, out);
   input  [0:7] x;
   output [0:7] out;
   bottom b(.x(x), .out(out));
endmodule

现在,将这些合成在一起可以按预期工作:

$ yosys -q -o top.blif -S top.v bottom.v
$

但是如果我首先从 bottom.v 合成 bottom.blif,我会收到一条错误消息,指出没有端口 out in模块底部

$ yosys -q -o bottom.blif -S bottom.v
$ yosys -q -o top.blif -S top.v bottom.blif
ERROR: Module `bottom' referenced in module `top' in cell `b' does not have a port named 'out'.
$

为什么会这样?谷歌搜索问题,我发现在我不完全理解的上下文中对 hierarchy 命令的引用。我曾尝试在 synth 之前运行该命令,但它不影响结果。

【问题讨论】:

    标签: verilog yosys


    【解决方案1】:

    BLIF 文件格式不支持多位端口。这与Yosys无关,只是文件格式的限制。因此,在将具有多位端口的设计写入 BLIF 文件时,所有端口都会自动拆分为单位端口。所以在BLIF文件中没有8位宽端口out,有8个单位端口out[7]out[6]out[5]out[4]out[3]out[2]、@987654329 @ 和 out[0]

    因此,当您尝试像您描述的那样混合 Verilog 和 BLIF 文件时,bottom 模块与top.b 单元的接口不再匹配。


    编辑:我现在在 git commit 7e0b776 中添加了 read_blif -wideports。这允许您在将 BLIF 文件读回 Yosys 时再次合并各个单比特端口。这样您就可以使用 BLIF 作为 Yosys 和 ABC 之间的交换格式,而不会破坏具有多位端口的模块接口。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多