diff options
| author | Henry Cook | 2015-11-06 10:55:39 -0800 |
|---|---|---|
| committer | Henry Cook | 2015-11-06 10:55:39 -0800 |
| commit | beb67ebad0799bc30ecd6b99601ed6aa8f501892 (patch) | |
| tree | 19837e51e6d42f2cac9ee52e671f418bcfbd2413 /src/test/scala/chiselTests/Counter.scala | |
| parent | dd31ad4fad3880ae8bda6172fd9303d719250be5 (diff) | |
Fix counter tests
Diffstat (limited to 'src/test/scala/chiselTests/Counter.scala')
| -rw-r--r-- | src/test/scala/chiselTests/Counter.scala | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/scala/chiselTests/Counter.scala b/src/test/scala/chiselTests/Counter.scala index 080130df..d1ea0dd7 100644 --- a/src/test/scala/chiselTests/Counter.scala +++ b/src/test/scala/chiselTests/Counter.scala @@ -8,17 +8,18 @@ import Chisel.testers.BasicTester class CountTester(max: Int) extends BasicTester { val cnt = Counter(max) - when(cnt.value === UInt(max)) { io.done := Bool(true) } + when(Bool(true)) { cnt.inc() } + when(cnt.value === UInt(max-1)) { io.done := Bool(true) } } class EnableTester(seed: Int) extends BasicTester { val ens = Reg(init = UInt(seed)) ens := ens >> 1 val (cntEn, cntWrap) = Counter(ens(0), 32) - val cnt = Counter(32) - when(cnt.value === UInt(31)) { + val cnt = Counter(Bool(true), 32)._1 + when(cnt === UInt(30)) { io.done := Bool(true) - io.error := cnt.value != UInt(popCount(seed)) + io.error := cnt != UInt(popCount(seed)) } } |
