diff options
| author | ducky | 2018-06-28 15:57:13 -0700 |
|---|---|---|
| committer | Richard Lin | 2018-07-04 18:39:28 -0500 |
| commit | 7ab85ec6f781fc48796add6d895174a952383806 (patch) | |
| tree | 77fd3a4706131a5ca90f036fa6b51818f174048a /chiselFrontend/src/main/scala/chisel3/core/Data.scala | |
| parent | 4cf5caf86a072bc4af581536930469b82796dd27 (diff) | |
binding => topBinding so that partial Bundles work and undefined Bundle members properly forward to DontCareBinding
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Data.scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Data.scala | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala index ab277d9f..7ff1ec0b 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala @@ -88,7 +88,7 @@ object DataMirror { // Internal reflection-style APIs, subject to change and removal whenever. object internal { - def isSynthesizable(target: Data) = target.hasBinding + def isSynthesizable(target: Data) = target.topBindingOpt.isDefined // For those odd cases where you need to care about object reference and uniqueness def chiselTypeClone[T<:Data](target: Data): T = { target.cloneTypeFull.asInstanceOf[T] @@ -241,10 +241,8 @@ abstract class Data extends HasId with NamedComponent { // This information is supplemental (more than is necessary to generate FIRRTL) and is used to // perform checks in Chisel, where more informative error messages are possible. private var _binding: Option[Binding] = None - private[core] def bindingOpt = _binding - private[core] def hasBinding = _binding.isDefined // Only valid after node is bound (synthesizable), crashes otherwise - private[core] def binding = _binding.get + protected def binding: Option[Binding] = _binding protected def binding_=(target: Binding) { if (_binding.isDefined) { throw Binding.RebindingException(s"Attempted reassignment of binding to $this") @@ -253,7 +251,7 @@ abstract class Data extends HasId with NamedComponent { } private[core] def topBindingOpt: Option[TopBinding] = { - bindingOpt match { + _binding match { case Some(binding) => binding match { case ChildBinding(parent) => parent.topBindingOpt case binding: TopBinding => Some(binding) |
