title: Strange RTL output
body: <p>[Yosys 0.8]</p>
  
  <p>A colleague of mine threw some <strong>random</strong> verilog code to Yosys to see how it reacts.</p>
  
  <p>Here it is:</p>
  
  <pre><code>module top(input clk, input led, output led2, output to_port1,output [24:0] to_port2);
  
  
  reg ctr = 0;
  reg[24:0] counter = 2;
  always@(posedge clk) begin
      if (ctr == 1) begin
          ctr &lt;= 0;
          counter &lt;= counter + 1;
      end
      else
          ctr &lt;= 1;
  end
  
  assign led2 = ctr;
  assign to_port1 = led;
  assign to_port2 = counter;
  endmodule
  </code></pre>
  
  <p>and Yosys, with command <code>yosys -o synth.v x.v</code> throws:</p>
  
  <pre><code>module top(clk, led, led2, to_port1, to_port2);
  
    reg [24:0] _0_;
    reg _1_;
    reg [24:0] _2_;
    reg _3_;
    wire [31:0] _4_;
    wire _5_;
    input clk;
    reg [24:0] counter;
    reg ctr;
    input led;
    output led2;
    output to_port1;
    output [24:0] to_port2;
  
    assign _4_ = counter + 32'd1;
    assign _5_ = ctr == 32'd1;
    always @* begin
      _3_ = 1'h0;
    end
    always @* begin
    end
    always @({  }) begin
        ctr &lt;= _3_;
    end
    always @* begin
      _2_ = 25'h0000002;
    end
    always @* begin
    end
    always @({  }) begin
        counter &lt;= _2_;
    end
    always @* begin
      _1_ = ctr;
      _0_ = counter;
      casez (_5_)
        1'h1:
          begin
            _1_ = 1'h0;
            _0_ = _4_[24:0];
          end
        default:
            _1_ = 1'h1;
      endcase
    end
    always @(posedge clk) begin
        ctr &lt;= _1_;
        counter &lt;= _0_;
    end
    assign led2 = ctr;
    assign to_port1 = led;
    assign to_port2 = counter;
  endmodule
  </code></pre>
  
  <p>Some constructs end up being complicated. This result code above cannot be compiled by recent verilog compilers when the original can.</p>
  
  <p>Why the <code>always @({  }) begin</code> construct and empty <code>always @* begin</code>?
  Is there an option we missed?</p>
  
  <p>Thanks</p>