我不知道如何在 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之前运行该命令,但它不会影响结果。