summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3/core/RawModule.scala
diff options
context:
space:
mode:
authorJack Koenig2019-05-09 18:35:10 -0500
committerAndrew Waterman2019-05-09 16:35:10 -0700
commit6be76f79f873873497e40fa647f9456391b4d59a (patch)
tree0660351d647f39baefa3b76180fd4dbb53d0285c /chiselFrontend/src/main/scala/chisel3/core/RawModule.scala
parenta9bf10cc40a5acf0f4bfb43744f9e12e8e1a0e25 (diff)
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
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/RawModule.scala')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/RawModule.scala14
1 files changed, 8 insertions, 6 deletions
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
}