1

我在使用 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
4

1 回答 1

1

我想到了:

首先我选择单元格,然后将它们放入我想要的分区中:

yosys> select counter/$procmux$4
yosys*> select -add counter/$procmux$7
yosys*> select -add counter/$add$counter.v:10$2
yosys*> submod -name sub_2

yosys> select counter/$procmux$4_Y
yosys*> select -add counter/$add$counter.v:10$2_Y
yosys*> select -add counter/$0\count[3:0]
yosys*> select -add counter/count
yosys*> select -add counter/$procdff$9
submod -name sub_1

请让我知道是否有更好的方法。谢谢

于 2016-05-12T22:26:36.650 回答