title: Modelsim: wrong scope for localparam
body: <p>I'm trying to compile following code in Modelsim:</p>
  
  <pre><code>    module ctrl_mem
      #(
          parameter BYTE_SIZE = 256
      )
      (
          input [ADDR_W - 1 : 0]  i_addr,
          ...
          ...
      );
      localparam ADDR_W = $clog2(BYTE_SIZE);
  </code></pre>
  
  <p>Modelsim writes that ADDR_W is unknown.
  Similar question was discussed <a href="https://stackoverflow.com/questions/21724904/localparam-after-wire-declaration">here</a> but Modelsim behavior is not covered there and unfortunately I cannot comment it to ask this question.</p>
  
  <p>Is it possible to fix this issue without code modification?</p>
  
  <p>I use Modelsim Altera Starter Edition 10.3c</p>