aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/passes/Checks.scala
diff options
context:
space:
mode:
authorJack2016-05-09 23:55:47 -0700
committerJack Koenig2016-06-10 16:33:01 -0700
commitc1504e2179e509632fa8d9ab44d87191b46cf851 (patch)
tree80e520a1b193590c3ae84e5b6bf81728c840ab85 /src/main/scala/firrtl/passes/Checks.scala
parent26e33c343332c2f65bb45bc17b40a9cb7d22e2fd (diff)
API Cleanup - Expression
trait Expression -> abstract class Expression Ref -> Reference abbrev. exp -> expr Add abstract class Literal UIntValue -> UIntLiteral extends Literal SIntValue -> SIntLiteral extends Literal
Diffstat (limited to 'src/main/scala/firrtl/passes/Checks.scala')
-rw-r--r--src/main/scala/firrtl/passes/Checks.scala18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/scala/firrtl/passes/Checks.scala b/src/main/scala/firrtl/passes/Checks.scala
index 272c96ea..1a11c0a4 100644
--- a/src/main/scala/firrtl/passes/Checks.scala
+++ b/src/main/scala/firrtl/passes/Checks.scala
@@ -148,7 +148,7 @@ object CheckHighForm extends Pass with LazyLogging {
}
def checkValidLoc(e: Expression) = {
e match {
- case e @ ( _: UIntValue | _: SIntValue | _: DoPrim ) => errors.append(new InvalidLOCException)
+ case e @ (_: UIntLiteral | _: SIntLiteral | _: DoPrim ) => errors.append(new InvalidLOCException)
case _ => // Do Nothing
}
}
@@ -189,7 +189,7 @@ object CheckHighForm extends Pass with LazyLogging {
validSubexp(e.exp)
e
}
- case e: UIntValue =>
+ case e: UIntLiteral =>
if (e.value < 0) errors.append(new NegUIntException)
case e => e map (validSubexp)
}
@@ -411,7 +411,7 @@ object CheckTypes extends Pass with LazyLogging {
if (!passive(tpe(e))) errors.append(new ValidIfPassiveTypes(info))
if (!(tpe(e.cond).typeof[UIntType])) errors.append(new ValidIfCondUInt(info))
}
- case (_:UIntValue|_:SIntValue) => false
+ case (_:UIntLiteral | _:SIntLiteral) => false
}
e
}
@@ -560,8 +560,8 @@ object CheckGenders extends Pass {
case (e:WSubIndex) => get_gender(e.exp,genders)
case (e:WSubAccess) => get_gender(e.exp,genders)
case (e:DoPrim) => MALE
- case (e:UIntValue) => MALE
- case (e:SIntValue) => MALE
+ case (e:UIntLiteral) => MALE
+ case (e:SIntLiteral) => MALE
case (e:Mux) => MALE
case (e:ValidIf) => MALE
}
@@ -577,8 +577,8 @@ object CheckGenders extends Pass {
case (e:DoPrim) => for (e <- e.args ) { check_gender(info,genders,MALE)(e) }
case (e:Mux) => e map (check_gender(info,genders,MALE))
case (e:ValidIf) => e map (check_gender(info,genders,MALE))
- case (e:UIntValue) => false
- case (e:SIntValue) => false
+ case (e:UIntLiteral) => false
+ case (e:SIntLiteral) => false
}
e
}
@@ -659,7 +659,7 @@ object CheckWidths extends Pass {
}
def check_width_e (info:Info)(e:Expression) : Expression = {
(e map (check_width_e(info))) match {
- case (e:UIntValue) => {
+ case (e:UIntLiteral) => {
(e.width) match {
case (w:IntWidth) =>
if (scala.math.max(1,e.value.bitLength) > w.width) {
@@ -669,7 +669,7 @@ object CheckWidths extends Pass {
}
check_width_w(info)(e.width)
}
- case (e:SIntValue) => {
+ case (e:SIntLiteral) => {
(e.width) match {
case (w:IntWidth) =>
if (e.value.bitLength + 1 > w.width) errors.append(new WidthTooSmall(info, e.value))