summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Waterman2015-08-04 04:40:04 -0700
committerAndrew Waterman2015-08-04 04:52:27 -0700
commit0719146300e6100a6e403541402391642bf90753 (patch)
tree6852bf401d04ee3162645234946741c91ce9e3d9 /src
parentcf6f33a52fc1a8bf6f38347c5244740b3066f211 (diff)
Fix inferred width of Reverse
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/Chisel/utils.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/scala/Chisel/utils.scala b/src/main/scala/Chisel/utils.scala
index 830687b8..fe8329a7 100644
--- a/src/main/scala/Chisel/utils.scala
+++ b/src/main/scala/Chisel/utils.scala
@@ -218,13 +218,13 @@ object Reverse
if (length == 1) {
in
} else if (isPow2(length) && length >= 8 && length <= 64) {
- // Do it in logarithmic time to speed up C++. Neutral for real HW.
+ // This esoterica improves simulation performance
var res = in
var shift = length >> 1
var mask = UInt((BigInt(1) << length) - 1, length)
do {
- mask = mask ^ (mask(length-shift-1,0) << UInt(shift))
- res = ((res >> UInt(shift)) & mask) | (res(length-shift-1,0) << UInt(shift) & ~mask)
+ mask = mask ^ (mask(length-shift-1,0) << shift)
+ res = ((res >> shift) & mask) | ((res(length-shift-1,0) << shift) & ~mask)
shift = shift >> 1
} while (shift > 0)
res