diff options
| author | Donggyu | 2016-09-25 14:56:46 -0700 |
|---|---|---|
| committer | GitHub | 2016-09-25 14:56:46 -0700 |
| commit | 744ea401553cabfb31c7cc32aecfd8ca2764d1b8 (patch) | |
| tree | 628d4ce1d4bebc228fadd5a74365019f0dc5c62b /src/main/scala/firrtl/Utils.scala | |
| parent | bd1a3ae2d1130fbfb51ad4ef88349364c931680d (diff) | |
| parent | 2e553ec9859c369938ed035c83040dd80877f893 (diff) | |
Merge pull request #316 from ucb-bar/style-cleanup-take-3
Style cleanup take 3
Diffstat (limited to 'src/main/scala/firrtl/Utils.scala')
| -rw-r--r-- | src/main/scala/firrtl/Utils.scala | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/scala/firrtl/Utils.scala b/src/main/scala/firrtl/Utils.scala index 05628d3f..453e9a0c 100644 --- a/src/main/scala/firrtl/Utils.scala +++ b/src/main/scala/firrtl/Utils.scala @@ -41,6 +41,7 @@ import firrtl.PrimOps._ import firrtl.Mappers._ import firrtl.WrappedExpression._ import firrtl.WrappedType._ +import scala.collection.mutable import scala.collection.mutable.{StringBuilder, ArrayBuffer, LinkedHashMap, HashMap, HashSet} import java.io.PrintWriter import com.typesafe.scalalogging.LazyLogging @@ -80,7 +81,7 @@ object Utils extends LazyLogging { if (bi < BigInt(0)) "\"h" + bi.toString(16).substring(1) + "\"" else "\"h" + bi.toString(16) + "\"" - implicit def toWrappedExpression (x:Expression) = new WrappedExpression(x) + implicit def toWrappedExpression (x:Expression): WrappedExpression = new WrappedExpression(x) def ceilLog2(x: BigInt): Int = (x-1).bitLength def max(a: BigInt, b: BigInt): BigInt = if (a >= b) a else b def min(a: BigInt, b: BigInt): BigInt = if (a >= b) b else a @@ -144,7 +145,8 @@ object Utils extends LazyLogging { } /** Returns true if t, or any subtype, contains a flipped field - * @param t [[firrtl.ir.Type]] + * + * @param t type [[firrtl.ir.Type]] to be checked * @return if t contains [[firrtl.ir.Flip]] */ def hasFlip(t: Type): Boolean = t match { @@ -523,7 +525,7 @@ class MemoizedHash[T](val t: T) { * The graph is a map between the name of a node to set of names of that nodes children */ class ModuleGraph { - val nodes = HashMap[String, HashSet[String]]() + val nodes = mutable.HashMap[String, mutable.HashSet[String]]() /** * Add a child to a parent node @@ -534,7 +536,7 @@ class ModuleGraph { * @return a list indicating a path from child to parent, empty if no such path */ def add(parent: String, child: String): List[String] = { - val childSet = nodes.getOrElseUpdate(parent, new HashSet[String]) + val childSet = nodes.getOrElseUpdate(parent, new mutable.HashSet[String]) childSet += child pathExists(child, parent, List(child, parent)) } @@ -546,7 +548,7 @@ class ModuleGraph { * * @param child starting name * @param parent name to find in children (recursively) - * @param path + * @param path path being investigated as possible route * @return */ def pathExists(child: String, parent: String, path: List[String] = Nil): List[String] = { |
