title: How to init a register with a parametrized value
body: <p>I'm trying to deploy RegInit in a module with parametrized data types. Normally, for a simple port in Chisel I'd do the following:</p>
  
  <pre><code>val myReg = RegInit (0.U(32.W))
  </code></pre>
  
  <p>In my code, I have the following:</p>
  
  <pre><code>import dsptools._
  import dsptools.numbers._
  
  class Acc[A &lt;: Data:Ring, B &lt;: Data:Ring] (inType:A, outType:B, 
  
  mulPipeLen:Int = 1, addPipeLen:Int = 1) extends Module {
  ...
    def zero = dsptools.numbers.Ring[B].zero
  
    val mres  = Reg(outType.cloneType) // this works, no initialization
    val ares  = RegInit(zero(outType.cloneType.getWidth.W)) // this fails trying to zero init in the parametrized Ring
  ...
  
  }
  </code></pre>
  
  <p>which return a compile error:</p>
  
  <pre><code>[error] Acc.scala:43:27: B does not take parameters
  [error]   val mres  = RegInit(zero(outType.cloneType.cloneType.getWidth.W)) 
  </code></pre>
  
  <p>How do I fix this? Thank you!</p>