diff options
| author | ducky | 2016-11-17 13:01:03 -0800 |
|---|---|---|
| committer | ducky | 2016-11-21 13:31:12 -0800 |
| commit | 54d3f8dc054e55dfbd01d1aa034169a3dabe89f2 (patch) | |
| tree | 7f6f9de04de6eb08878ac46be339fefc2a71395f /src/test/scala/chiselTests/When.scala | |
| parent | cd904da0aa0e96ba679906a3ee5dbdc068eace48 (diff) | |
Restyle a lot of test code, mainly with regex
Diffstat (limited to 'src/test/scala/chiselTests/When.scala')
| -rw-r--r-- | src/test/scala/chiselTests/When.scala | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/test/scala/chiselTests/When.scala b/src/test/scala/chiselTests/When.scala index 6dc2dbac..d4491e13 100644 --- a/src/test/scala/chiselTests/When.scala +++ b/src/test/scala/chiselTests/When.scala @@ -11,44 +11,44 @@ import chisel3.util._ class WhenTester() extends BasicTester { val cnt = Counter(4) - when(Bool(true)) { cnt.inc() } - - val out = Wire(UInt.width(3)) - when(cnt.value === UInt(0)) { - out := UInt(1) - } .elsewhen (cnt.value === UInt(1)) { - out := UInt(2) - } .elsewhen (cnt.value === UInt(2)) { - out := UInt(3) + when(true.B) { cnt.inc() } + + val out = Wire(UInt(3.W)) + when(cnt.value === 0.U) { + out := 1.U + } .elsewhen (cnt.value === 1.U) { + out := 2.U + } .elsewhen (cnt.value === 2.U) { + out := 3.U } .otherwise { - out := UInt(0) + out := 0.U } - assert(out === cnt.value + UInt(1)) + assert(out === cnt.value + 1.U) - when(cnt.value === UInt(3)) { + when(cnt.value === 3.U) { stop() } } class OverlappedWhenTester() extends BasicTester { val cnt = Counter(4) - when(Bool(true)) { cnt.inc() } - - val out = Wire(UInt.width(3)) - when(cnt.value <= UInt(0)) { - out := UInt(1) - } .elsewhen (cnt.value <= UInt(1)) { - out := UInt(2) - } .elsewhen (cnt.value <= UInt(2)) { - out := UInt(3) + when(true.B) { cnt.inc() } + + val out = Wire(UInt(3.W)) + when(cnt.value <= 0.U) { + out := 1.U + } .elsewhen (cnt.value <= 1.U) { + out := 2.U + } .elsewhen (cnt.value <= 2.U) { + out := 3.U } .otherwise { - out := UInt(0) + out := 0.U } - assert(out === cnt.value + UInt(1)) + assert(out === cnt.value + 1.U) - when(cnt.value === UInt(3)) { + when(cnt.value === 3.U) { stop() } } |
