summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/Reg.scala
diff options
context:
space:
mode:
authorJim Lawson2016-09-30 12:13:58 -0700
committerGitHub2016-09-30 12:13:58 -0700
commitdb25e8180a53fb8f4912fd37b7a613e15a01564f (patch)
tree8bb5597746002ac98641f394cee4c94e1d154aff /src/main/scala/chisel3/util/Reg.scala
parent785620b1403d827986bf60c2a001d8d6f71eed72 (diff)
parent6edbdf279257d656b5eac38d9de8645a068611bf (diff)
Merge pull request #265 from ucb-bar/gsdt
Gsdt - Fixup to Chisel connections and direction - PR 200 revisited.
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
}