From 7cc53c772531d066b3331159882c82b8de9e5838 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sat, 15 Jun 2013 00:45:53 -0700 Subject: [PATCH] clean up Str --- rocket/src/main/scala/util.scala | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/rocket/src/main/scala/util.scala b/rocket/src/main/scala/util.scala index 98e7d5bf..1ec4b72f 100644 --- a/rocket/src/main/scala/util.scala +++ b/rocket/src/main/scala/util.scala @@ -56,7 +56,7 @@ object Str def apply(x: Fix): Bits = apply(x, 10) def apply(x: Fix, radix: Int): Bits = { val neg = x < Fix(0) - val abs = Mux(neg, -x, x).toUFix + val abs = x.abs if (radix != 10) { Cat(Mux(neg, Str('-'), Str(' ')), Str(abs, radix)) } else { @@ -79,16 +79,6 @@ object Str } } - def bigIntToString(x: BigInt): String = { - val s = new StringBuilder - var b = x - while (b != 0) { - s += (x & 0xFF).toChar - b = b >> 8 - } - s.toString - } - private def digit(d: Int): Char = (if (d < 10) '0'+d else 'a'-10+d).toChar private def digits(radix: Int): Vec[Bits] = AVec((0 until radix).map(i => Str(digit(i))))