summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3/core/Binding.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/Binding.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/Binding.scala')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Binding.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Binding.scala b/chiselFrontend/src/main/scala/chisel3/core/Binding.scala
index 37ce3f66..e30b91ec 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Binding.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Binding.scala
@@ -30,7 +30,7 @@ object requireIsHardware {
case Some(x: BaseModule) => x._compatAutoWrapPorts
case _ =>
}
- if (!node.topBindingOpt.isDefined) {
+ if (!node.isSynthesizable) {
val prefix = if (msg.nonEmpty) s"$msg " else ""
throw Binding.ExpectedHardwareException(s"$prefix'$node' must be hardware, " +
"not a bare Chisel type. Perhaps you forgot to wrap it in Wire(_) or IO(_)?")
@@ -41,7 +41,7 @@ object requireIsHardware {
/** Requires that a node is a chisel type (not hardware, "unbound")
*/
object requireIsChiselType {
- def apply(node: Data, msg: String = ""): Unit = if (node.topBindingOpt.isDefined) {
+ def apply(node: Data, msg: String = ""): Unit = if (node.isSynthesizable) {
val prefix = if (msg.nonEmpty) s"$msg " else ""
throw Binding.ExpectedChiselTypeException(s"$prefix'$node' must be a Chisel type, not hardware")
}