diplomacy: leverage new Parameters defaults
This commit is contained in:
parent
655a08f12e
commit
7a8364ef08
@ -23,7 +23,8 @@ object CardinalityInferenceDirection {
|
||||
case object NO_INFERENCE extends T
|
||||
}
|
||||
|
||||
case object CardinalityInferenceDirectionKey extends Field[CardinalityInferenceDirection.T]
|
||||
case object CardinalityInferenceDirectionKey extends
|
||||
Field[CardinalityInferenceDirection.T](CardinalityInferenceDirection.NO_INFERENCE)
|
||||
|
||||
// DI = Downwards flowing Parameters received on the inner side of the node
|
||||
// UI = Upwards flowing Parameters generated by the inner side of the node
|
||||
@ -284,11 +285,10 @@ abstract class MixedNode[DI, UI, EI, BI <: Data, DO, UO, EO, BO <: Data](
|
||||
override def :*= (h: OutwardNodeHandle[DI, UI, BI])(implicit p: Parameters, sourceInfo: SourceInfo): Option[MonitorBase] = bind(h, BIND_STAR, true)
|
||||
override def :=* (h: OutwardNodeHandle[DI, UI, BI])(implicit p: Parameters, sourceInfo: SourceInfo): Option[MonitorBase] = bind(h, BIND_QUERY, true)
|
||||
override def :=? (h: OutwardNodeHandle[DI, UI, BI])(implicit p: Parameters, sourceInfo: SourceInfo): Option[MonitorBase] = {
|
||||
p.lift(CardinalityInferenceDirectionKey) match {
|
||||
case Some(CardinalityInferenceDirection.SOURCE_TO_SINK) => this :=* h
|
||||
case Some(CardinalityInferenceDirection.SINK_TO_SOURCE) => this :*= h
|
||||
case Some(CardinalityInferenceDirection.NO_INFERENCE) => this := h
|
||||
case None => this := h
|
||||
p(CardinalityInferenceDirectionKey) match {
|
||||
case CardinalityInferenceDirection.SOURCE_TO_SINK => this :=* h
|
||||
case CardinalityInferenceDirection.SINK_TO_SOURCE => this :*= h
|
||||
case CardinalityInferenceDirection.NO_INFERENCE => this := h
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,9 +32,6 @@ package object diplomacy
|
||||
case CardinalityInferenceDirectionKey => CardinalityInferenceDirection.NO_INFERENCE
|
||||
})
|
||||
def FlipStar[T](body: Parameters => T)(implicit p: Parameters) = body(p.alterPartial {
|
||||
case CardinalityInferenceDirectionKey => p
|
||||
.lift(CardinalityInferenceDirectionKey)
|
||||
.map(_.flip)
|
||||
.getOrElse(CardinalityInferenceDirection.NO_INFERENCE)
|
||||
case CardinalityInferenceDirectionKey => p(CardinalityInferenceDirectionKey).flip
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user