From cf6f33a52fc1a8bf6f38347c5244740b3066f211 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Tue, 4 Aug 2015 04:03:24 -0700 Subject: Fix Fill on Bool --- src/main/scala/Chisel/utils.scala | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main/scala/Chisel/utils.scala b/src/main/scala/Chisel/utils.scala index b1e6eb20..830687b8 100644 --- a/src/main/scala/Chisel/utils.scala +++ b/src/main/scala/Chisel/utils.scala @@ -168,12 +168,6 @@ object MuxLookup { } object Fill { - def apply(n: Int, x: Bool): UInt = n match { - case 0 => UInt(width=0) - case 1 => x - case x if n > 1 => UInt(0,n) - UInt(x) - case _ => throw new IllegalArgumentException(s"n (=$n) must be nonnegative integer.") - } def apply(n: Int, y: UInt): UInt = { n match { case 0 => UInt(width=0) @@ -187,6 +181,9 @@ object Fill { case _ => throw new IllegalArgumentException(s"n (=$n) must be nonnegative integer.") } } + def apply(n: Int, x: Bool): UInt = + if (n > 1) UInt(0,n) - x + else apply(n, x: UInt) } object MuxCase { -- cgit v1.2.3