aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/passes/Checks.scala
diff options
context:
space:
mode:
authorJack2016-05-09 17:23:40 -0700
committerJack Koenig2016-06-10 16:32:30 -0700
commitcd0973b58c70f5b1e91f1d9a2abdf99a30f3f669 (patch)
tree9d8c81b3d50fde91b9963a36e3bfcd10d36fb2a5 /src/main/scala/firrtl/passes/Checks.scala
parentcc59c92f76bcfd6c632e5029770e08bc9d0898f2 (diff)
API Cleanup - Field & Flip
Add simple documentation Flip -> Orientation trait Orientation -> abstract class Orientation Orientation case objects to upper camel case REVERSE -> Flip
Diffstat (limited to 'src/main/scala/firrtl/passes/Checks.scala')
-rw-r--r--src/main/scala/firrtl/passes/Checks.scala14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/scala/firrtl/passes/Checks.scala b/src/main/scala/firrtl/passes/Checks.scala
index 88ba6ab2..0857382b 100644
--- a/src/main/scala/firrtl/passes/Checks.scala
+++ b/src/main/scala/firrtl/passes/Checks.scala
@@ -69,7 +69,7 @@ object CheckHighForm extends Pass with LazyLogging {
t map (findFlip) match {
case t: BundleType => {
for (f <- t.fields) {
- if (f.flip == REVERSE) has = true
+ if (f.flip == Flip) has = true
}
t
}
@@ -366,7 +366,7 @@ object CheckTypes extends Pass with LazyLogging {
case (t:BundleType) => {
var p = true
for (x <- t.fields ) {
- if (x.flip == REVERSE) p = false
+ if (x.flip == Flip) p = false
if (!passive(x.tpe)) p = false
}
p
@@ -420,7 +420,7 @@ object CheckTypes extends Pass with LazyLogging {
e
}
- def bulk_equals (t1: Type, t2: Type, flip1: Flip, flip2: Flip): Boolean = {
+ def bulk_equals (t1: Type, t2: Type, flip1: Orientation, flip2: Orientation): Boolean = {
//;println_all(["Inside with t1:" t1 ",t2:" t2 ",f1:" flip1 ",f2:" flip2])
(t1,t2) match {
case (ClockType, ClockType) => flip1 == flip2
@@ -448,7 +448,7 @@ object CheckTypes extends Pass with LazyLogging {
s map (check_types_e(get_info(s))) match {
case (s:Connect) => if (wt(tpe(s.loc)) != wt(tpe(s.exp))) errors.append(new InvalidConnect(s.info, s.loc.serialize, s.exp.serialize))
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: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.en)) != wt(ut()) ) errors.append(new EnNotUInt(s.info))
@@ -517,7 +517,7 @@ object CheckGenders extends Pass {
val kindx = get_kind(e)
def flipQ (t:Type) : Boolean = {
var fQ = false
- def flip_rec (t:Type,f:Flip) : Type = {
+ def flip_rec (t:Type,f:Orientation) : Type = {
(t) match {
case (t:BundleType) => {
for (field <- t.fields) {
@@ -525,11 +525,11 @@ object CheckGenders extends Pass {
}
}
case (t:VectorType) => flip_rec(t.tpe,f)
- case (t) => if (f == REVERSE) fQ = true
+ case (t) => if (f == Flip) fQ = true
}
t
}
- flip_rec(t,DEFAULT)
+ flip_rec(t,Default)
fQ
}