From 735f5463932dda502b8ce7c843667d0d45faae93 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Wed, 20 Apr 2016 15:56:31 -0700 Subject: Use a global namespace for VarWidth names This matches the unstated assumption in InferWidths. Closes #135 --- src/main/scala/firrtl/passes/Passes.scala | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/scala/firrtl/passes/Passes.scala b/src/main/scala/firrtl/passes/Passes.scala index 6829d48c..ccc02f24 100644 --- a/src/main/scala/firrtl/passes/Passes.scala +++ b/src/main/scala/firrtl/passes/Passes.scala @@ -208,10 +208,9 @@ object InferTypes extends Pass { def remove_unknowns (t:Type)(implicit n: Namespace): Type = mapr(remove_unknowns_w _,t) def run (c:Circuit): Circuit = { val module_types = LinkedHashMap[String,Type]() - val module_wnamespaces = HashMap[String, Namespace]() + implicit val wnamespace = Namespace() def infer_types (m:Module) : Module = { val types = LinkedHashMap[String,Type]() - implicit val wnamespace = module_wnamespaces(m.name) def infer_types_e (e:Expression) : Expression = { e map (infer_types_e) match { case e:ValidIf => ValidIf(e.cond,e.value,tpe(e.value)) @@ -275,8 +274,6 @@ object InferTypes extends Pass { val modulesx = c.modules.map { m => { mname = m.name - implicit val wnamespace = Namespace() - module_wnamespaces += (m.name -> wnamespace) val portsx = m.ports.map(p => Port(p.info,p.name,p.direction,remove_unknowns(p.tpe))) m match { case m:InModule => InModule(m.info,m.name,portsx,m.body) -- cgit v1.2.3