diff options
| author | jackkoenig | 2016-04-13 16:19:39 -0700 |
|---|---|---|
| committer | jackkoenig | 2016-04-22 13:11:58 -0700 |
| commit | acde1b0abcbb5b22201656bc441272990fe591ba (patch) | |
| tree | 8a3ff11a425d9902634205c748ca1e3b15ffaaf3 | |
| parent | 353539fccc1185b4ce46eea940f6bef3be9a3d7b (diff) | |
Add isGround and isAggregate functions to Type Utils.
| -rw-r--r-- | src/main/scala/firrtl/Utils.scala | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
