title: Can I make multiple generate statement in one for loop?
body: <pre><code>module test(
      input [15:0] in,
      output [15:0] out);
      
      reg [1:0] Xai_out [7:0];
      reg [1:0] c_accum_in [7:0];
      
      integer i;
      
      initial begin
          i = 10'd0;
      end
      
      always @(*) begin
          c_accum_in[0] = in[1:0];
          c_accum_in[1] = in[3:2];
          c_accum_in[2] = in[5:4];
          c_accum_in[3] = in[7:6];
          c_accum_in[4] = in[9:8];
          c_accum_in[5] = in[11:10];
          c_accum_in[6] = in[13:12];
          c_accum_in[7] = in[15:14];
      end
  
      genvar c;
      generate
          for(c = 6;c &lt; 8; c= c + 1) begin:b0
              always @(*)
                   Xai_out[i] = c_accum_in[c];
              i = i + 1;
          end
  
          for(c = 4;c &lt; 6; c= c + 1) begin:b1
              always @(*)
                   Xai_out[i] = c_accum_in[c];
               i = i + 1;
          end
  
          for(c = 2;c &lt; 4; c= c + 1) begin:b2
              always @(*)
                   Xai_out[i] = c_accum_in[c];
               i = i + 1;
          end
  
          for(c = 0;c &lt; 2; c= c + 1) begin:b3
              always @(*)
                   Xai_out[i] = c_accum_in[c];
               i = i + 1;
          end
      endgenerate
  
  endmodule
  </code></pre>
  <p>I made a rotation code that change their place.</p>
  <p>There are error every near text <code>i = i + 1</code> (<em>expecting &quot;.&quot; or &quot;(&quot;</em>).</p>
  <p>I'm not sure what's the syntax error with this part.</p>
  <p>Is it impossible to use <code>i</code> in the generate statement?</p>