summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Waterman2017-02-24 00:15:19 -0800
committerJack Koenig2017-03-08 11:27:04 -0600
commit96a24d4ba2805ef291ed25047fd31de7131e8311 (patch)
tree728fcb19eb4626ca1064837ee7b6aaca427609d4 /src
parent9734a42a03036e0ce329bb507b581633e86e9693 (diff)
In Counter, use log2Ceil instead of log2Up
Since the argument is at least 2, this change has no semantic effect.
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/chisel3/util/Counter.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/scala/chisel3/util/Counter.scala b/src/main/scala/chisel3/util/Counter.scala
index 66dd1127..6e533ea6 100644
--- a/src/main/scala/chisel3/util/Counter.scala
+++ b/src/main/scala/chisel3/util/Counter.scala
@@ -14,7 +14,7 @@ import chisel3.internal.naming.chiselName // can't use chisel3_ version because
@chiselName
class Counter(val n: Int) {
require(n >= 0)
- val value = if (n > 1) Reg(init=0.U(log2Up(n).W)) else 0.U
+ val value = if (n > 1) Reg(init=0.U(log2Ceil(n).W)) else 0.U
/** Increment the counter, returning whether the counter currently is at the
* maximum and will wrap. The incremented value is registered and will be