aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/passes/Checks.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/passes/Checks.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/passes/Checks.scala')
-rw-r--r--src/main/scala/firrtl/passes/Checks.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/scala/firrtl/passes/Checks.scala b/src/main/scala/firrtl/passes/Checks.scala
index f9e91f67..88ba6ab2 100644
--- a/src/main/scala/firrtl/passes/Checks.scala
+++ b/src/main/scala/firrtl/passes/Checks.scala
@@ -423,7 +423,7 @@ object CheckTypes extends Pass with LazyLogging {
def bulk_equals (t1: Type, t2: Type, flip1: Flip, flip2: Flip): Boolean = {
//;println_all(["Inside with t1:" t1 ",t2:" t2 ",f1:" flip1 ",f2:" flip2])
(t1,t2) match {
- case (t1:ClockType,t2:ClockType) => flip1 == flip2
+ case (ClockType, ClockType) => flip1 == flip2
case (t1:UIntType,t2:UIntType) => flip1 == flip2
case (t1:SIntType,t2:SIntType) => flip1 == flip2
case (t1:BundleType,t2:BundleType) => {
@@ -450,14 +450,14 @@ object CheckTypes extends Pass with LazyLogging {
case (s:DefRegister) => if (wt(s.tpe) != wt(tpe(s.init))) errors.append(new InvalidRegInit(s.info))
case (s:BulkConnect) => if (!bulk_equals(tpe(s.loc),tpe(s.exp),DEFAULT,DEFAULT) ) errors.append(new InvalidConnect(s.info, s.loc.serialize, s.exp.serialize))
case (s:Stop) => {
- if (wt(tpe(s.clk)) != wt(ClockType()) ) errors.append(new ReqClk(s.info))
+ if (wt(tpe(s.clk)) != wt(ClockType) ) errors.append(new ReqClk(s.info))
if (wt(tpe(s.en)) != wt(ut()) ) errors.append(new EnNotUInt(s.info))
}
case (s:Print)=> {
for (x <- s.args ) {
if (wt(tpe(x)) != wt(ut()) && wt(tpe(x)) != wt(st()) ) errors.append(new PrintfArgNotGround(s.info))
}
- if (wt(tpe(s.clk)) != wt(ClockType()) ) errors.append(new ReqClk(s.info))
+ if (wt(tpe(s.clk)) != wt(ClockType) ) errors.append(new ReqClk(s.info))
if (wt(tpe(s.en)) != wt(ut()) ) errors.append(new EnNotUInt(s.info))
}
case (s:Conditionally) => if (wt(tpe(s.pred)) != wt(ut()) ) errors.append(new PredNotUInt(s.info))