You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently tried to create a Register with a default Bool value like
val first = RegInit(False)
but accidentally used Reg intead of RegInit. It seems like SpinalHDL interprets True/False as Bool and it passed all internal checks. I only realized my signal's default value sometimes changes in the simulation.
Is this behavior intended?
Can we forbid the following two statements or at least throw an warning?
val first = Reg(True)
val last = Reg(False)
The text was updated successfully, but these errors were encountered:
Yes, basicaly Reg(x) is equivalent to Reg(cloneOf(x))
The intend is that for instance, if you have some signal, and you want to create a register of the same type, you can just do :
Reg(myReferenceSignal).
Maybe, Reg(directLiteral) should be forbiden for satefy, as it is likely not wanted.
I recently tried to create a Register with a default Bool value like
but accidentally used
Reg
intead ofRegInit
. It seems like SpinalHDL interprets True/False as Bool and it passed all internal checks. I only realized my signal's default value sometimes changes in the simulation.Is this behavior intended?
Can we forbid the following two statements or at least throw an warning?
The text was updated successfully, but these errors were encountered: