From a6c8493e907dedcbb289f6d4f6323cc26fb1edc0 Mon Sep 17 00:00:00 2001 From: azidar Date: Mon, 25 Jul 2016 17:38:31 -0700 Subject: Changed InferTypes to update types if UnknownType or has an UnknownWidth Removed InferWidths after ExpandWhens --- src/main/scala/firrtl/Utils.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/scala/firrtl/Utils.scala') diff --git a/src/main/scala/firrtl/Utils.scala b/src/main/scala/firrtl/Utils.scala index fec25cf1..76c8e61e 100644 --- a/src/main/scala/firrtl/Utils.scala +++ b/src/main/scala/firrtl/Utils.scala @@ -284,7 +284,11 @@ object Utils extends LazyLogging { } def long_BANG (t:Type) : Long = { (t) match { - case g: GroundType => g.width.as[IntWidth].get.width.toLong + case g: GroundType => + g.width match { + case IntWidth(x) => x.toLong + case _ => throw new FIRRTLException(s"Expecting IntWidth, got: ${g.width}") + } case (t:BundleType) => { var w = 0 for (f <- t.fields) { w = w + long_BANG(f.tpe).toInt } -- cgit v1.2.3