summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman2017-02-24 00:12:19 -0800
committerJack Koenig2017-03-08 11:27:04 -0600
commit9734a42a03036e0ce329bb507b581633e86e9693 (patch)
treeec9ed07713bcc274d5e41f61166d6025e0adf6bc
parent9cad9ec21ac7a9a8c463e2c694b6285269982a84 (diff)
Fix the widths of QueueIO.count and ArbiterIO.chosen for entries=0
Both should be zero-width wires.
-rw-r--r--src/main/scala/chisel3/util/Arbiter.scala2
-rw-r--r--src/main/scala/chisel3/util/Decoupled.scala2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/scala/chisel3/util/Arbiter.scala b/src/main/scala/chisel3/util/Arbiter.scala
index bbd8dd33..d2b29bf9 100644
--- a/src/main/scala/chisel3/util/Arbiter.scala
+++ b/src/main/scala/chisel3/util/Arbiter.scala
@@ -19,7 +19,7 @@ import chisel3.core.ExplicitCompileOptions.NotStrict
class ArbiterIO[T <: Data](gen: T, n: Int) extends Bundle {
val in = Flipped(Vec(n, Decoupled(gen)))
val out = Decoupled(gen)
- val chosen = Output(UInt(log2Up(n).W))
+ val chosen = Output(UInt(log2Ceil(n).W))
}
/** Arbiter Control determining which producer has access
diff --git a/src/main/scala/chisel3/util/Decoupled.scala b/src/main/scala/chisel3/util/Decoupled.scala
index ba111bfc..815a507b 100644
--- a/src/main/scala/chisel3/util/Decoupled.scala
+++ b/src/main/scala/chisel3/util/Decoupled.scala
@@ -148,7 +148,7 @@ class QueueIO[T <: Data](gen: T, entries: Int) extends Bundle
/** I/O to enqueue data, is [[Chisel.DecoupledIO]]*/
val deq = EnqIO(gen)
/** The current amount of data in the queue */
- val count = Output(UInt(log2Up(entries + 1).W))
+ val count = Output(UInt(log2Ceil(entries + 1).W))
override def cloneType = new QueueIO(gen, entries).asInstanceOf[this.type]
}