summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3/core/Binding.scala
diff options
context:
space:
mode:
authorJack Koenig2019-03-29 15:10:13 -0700
committerGitHub2019-03-29 15:10:13 -0700
commit69e8250dd47210cee809c9ae231c1e320d76c084 (patch)
treeaa639ef424141d07adfaadb06712a90ebbe34a14 /chiselFrontend/src/main/scala/chisel3/core/Binding.scala
parent0d00420ba2d00a957ace9112ab570fe52abea9d3 (diff)
Ignore empty aggregates elements when binding aggregate direction (#946)
Previously, including an empty aggregate in a Bundle would cause a MixedDirectionAggregateException because it has no elements and thus doesn't have a direction * Add SampleElementBinding for Vec sample elements * Add ActualDirection.Empty for bound empty aggregates
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Binding.scala')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Binding.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Binding.scala b/chiselFrontend/src/main/scala/chisel3/core/Binding.scala
index 55e6bcf9..37ce3f66 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Binding.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Binding.scala
@@ -87,7 +87,7 @@ sealed trait UnconstrainedBinding extends TopBinding {
def location: Option[BaseModule] = None
}
// A constrained binding can only be read/written by specific modules
-// Location will track where this Module is
+// Location will track where this Module is, and the bound object can be referenced in FIRRTL
sealed trait ConstrainedBinding extends TopBinding {
def enclosure: BaseModule
def location: Option[BaseModule] = Some(enclosure)
@@ -107,6 +107,10 @@ case class WireBinding(enclosure: RawModule) extends ConstrainedBinding
case class ChildBinding(parent: Data) extends Binding {
def location: Option[BaseModule] = parent.topBinding.location
}
+/** Special binding for Vec.sample_element */
+case class SampleElementBinding[T <: Data](parent: Vec[T]) extends Binding {
+ def location = parent.topBinding.location
+}
// A DontCare element has a specific Binding, somewhat like a literal.
// It is a source (RHS). It may only be connected/applied to sinks.
case class DontCareBinding() extends UnconstrainedBinding