title: How to partition a top module into 2 sub-module using submod command?
body: <p>I am having problem partitioning my top module using using submod command. </p>
  
  <p>I have a simple counter (I have a behavioral code for a 4bit counter). with the following cells in it:</p>
  
  <pre><code>yosys&gt; 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
  </code></pre>
  
  <p>Now I want to put the following cells into a submodule:</p>
  
  <pre><code>counter/$procdff$9
  counter/$procmux$7
  </code></pre>
  
  <p>I do not know how to use <code>select</code>, <code>setattr</code>, <code>submod</code> to do so. Any help is greatly appreciated.</p>
  
  <p>Thank you</p>
  
  <hr>
  
  <p>verilog code for my counter:</p>
  
  <pre><code>module module counter (clk, rst, en, count);
  input clk, rst, en;
  output reg [3:0] count;   
  always @(posedge clk)
    if (rst)
       count &lt;= 4'd0;
    else if (en)
       count &lt;= count + 4'd1;
  endmodule
  </code></pre>