我在使用 submod 命令对我的顶级模块进行分区时遇到问题。
我有一个简单的计数器(我有一个 4 位计数器的行为代码)。其中包含以下单元格:
yosys> select -list
counter
counter/$procmux$4_Y
counter/$add$counter.v:10$2_Y
counter/$0\count[3:0]
counter/count
counter/en
counter/rst
counter/clk
counter/$procdff$9
counter/$procmux$7
counter/$procmux$4
counter/$add$counter.v:10$2
现在我想将以下单元格放入一个子模块中:
counter/$procdff$9
counter/$procmux$7
我不知道如何使用select
, setattr
,submod
来做到这一点。任何帮助是极大的赞赏。
谢谢
我的计数器的verilog代码:
module module counter (clk, rst, en, count);
input clk, rst, en;
output reg [3:0] count;
always @(posedge clk)
if (rst)
count <= 4'd0;
else if (en)
count <= count + 4'd1;
endmodule