From de32595fbad113e1f6af115f3736e6402afe2d7d Mon Sep 17 00:00:00 2001 From: Jim Lawson Date: Fri, 13 Jun 2014 12:00:50 -0700 Subject: [PATCH] Quick change to work with new Width class. --- rocket/src/main/scala/decode.scala | 2 +- rocket/src/main/scala/util.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rocket/src/main/scala/decode.scala b/rocket/src/main/scala/decode.scala index 7e0b8544..c6e8e6be 100644 --- a/rocket/src/main/scala/decode.scala +++ b/rocket/src/main/scala/decode.scala @@ -9,7 +9,7 @@ object DecodeLogic val lit = b.litOf if (lit.isZ) { var (bits, mask, swidth) = Literal.parseLit(lit.toString) - new Term(BigInt(bits, 2), BigInt(2).pow(lit.width)-(BigInt(mask, 2)+1)) + new Term(BigInt(bits, 2), BigInt(2).pow(lit.needWidth())-(BigInt(mask, 2)+1)) } else { new Term(lit.value) } diff --git a/rocket/src/main/scala/util.scala b/rocket/src/main/scala/util.scala index 82ead46c..407fc1d1 100644 --- a/rocket/src/main/scala/util.scala +++ b/rocket/src/main/scala/util.scala @@ -163,8 +163,8 @@ class FlowThroughSerializer[T <: HasTileLinkData](gen: LogicalNetworkIO[T], n: I val cnt = UInt(OUTPUT, log2Up(n)) val done = Bool(OUTPUT) } - require(io.in.bits.payload.data.width % n == 0) - val narrowWidth = io.in.bits.payload.data.width / n + require(io.in.bits.payload.data.needWidth() % n == 0) + val narrowWidth = io.in.bits.payload.data.needWidth() / n val cnt = Reg(init=UInt(0, width = log2Up(n))) val wrap = cnt === UInt(n-1) val rbits = Reg(init=io.in.bits)