aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackkoenig2016-04-29 10:16:25 -0700
committerjackkoenig2016-05-24 10:45:03 -0700
commit10b392e117682b0868de29b42f9e4e49cf6569d5 (patch)
treed32f36f43ab8e91dd2dbc2f1d65bc71dcf4d4d2f /src
parentf9e8895b73aeec9bb71449f8e3d0e6f7e7a0a478 (diff)
Remove prefix checking from Check High Form
Made obsolete by #120
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/firrtl/passes/Checks.scala33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/main/scala/firrtl/passes/Checks.scala b/src/main/scala/firrtl/passes/Checks.scala
index 083a18fd..49effc75 100644
--- a/src/main/scala/firrtl/passes/Checks.scala
+++ b/src/main/scala/firrtl/passes/Checks.scala
@@ -45,7 +45,6 @@ object CheckHighForm extends Pass with LazyLogging {
// Custom Exceptions
class NotUniqueException(name: String) extends PassException(s"${sinfo}: [module ${mname}] Reference ${name} does not have a unique name.")
- class IsPrefixException(prefix: String) extends PassException(s"${sinfo}: [module ${mname}] Symbol ${prefix} is a prefix.")
class InvalidLOCException extends PassException(s"${sinfo}: [module ${mname}] Invalid connect to an expression that is not a reference or a WritePort.")
class NegUIntException extends PassException(s"${sinfo}: [module ${mname}] UIntValue cannot be negative.")
class UndeclaredReferenceException(name: String) extends PassException(s"${sinfo}: [module ${mname}] Reference ${name} is not declared.")
@@ -63,35 +62,6 @@ object CheckHighForm extends Pass with LazyLogging {
class BadPrintfTrailingException extends PassException(s"${sinfo}: [module ${mname}] Bad printf format: trailing " + "\"%\"")
class BadPrintfIncorrectNumException extends PassException(s"${sinfo}: [module ${mname}] Bad printf format: incorrect number of arguments")
- // Trie Datastructure for prefix checking
- case class Trie(var children: HashMap[String, Trie], var end: Boolean) {
- def empty: Boolean = children.isEmpty
- def add(ls: Seq[String]): Boolean = {
- var t: Trie = this
- var sawEnd = false
- for (x <- ls) {
- if (t.end) sawEnd = true
- if (t.contains(x)) t = t.children(x)
- else {
- val temp = new Trie(HashMap[String,Trie](),false)
- t.children(x) = temp
- t = temp
- }
- }
- t.end = true
- sawEnd | !t.empty
- }
- def contains(s: String): Boolean = children.contains(s)
- def contains(ls: Seq[String]): Boolean = {
- var t: Trie = this
- for (x <- ls) {
- if (t.contains(x)) t = t.children(x)
- else return false
- }
- t.end
- }
- }
-
// Utility functions
def hasFlip(t: Type): Boolean = {
var has = false
@@ -202,7 +172,6 @@ object CheckHighForm extends Pass with LazyLogging {
def checkHighFormM(m: Module): Module = {
val names = HashMap[String, Boolean]()
val mnames = HashMap[String, Boolean]()
- val tries = Trie(HashMap[String, Trie](),false)
def checkHighFormE(e: Expression): Expression = {
def validSubexp(e: Expression): Expression = {
e match {
@@ -232,8 +201,6 @@ object CheckHighForm extends Pass with LazyLogging {
def checkName(name: String): String = {
if (names.contains(name)) errors.append(new NotUniqueException(name))
else names(name) = true
- val ls: Seq[String] = name.split('$')
- if (tries.add(ls)) errors.append(new IsPrefixException(name))
name
}
sinfo = s.getInfo