pub struct Build {
pub slices: u32,
pub uram_per_lane: u32,
pub bram_per_lane: u32,
}Expand description
One buildable configuration.
It is exactly the set of compile-time choices that change cost and speed:
the DSIG_SLICES and DSIG_SBOX_PLACEMENT build variables. Build::command prints the command that builds it.
Fields§
§slices: u32Slices (2, 4 or 8).
Each slice is one complete signer; more slices means more signatures per second and proportionally more LUTs.
uram_per_lane: u32S-boxes per lane in UltraRAM.
Count out of SBOXES_PER_LANE; the same number in every lane.
bram_per_lane: u32S-boxes per lane in block RAM.
Count out of SBOXES_PER_LANE; two share one BRAM18 (a quarter of
a tile each).
uram_per_lane + bram_per_lane never exceeds 494 in builds made by
Build::fill.
Implementations§
Source§impl Build
impl Build
Sourcepub const fn lut_only(slices: u32) -> Build
pub const fn lut_only(slices: u32) -> Build
All S-boxes in LUTs.
The baseline build: no RAM placement, closest to the routed measurement.
Sourcepub fn fill(slices: u32) -> Build
pub fn fill(slices: u32) -> Build
The most S-boxes per lane that spare UltraRAM, then spare block RAM, can hold.
UltraRAM is filled first, block RAM takes the remainder. Both keep
RAM_HEADROOM free.
Sourcepub fn fill_within(slices: u32, uram: f64, bram36: f64) -> Build
pub fn fill_within(slices: u32, uram: f64, bram36: f64) -> Build
Like Build::fill, but only uram UltraRAMs and bram36 BRAM36
tiles are available in total (the share the chip planner gives DSig).
Why: on a shared chip DSig gets part of the RAM, not the whole device. Filling the whole device’s spare RAM would make every partial share look too small.
Sourcepub fn all() -> Vec<Build>
pub fn all() -> Vec<Build>
The all-LUT and the RAM-filled build of every slice count.
Six candidates in total: the two ends of the placement range for each of the three slice counts. In this model, moving more S-boxes into free RAM only lowers LUTs, so the partial placements in between are not listed.
Sourcepub fn features(self) -> String
pub fn features(self) -> String
A short name: the slice feature plus the placement, if any.
Used as the row label in sweep, for example slices-2 or
slices-4 uram=… bram=….
Sourcepub fn command(self) -> String
pub fn command(self) -> String
The command that builds it.
So a reader can copy the planner’s answer straight into a shell.
Sourcepub fn resources(self) -> Resources
pub fn resources(self) -> Resources
Predicted kernel resources.
The cost model, one line per resource:
lut = slices × SLICE_LUT − lanes × (placed × 32 − loader) + Ed25519 + glue
bram36 = slices × SLICE_BRAM36 + lanes × bram_per_lane / 2 + Ed25519 + glue
uram = slices × 72 + lanes × uram_per_lane
dsp = Ed25519 onlylanes = slices × 3, placed = uram_per_lane + bram_per_lane, and
loader is LOADER_LUT when the lane has UltraRAM S-boxes.
Sourcepub fn fits(self, lut_percent: f64) -> bool
pub fn fits(self, lut_percent: f64) -> bool
Whether the build fits a LUT budget (percent of LUT_CAP) and the
device’s block RAM, UltraRAM and DSPs.
lut_percent is a percentage, so 100.0 means the full 420,000-LUT
cap. The RAM and DSP limits are the whole device, because the cap only
applies to LUTs.
Sourcepub fn signatures_per_second(self, mhz: f64) -> (f64, &'static str)
pub fn signatures_per_second(self, mhz: f64) -> (f64, &'static str)
Predicted steady-state signatures per second at mhz, and the stage
that limits it.
The engine is a pipeline of three stages that all must keep up, so the slowest one sets the rate:
slices ─────────▶ certificates ─────────▶ frame writes
SLICES × f / 68 128 × f / 895 SLICES × 64 B × f / (26 × 64 B)
└──────────────── min(...) × STEADY_STATE_EFFICIENCY ──▶ sig/sThe returned name ("slices", "certificates" or "frame writes")
tells you which stage to improve next.
Trait Implementations§
impl Copy for Build
impl Eq for Build
impl StructuralPartialEq for Build
Auto Trait Implementations§
impl Freeze for Build
impl RefUnwindSafe for Build
impl Send for Build
impl Sync for Build
impl Unpin for Build
impl UnsafeUnpin for Build
impl UnwindSafe for Build
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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