summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/Reg.scala
diff options
context:
space:
mode:
authorJim Lawson2016-07-19 15:08:22 -0700
committerJim Lawson2016-07-19 15:08:22 -0700
commit3120eefc8a73b5ab3d8f909445a3e004b5e60cc6 (patch)
treee1a2aa9591ccc882a941d1ddbc9ded3218b5bc85 /src/test/scala/chiselTests/Reg.scala
parentb27f29902d9f1d886e8edf1fc5e960cf9a634184 (diff)
Incorporate connection logic.
Compiles but fails tests.
Diffstat (limited to 'src/test/scala/chiselTests/Reg.scala')
-rw-r--r--src/test/scala/chiselTests/Reg.scala18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/test/scala/chiselTests/Reg.scala b/src/test/scala/chiselTests/Reg.scala
index 391dd7de..0caf6315 100644
--- a/src/test/scala/chiselTests/Reg.scala
+++ b/src/test/scala/chiselTests/Reg.scala
@@ -16,20 +16,20 @@ class RegSpec extends ChiselFlatSpec {
"A Reg" should "be of the same type and width as outType, if specified" in {
class RegOutTypeWidthTester extends BasicTester {
- val reg = Reg(t=UInt(width=2), next=UInt(width=3), init=UInt(20))
- reg.width.get should be (2)
+ val reg = Reg(t=UInt(width=2), next=Wire(UInt(width=3)), init=UInt(20))
+ reg.getWidth should be (2)
}
elaborate{ new RegOutTypeWidthTester }
}
"A Reg" should "be of unknown width if outType is not specified and width is not forced" in {
class RegUnknownWidthTester extends BasicTester {
- val reg1 = Reg(next=UInt(width=3), init=UInt(20))
- reg1.width.known should be (false)
- val reg2 = Reg(init=UInt(20))
- reg2.width.known should be (false)
- val reg3 = Reg(next=UInt(width=3), init=UInt(width=5))
- reg3.width.known should be (false)
+ val reg1 = Reg(next=Wire(UInt(width=3)), init=20.U)
+ DataMirror.widthOf(reg1).known should be (false)
+ val reg2 = Reg(init=20.U)
+ DataMirror.widthOf(reg2).known should be (false)
+ val reg3 = Reg(next=Wire(UInt(width=3)), init=5.U)
+ DataMirror.widthOf(reg3).known should be (false)
}
elaborate { new RegUnknownWidthTester }
}
@@ -37,7 +37,7 @@ class RegSpec extends ChiselFlatSpec {
"A Reg" should "be of width of init if outType and next are missing and init is a literal of forced width" in {
class RegForcedWidthTester extends BasicTester {
val reg2 = Reg(init=UInt(20, width=7))
- reg2.width.get should be (7)
+ reg2.getWidth should be (7)
}
elaborate{ new RegForcedWidthTester }
}