pub struct DualTableRom { /* private fields */ }Expand description
Two registered T0 lookups per cycle from one true dual-port ROM.
§Why this is a hand-written RHDL primitive
A block RAM tile on the U280 (a BRAM18) has two independent read ports.
RHDL’s own SyncBRAM exposes only one of them, so the first version of
this type was two SyncBRAMs holding the same table: one BRAM18 per
lookup. Build v4 (four slices, T-tables in rounds 3–8) needed 4,033
BRAM18 sites in the kernel region, which has 3,552, and failed placement.
Serving both lookups from one memory halves that: a table round needs 32
BRAM18s instead of 64.
RHDL builds its memories the same way this type does: SyncBRAM is a
Rust simulation model plus a Verilog template, registered with RHDL as a
netlist primitive. DualTableRom follows that recipe exactly (compare
rhdl_fpga::core::ram::synchronous), with a second read port and no write
port. Nothing about it is opaque: the simulation model below is ten lines,
the Verilog is printed in full by DualTableRom::hdl, and the tests in
tests/chain_step.rs check every table round against the AES reference.
§Timing
Addresses presented in cycle t give their words in cycle t + 1, on
both ports, exactly like the two-ROM version it replaces. The output
before the first clock edge is unspecified; ownership lives in the
enclosing pipeline’s valid bits. Reset is ignored: a ROM has no state.
┌──────────── one BRAM18 (ram_style = "block") ────────────┐
a ──────▶ │ port A: o_a <= T0[a] 256 × 32 T0, preloaded │ ──▶ o.a
b ──────▶ │ port B: o_b <= T0[b] by the bitstream │ ──▶ o.b
└──────────────────────────────────────────────────────────┘Trait Implementations§
Source§impl Clone for DualTableRom
impl Clone for DualTableRom
Source§fn clone(&self) -> DualTableRom
fn clone(&self) -> DualTableRom
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DualTableRom
impl Debug for DualTableRom
Source§impl Default for DualTableRom
The ROM holds T0.
impl Default for DualTableRom
The ROM holds T0.
Source§impl Synchronous for DualTableRom
Behaviour (simulation) and structure (Verilog) of the dual-port ROM.
impl Synchronous for DualTableRom
Behaviour (simulation) and structure (Verilog) of the dual-port ROM.
Source§fn sim(
&self,
clock_reset: ClockReset,
input: Self::I,
state: &mut Self::S,
) -> Self::O
fn sim( &self, clock_reset: ClockReset, input: Self::I, state: &mut Self::S, ) -> Self::O
One half-clock step: look both addresses up while the clock is low, capture on the rising edge, always show the captured words.
Source§fn descriptor(
&self,
scoped_name: ScopedName,
) -> Result<Descriptor<SyncKind>, RHDLError>
fn descriptor( &self, scoped_name: ScopedName, ) -> Result<Descriptor<SyncKind>, RHDLError>
Register the Verilog below with RHDL as a primitive, the same way
SyncBRAM does.
Source§impl SynchronousDQ for DualTableRom
A primitive has no child circuits, so no D/Q wiring.
impl SynchronousDQ for DualTableRom
A primitive has no child circuits, so no D/Q wiring.
Source§impl SynchronousIO for DualTableRom
Ports of DualTableRom: two addresses in, two table words out.
impl SynchronousIO for DualTableRom
Ports of DualTableRom: two addresses in, two table words out.
Auto Trait Implementations§
impl Freeze for DualTableRom
impl RefUnwindSafe for DualTableRom
impl Send for DualTableRom
impl Sync for DualTableRom
impl Unpin for DualTableRom
impl UnsafeUnpin for DualTableRom
impl UnwindSafe for DualTableRom
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