pub struct TableChainStepLane<const TABLE_MASK: usize> { /* private fields */ }Expand description
ChainStepLane with selected AES rounds moved from LUTs into T-table ROMs.
Bit r of TABLE_MASK moves AES round r (0-based) into
DualTableRoms. Only rounds 3–8 are allowed: there KNOWN proves
nothing constant and every output byte is needed, so a table never replaces
logic synthesis would have deleted anyway. Each table round uses 32 ROMs,
normally 32 BRAM18s.
A precision note: by the same backward analysis as LIVE_SBOX, rounds
7 and 8 each have 16 positions that cannot reach the output (see the
per-round table in the module docs). In those rounds the ROM pairs for
the unobserved positions have no loads and are removed like the S-boxes
they replace, so the table still never pays for deleted work; it just
uses fewer ROMs than 32.
LUT round: mixed[r-1] ─▶ SboxStage (reg) ─▶ MixColumns+key (LUT) ─▶ mixed[r]
table round: mixed[r-1] ─▶ 32 × ROM (reg) ─▶ 4-way XOR+key (LUT) ─▶ mixed[r]Latency, II and tag behaviour equal ChainStepLane; the tests check
several masks against the same reference.
Why offer this at all: block RAM is a separate budget from LUTs. Moving a
round into tables trades LUTs (the binding limit) for block RAMs that
would otherwise sit unused. TABLE_MASK = 0 is exactly ChainStepLane.
This is the lane type the Haraka profile instantiates (see
crate::chain_lane).
Every round keeps both a LUT path and, if it is a table slot, a table
path in the source. The constant TABLE_MASK picks one per round, and
synthesis deletes the other: unused ROMs have no loads, and an S-box stage
fed with zeros folds to constants.
Trait Implementations§
Source§impl<const TABLE_MASK: usize> Clone for TableChainStepLane<TABLE_MASK>
impl<const TABLE_MASK: usize> Clone for TableChainStepLane<TABLE_MASK>
Source§fn clone(&self) -> TableChainStepLane<TABLE_MASK>
fn clone(&self) -> TableChainStepLane<TABLE_MASK>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<const TABLE_MASK: usize> Debug for TableChainStepLane<TABLE_MASK>
impl<const TABLE_MASK: usize> Debug for TableChainStepLane<TABLE_MASK>
Source§impl<const TABLE_MASK: usize> Default for TableChainStepLane<TABLE_MASK>
Build a lane, rejecting masks outside rounds 3..=8.
impl<const TABLE_MASK: usize> Default for TableChainStepLane<TABLE_MASK>
Build a lane, rejecting masks outside rounds 3..=8.
Source§impl<const TABLE_MASK: usize> Synchronous for TableChainStepLane<TABLE_MASK>
impl<const TABLE_MASK: usize> Synchronous for TableChainStepLane<TABLE_MASK>
Source§type S = (<TableChainStepLane<TABLE_MASK> as SynchronousDQ>::Q, <SboxStages as Synchronous>::S, <SboxLoader as Synchronous>::S, <[[DualTableRom; 32]; 6] as Synchronous>::S, <[DFF<[Bits<8>; 64]>; 10] as Synchronous>::S, <[DFF<[Bits<8>; 18]>; 20] as Synchronous>::S, <[DFF<Bits<32>>; 20] as Synchronous>::S, <[DFF<bool>; 20] as Synchronous>::S)
type S = (<TableChainStepLane<TABLE_MASK> as SynchronousDQ>::Q, <SboxStages as Synchronous>::S, <SboxLoader as Synchronous>::S, <[[DualTableRom; 32]; 6] as Synchronous>::S, <[DFF<[Bits<8>; 64]>; 10] as Synchronous>::S, <[DFF<[Bits<8>; 18]>; 20] as Synchronous>::S, <[DFF<Bits<32>>; 20] as Synchronous>::S, <[DFF<bool>; 20] 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<const TABLE_MASK: usize> SynchronousDQ for TableChainStepLane<TABLE_MASK>
impl<const TABLE_MASK: usize> SynchronousDQ for TableChainStepLane<TABLE_MASK>
Source§impl<const TABLE_MASK: usize> SynchronousIO for TableChainStepLane<TABLE_MASK>
Same ports as ChainStepLane.
impl<const TABLE_MASK: usize> SynchronousIO for TableChainStepLane<TABLE_MASK>
Same ports as ChainStepLane.
Auto Trait Implementations§
impl<const TABLE_MASK: usize> Freeze for TableChainStepLane<TABLE_MASK>
impl<const TABLE_MASK: usize> RefUnwindSafe for TableChainStepLane<TABLE_MASK>
impl<const TABLE_MASK: usize> Send for TableChainStepLane<TABLE_MASK>
impl<const TABLE_MASK: usize> Sync for TableChainStepLane<TABLE_MASK>
impl<const TABLE_MASK: usize> Unpin for TableChainStepLane<TABLE_MASK>
impl<const TABLE_MASK: usize> UnsafeUnpin for TableChainStepLane<TABLE_MASK>
impl<const TABLE_MASK: usize> UnwindSafe for TableChainStepLane<TABLE_MASK>
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