title: Using $ceil to define a parameter in SystemVerilog in Quartus Prime
body: <p>Trying to do this</p>
  
  <pre><code>parameter integer PRECHARGE_CLOCKS = $ceil(PRECHARGE_NS / CLOCK_PERIOD_NS);
  </code></pre>
  
  <p>And then use the value in a comparion</p>
  
  <pre><code>if(InitPrechargeCounter &lt; PRECHARGE_CLOCKS - 1)
  </code></pre>
  
  <p>But getting this error </p>
  
  <pre><code>Error (10174): Verilog HDL Unsupported Feature error at Ram.sv(23): system function "$ceil" is not supported for synthesis
  </code></pre>
  
  <p>Is there a way around this so that I get the value calculated at compile time?<br>
  Using some different language construct instead of <code>parameter</code>?</p>