Trait hazardflow_designs::std::combinators::merge::MergeExt
source · pub trait MergeExt<const N: usize, const ED: Dep>: Interface{
type EH: Hazard;
// Required method
fn cmerge(self) -> I<SelH<Self::EH, N>, ED>;
// Provided method
fn merge(self) -> I<Self::EH, ED> { ... }
}Expand description
Extension trait for merge and cmerge.
Required Associated Types§
Required Methods§
Provided Methods§
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<const N: usize, H: Hazard, const D: Dep> MergeExt<N, { Dep::Demanding }> for [I<AndH<H>, D>; N]
impl<const N: usize, H: Hazard, const D: Dep> MergeExt<N, { Dep::Demanding }> for [I<AndH<H>, D>; N]
source§fn cmerge(self) -> I<SelH<AndH<H>, N>, { Dep::Demanding }>
fn cmerge(self) -> I<SelH<AndH<H>, N>, { Dep::Demanding }>
Merges N AndH<H> hazard interfaces with a control signal that outputs which interface is selected.
- Payloads: Selects the first ingress interface on which a transfer can happen
(
ip[sel].is_some_and(|p| AndH::<H>::ready(p, er))), and outputs the selected interface’s payload. - Resolver: If the index of the selected interface is
sel, the ingress ready signals for the interfaces0..=selis true, and(sel + 1)..Nis false. This is to ensure that a transfer happens only on the interfacesel. The inner valueH::Rof the resolver is duplicated to multiple interfaces.
| Interface | Ingress | Egress |
|---|---|---|
| Fwd | Array<HOption<H::P>, N> | (HOption<H::P>, BoundedU<N>) |
| Bwd | Array<Ready<H::R>, N> | Ready<H::R> |
type EH = AndH<H>
source§impl<const N: usize, P: Copy, R: Copy, const D: Dep> MergeExt<N, D> for [I<ValidH<P, R>, D>; N]
impl<const N: usize, P: Copy, R: Copy, const D: Dep> MergeExt<N, D> for [I<ValidH<P, R>, D>; N]
source§fn cmerge(self) -> I<SelH<ValidH<P, R>, N>, D>
fn cmerge(self) -> I<SelH<ValidH<P, R>, N>, D>
Merges N ValidH hazard interfaces with a control signal that outputs which interface is selected.
- Payloads: Selects the first ingress interface with a valid payload and outputs that payload.
- Resolver: Duplicated to multiple interfaces.
| Interface | Ingress | Egress |
|---|---|---|
| Fwd | Array<HOption<P>, N> | (HOption<P>, BoundedU<N>) |
| Bwd | Array<R, N> | R |