From 6be76f79f873873497e40fa647f9456391b4d59a Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Thu, 9 May 2019 18:35:10 -0500 Subject: Fix treatment of Vec of Analog and Vec of Bundle of Analog (#1091) * IO(Analog) fixed for RawModule * Add a Analog Port for RawModule test & spec * Fixes around Module instantiation and ports in AnalogPortRawModuleTest * Shorten Comment * Add Data.isSynthesizable to distinguish SampleElementBinding This helps clarify the notion of being bound but not hardware. Data.topBindingOpt is now used to get the *actual* top binding, including across SampleElements (eg. in Analog checking that the top is bound to a Port or a Wire) * Fix pretty printing for Vec * Refactor tests for Vec of Analog, add test for Vec of Bundle of Analog --- chiselFrontend/src/main/scala/chisel3/core/RawModule.scala | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'chiselFrontend/src/main/scala/chisel3/core/RawModule.scala') diff --git a/chiselFrontend/src/main/scala/chisel3/core/RawModule.scala b/chiselFrontend/src/main/scala/chisel3/core/RawModule.scala index b1cae1b7..397debcb 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/RawModule.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/RawModule.scala @@ -75,12 +75,14 @@ abstract class RawModule(implicit moduleCompileOptions: CompileOptions) id match { case id: BaseModule => id.forceName(default=id.desiredName, _namespace) case id: MemBase[_] => id.forceName(default="_T", _namespace) - case id: Data if id.topBindingOpt.isDefined => id.topBinding match { - case OpBinding(_) | MemoryPortBinding(_) | PortBinding(_) | RegBinding(_) | WireBinding(_) => - id.forceName(default="_T", _namespace) - case _ => // don't name literals - } - case id: Data if id.topBindingOpt.isEmpty => // don't name unbound types + case id: Data => + if (id.isSynthesizable) { + id.topBinding match { + case OpBinding(_) | MemoryPortBinding(_) | PortBinding(_) | RegBinding(_) | WireBinding(_) => + id.forceName(default="_T", _namespace) + case _ => // don't name literals + } + } // else, don't name unbound types } id._onModuleClose } -- cgit v1.2.3