diff options
| author | Jim Lawson | 2016-08-16 11:08:32 -0700 |
|---|---|---|
| committer | Jim Lawson | 2016-08-16 11:08:32 -0700 |
| commit | a264157a47f56216cebf2d98c1c8118c344dad5f (patch) | |
| tree | 1724fe2900ce336822e73f9cae8280b8474f62ab /src/test/scala | |
| parent | 4ab2aa0e9209000fb0ba1299ac18db2e033f708f (diff) | |
| parent | ddb7278760029be9d960ba8bf2b06ac8a8aac767 (diff) | |
Merge branch 'master' into sdtwigg_connectwrap_renamechisel3
Diffstat (limited to 'src/test/scala')
| -rw-r--r-- | src/test/scala/chiselTests/Reg.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/test/scala/chiselTests/Reg.scala b/src/test/scala/chiselTests/Reg.scala index b66d7cb4..a9086223 100644 --- a/src/test/scala/chiselTests/Reg.scala +++ b/src/test/scala/chiselTests/Reg.scala @@ -16,7 +16,7 @@ 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=Wire(UInt.width(3)), init=UInt(20)) + val reg = Reg(t=UInt(width=2), next=Wire(UInt(width=3)), init=UInt(20)) reg.getWidth should be (2) } elaborate{ new RegOutTypeWidthTester } @@ -24,11 +24,14 @@ class RegSpec extends ChiselFlatSpec { "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=Wire(UInt.width(3)), init=20.U) + val reg1 = Reg(next=Wire(UInt(width=3)), init=UInt(20)) + reg1.isWidthKnown should be (false) DataMirror.widthOf(reg1).known should be (false) - val reg2 = Reg(init=20.U) + val reg2 = Reg(init=UInt(20)) + reg2.isWidthKnown should be (false) DataMirror.widthOf(reg2).known should be (false) - val reg3 = Reg(next=Wire(UInt.width(3)), init=5.U) + val reg3 = Reg(next=Wire(UInt(width=3)), init=UInt(5)) + reg3.isWidthKnown should be (false) DataMirror.widthOf(reg3).known should be (false) } elaborate { new RegUnknownWidthTester } |
