diff options
| author | Richard Lin | 2016-11-21 13:44:26 -0800 |
|---|---|---|
| committer | GitHub | 2016-11-21 13:44:26 -0800 |
| commit | 3b4755716a74d4711efa3ce6799742479e17e80b (patch) | |
| tree | 56652eaa478d5dfd8cddfbe2795c0123d39d230d /src/test/scala/chiselTests/Counter.scala | |
| parent | cd6eb41275381a4399a8a88c886110d276bb805c (diff) | |
| parent | 81e5d00d18a5ba9ae33c10219a270148002fc672 (diff) | |
Merge pull request #372 from ucb-bar/onetrueliteral
Standardize the One True Way of specifying literals
Diffstat (limited to 'src/test/scala/chiselTests/Counter.scala')
| -rw-r--r-- | src/test/scala/chiselTests/Counter.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/scala/chiselTests/Counter.scala b/src/test/scala/chiselTests/Counter.scala index 69d8a44a..55c07772 100644 --- a/src/test/scala/chiselTests/Counter.scala +++ b/src/test/scala/chiselTests/Counter.scala @@ -11,29 +11,29 @@ import chisel3.util._ class CountTester(max: Int) extends BasicTester { val cnt = Counter(max) - when(Bool(true)) { cnt.inc() } - when(cnt.value === UInt(max-1)) { + when(true.B) { cnt.inc() } + when(cnt.value === (max-1).asUInt) { stop() } } class EnableTester(seed: Int) extends BasicTester { - val ens = Reg(init = UInt(seed)) + val ens = Reg(init = seed.asUInt) ens := ens >> 1 val (cntEnVal, _) = Counter(ens(0), 32) - val (_, done) = Counter(Bool(true), 33) + val (_, done) = Counter(true.B, 33) when(done) { - assert(cntEnVal === UInt(popCount(seed))) + assert(cntEnVal === popCount(seed).asUInt) stop() } } class WrapTester(max: Int) extends BasicTester { - val (cnt, wrap) = Counter(Bool(true), max) + val (cnt, wrap) = Counter(true.B, max) when(wrap) { - assert(cnt === UInt(max - 1)) + assert(cnt === (max - 1).asUInt) stop() } } |
