1

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

底部.v

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

顶部.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 ,我会收到一条错误消息,指出模块底部没有端口输出:

$ 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'.
$

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

4

1 回答 1

1

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

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


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

于 2017-02-04T20:56:55.487 回答