summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/Reg.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/chisel3/util/Reg.scala')
-rw-r--r--src/main/scala/chisel3/util/Reg.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/scala/chisel3/util/Reg.scala b/src/main/scala/chisel3/util/Reg.scala
index 80a3f43e..713a3b2e 100644
--- a/src/main/scala/chisel3/util/Reg.scala
+++ b/src/main/scala/chisel3/util/Reg.scala
@@ -3,6 +3,8 @@
package chisel3.util
import chisel3._
+// TODO: remove this once we have CompileOptions threaded through the macro system.
+import chisel3.core.ExplicitCompileOptions.NotStrict
object RegNext {
/** Returns a register with the specified next and no reset initialization.
@@ -28,7 +30,8 @@ object RegEnable {
/** Returns a register with the specified next, update enable gate, and no reset initialization.
*/
def apply[T <: Data](updateData: T, enable: Bool): T = {
- val r = Reg(updateData)
+ val clonedUpdateData = updateData.chiselCloneType
+ val r = Reg(clonedUpdateData)
when (enable) { r := updateData }
r
}