Is there a way to get the reset value of a RegInit
by probing members of the type that is produces? I can see that a RegInit will return the type (e.g. UInt
). For example I will have a register which I want to be controlled via a regmap
val myRWReg = RegInit(3.U(10.W))
// ...
node.regmap(
0x0 -> Seq(RegField(10.W, myRWReg,
RegFieldDesc("myRWReg", "A RW Register.", reset = myRWReg.init)))
)
.init
is not an accessible member, but is shown here to imply it's what I'm looking for.
Is there a way to do this so that anytime a RegFieldDesc
is used the reset description can match the hardware without having to keep another variable?
A workaround/solution is to make 3.U
in my example a val
that is changed based on any parameters and simply pass that, but wasn't sure if there was something else that could be used.