diff options
| author | ducky | 2016-11-17 13:01:03 -0800 |
|---|---|---|
| committer | ducky | 2016-11-21 13:31:12 -0800 |
| commit | 54d3f8dc054e55dfbd01d1aa034169a3dabe89f2 (patch) | |
| tree | 7f6f9de04de6eb08878ac46be339fefc2a71395f /src/main/scala/chisel3/util/Bitwise.scala | |
| parent | cd904da0aa0e96ba679906a3ee5dbdc068eace48 (diff) | |
Restyle a lot of test code, mainly with regex
Diffstat (limited to 'src/main/scala/chisel3/util/Bitwise.scala')
| -rw-r--r-- | src/main/scala/chisel3/util/Bitwise.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/scala/chisel3/util/Bitwise.scala b/src/main/scala/chisel3/util/Bitwise.scala index 289d27b1..22326972 100644 --- a/src/main/scala/chisel3/util/Bitwise.scala +++ b/src/main/scala/chisel3/util/Bitwise.scala @@ -38,10 +38,10 @@ object Fill { */ def apply(n: Int, x: UInt): UInt = { n match { - case 0 => UInt.width(0) + case 0 => UInt(0.W) case 1 => x case _ if x.isWidthKnown && x.getWidth == 1 => - Mux(x.toBool, UInt((BigInt(1) << n) - 1, n), UInt(0, n)) + Mux(x.toBool, ((BigInt(1) << n) - 1).asUInt(n.W), 0.U(n.W)) case _ if n > 1 => val p2 = Array.ofDim[UInt](log2Up(n + 1)) p2(0) = x @@ -61,7 +61,7 @@ object Reverse { // This esoterica improves simulation performance var res = in var shift = length >> 1 - var mask = UInt((BigInt(1) << length) - 1, length) + var mask = ((BigInt(1) << length) - 1).asUInt(length.W) do { mask = mask ^ (mask(length-shift-1,0) << shift) res = ((res >> shift) & mask) | ((res(length-shift-1,0) << shift) & ~mask) |
