diff options
| author | Jack | 2016-05-09 17:18:17 -0700 |
|---|---|---|
| committer | Jack Koenig | 2016-06-10 16:32:18 -0700 |
| commit | cc59c92f76bcfd6c632e5029770e08bc9d0898f2 (patch) | |
| tree | d6a375198b9cf1f04cbffce2d48224c9a1034b5e /src/main/scala/firrtl/WIR.scala | |
| parent | 8aea3b3e5db6794523a64a724e12599df0ab2ab7 (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/WIR.scala')
| -rw-r--r-- | src/main/scala/firrtl/WIR.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/scala/firrtl/WIR.scala b/src/main/scala/firrtl/WIR.scala index bb555112..d38efc35 100644 --- a/src/main/scala/firrtl/WIR.scala +++ b/src/main/scala/firrtl/WIR.scala @@ -53,10 +53,10 @@ case class WRef(name:String,tpe:Type,kind:Kind,gender:Gender) extends Expression case class WSubField(exp:Expression,name:String,tpe:Type,gender:Gender) extends Expression case class WSubIndex(exp:Expression,value:Int,tpe:Type,gender:Gender) extends Expression case class WSubAccess(exp:Expression,index:Expression,tpe:Type,gender:Gender) extends Expression -case class WVoid() extends Expression { def tpe = UnknownType() } -case class WInvalid() extends Expression { def tpe = UnknownType() } +case class WVoid() extends Expression { def tpe = UnknownType } +case class WInvalid() extends Expression { def tpe = UnknownType } // Useful for splitting then remerging references -case object EmptyExpression extends Expression { def tpe = UnknownType() } +case object EmptyExpression extends Expression { def tpe = UnknownType } case class WDefInstance(info:Info,name:String,module:String,tpe:Type) extends Stmt with IsDeclaration // Resultant width is the same as the maximum input width @@ -125,7 +125,7 @@ class WrappedType (val t:Type) { (t,t2.t) match { case (t1:UIntType,t2:UIntType) => true case (t1:SIntType,t2:SIntType) => true - case (t1:ClockType,t2:ClockType) => true + case (ClockType, ClockType) => true case (t1:VectorType,t2:VectorType) => (wt(t1.tpe) == wt(t2.tpe) && t1.size == t2.size) case (t1:BundleType,t2:BundleType) => { var ret = true |
