From acde1b0abcbb5b22201656bc441272990fe591ba Mon Sep 17 00:00:00 2001 From: jackkoenig Date: Wed, 13 Apr 2016 16:19:39 -0700 Subject: Add isGround and isAggregate functions to Type Utils. --- src/main/scala/firrtl/Utils.scala | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/main/scala/firrtl/Utils.scala b/src/main/scala/firrtl/Utils.scala index 8a85957c..62b76944 100644 --- a/src/main/scala/firrtl/Utils.scala +++ b/src/main/scala/firrtl/Utils.scala @@ -677,6 +677,12 @@ object Utils { } implicit class TypeUtils(t: Type) { + def isGround: Boolean = t match { + case (_: UIntType | _: SIntType | _: ClockType) => true + case (_: BundleType | _: VectorType) => false + } + def isAggregate: Boolean = !t.isGround + def getType(): Type = t match { case v: VectorType => v.tpe -- cgit v1.2.3