aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/IR.scala
diff options
context:
space:
mode:
authorJack2016-05-09 17:18:17 -0700
committerJack Koenig2016-06-10 16:32:18 -0700
commitcc59c92f76bcfd6c632e5029770e08bc9d0898f2 (patch)
treed6a375198b9cf1f04cbffce2d48224c9a1034b5e /src/main/scala/firrtl/IR.scala
parent8aea3b3e5db6794523a64a724e12599df0ab2ab7 (diff)
API Cleanup - Type
trait Type -> abstract class Type case class ClockType() -> case object ClockType case class UnknownType() -> case object UnknownType Add GroundType and AggregateType ClockType has width of IntWidth(1)
Diffstat (limited to 'src/main/scala/firrtl/IR.scala')
-rw-r--r--src/main/scala/firrtl/IR.scala20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/main/scala/firrtl/IR.scala b/src/main/scala/firrtl/IR.scala
index d9dab2d9..08be0fe8 100644
--- a/src/main/scala/firrtl/IR.scala
+++ b/src/main/scala/firrtl/IR.scala
@@ -153,13 +153,19 @@ case object REVERSE extends Flip
case class Field(name: String, flip: Flip, tpe: Type) extends AST with HasName
-trait Type extends AST
-case class UIntType(width: Width) extends Type
-case class SIntType(width: Width) extends Type
-case class BundleType(fields: Seq[Field]) extends Type
-case class VectorType(tpe: Type, size: Int) extends Type
-case class ClockType() extends Type
-case class UnknownType() extends Type
+abstract class Type extends AST
+abstract class GroundType extends Type {
+ val width: Width
+}
+abstract class AggregateType extends Type
+case class UIntType(width: Width) extends GroundType
+case class SIntType(width: Width) extends GroundType
+case class BundleType(fields: Seq[Field]) extends AggregateType
+case class VectorType(tpe: Type, size: Int) extends AggregateType
+case object ClockType extends GroundType {
+ val width = IntWidth(1)
+}
+case object UnknownType extends Type
/** [[Port]] Direction */
abstract class Direction extends AST