1
我有问题使用submod命令分区我的顶级模块。如何使用submod命令将顶层模块划分为2个子模块?
我有一个简单的计数器(我有一个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
看起来不错。如果您想避免枚举所有对象,请参阅'help select'以获取更复杂的选择对象的方法。 – CliffordVienna