pub struct ToggleLink<T: Digital> { /* private fields */ }Expand description
A valid/ready link for rare, wide items, built from plain registers.
§Why not a relay pipe
A Relay station chooses between its main and aux registers, which
costs a LUT per data bit per station. For the certificate path that came
to 4,760 LUTs per slice in build v12 (19,037 of its 410,003), to carry one
certificate per 128 signatures. This link carries the same handshake with
no per-bit logic: the data only ever moves forward, through plain
registers, and one bit in each direction carries the protocol.
§The protocol: a toggle (two-phase) handshake
sender side receiver side
item ─▶ [held] ─▶ [fwd 0] ─▶ [fwd 1] ─────────────▶ data, valid = seq != last
[seq ] ─▶ [seq 0] ─▶ [seq 1] ──────────────┘
ready = seq == ack ◀── [ack 1] ◀── [ack 0] ◀── [last] ◀── taken- The sender side loads an item into
heldand flipsseq, but only whenseq == ack: the receiver has taken everything sent so far. heldandseqtravel forward together throughTOGGLE_STAGESregisters. The receiver sees a new item while the delayedseqdiffers fromlast, theseqof the item it took most recently.- Taking the item copies the delayed
seqintolast, which endsvalidat the next clock and travels back asack.
held keeps the item until the receiver has taken it, so the forward
registers need no enable and no reset: they copy every clock. Every
output comes from a register or compares two registers. One item makes a
round trip in 2 * TOGGLE_STAGES + 2 clocks (6 with two stages), so this
link suits items that arrive far less often than that.
Trait Implementations§
Source§impl<T: Clone + Digital> Clone for ToggleLink<T>
impl<T: Clone + Digital> Clone for ToggleLink<T>
Source§fn clone(&self) -> ToggleLink<T>
fn clone(&self) -> ToggleLink<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug + Digital> Debug for ToggleLink<T>
impl<T: Debug + Digital> Debug for ToggleLink<T>
Source§impl<T: Digital> Default for ToggleLink<T>
impl<T: Digital> Default for ToggleLink<T>
Source§impl<T: Digital> Synchronous for ToggleLink<T>
impl<T: Digital> Synchronous for ToggleLink<T>
Source§type S = (<ToggleLink<T> as SynchronousDQ>::Q, <DFF<T> as Synchronous>::S, <DFF<bool> as Synchronous>::S, <[DFF<T>; 2] as Synchronous>::S, <[DFF<bool>; 2] as Synchronous>::S, <DFF<bool> as Synchronous>::S, <[DFF<bool>; 2] as Synchronous>::S)
type S = (<ToggleLink<T> as SynchronousDQ>::Q, <DFF<T> as Synchronous>::S, <DFF<bool> as Synchronous>::S, <[DFF<T>; 2] as Synchronous>::S, <[DFF<bool>; 2] as Synchronous>::S, <DFF<bool> as Synchronous>::S, <[DFF<bool>; 2] as Synchronous>::S)
PartialEq and Clone. It holds whatever
state is needed to compute the output of the circuit given it’s input.
This state is typically auto-derived by the Synchronous derive macro,
and it’s typically a struct containing the states of all the subcircuits,
along with their last know outputs.Source§fn init(&self) -> Self::S
fn init(&self) -> Self::S
Synchronous derive macro,
and it typically initializes the states of all the subcircuits to their
initial states.Source§fn children(
&self,
parent_scope: &ScopedName,
) -> impl Iterator<Item = Result<Descriptor<SyncKind>, RHDLError>>
fn children( &self, parent_scope: &ScopedName, ) -> impl Iterator<Item = Result<Descriptor<SyncKind>, RHDLError>>
Source§fn sim(
&self,
clock_reset: ClockReset,
input: <Self as SynchronousIO>::I,
state: &mut Self::S,
) -> <Self as SynchronousIO>::O
fn sim( &self, clock_reset: ClockReset, input: <Self as SynchronousIO>::I, state: &mut Self::S, ) -> <Self as SynchronousIO>::O
§fn descriptor(
&self,
scoped_name: ScopedName,
) -> Result<Descriptor<SyncKind>, RHDLError>
fn descriptor( &self, scoped_name: ScopedName, ) -> Result<Descriptor<SyncKind>, RHDLError>
Source§impl<T: Digital> SynchronousDQ for ToggleLink<T>
impl<T: Digital> SynchronousDQ for ToggleLink<T>
Source§impl<T: Digital> SynchronousIO for ToggleLink<T>
impl<T: Digital> SynchronousIO for ToggleLink<T>
Source§type Kernel = toggle_link_kernel<T>
type Kernel = toggle_link_kernel<T>
Auto Trait Implementations§
impl<T> Freeze for ToggleLink<T>where
T: Freeze,
impl<T> RefUnwindSafe for ToggleLink<T>where
T: RefUnwindSafe,
impl<T> Send for ToggleLink<T>where
T: Send,
impl<T> Sync for ToggleLink<T>where
T: Sync,
impl<T> Unpin for ToggleLink<T>where
T: Unpin,
impl<T> UnsafeUnpin for ToggleLink<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ToggleLink<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more