Skip to main content

Component

Trait Component 

Source
pub trait Component {
    // Required methods
    fn name(&self) -> String;
    fn role(&self) -> Role;
    fn knobs(&self) -> Vec<Knob>;
    fn set_knob(&mut self, index: usize, value: f64);
    fn plan(&self, share: &Share, cx: &Context) -> Option<Plan>;

    // Provided methods
    fn fixed(&self) -> Option<Share> { ... }
    fn build_flags(&self, _plan: &Plan) -> BuildFlags { ... }
    fn size_for(&self, _per_second: f64, _cx: &Context) -> Option<Share> { ... }
    fn resize(&mut self, _allowance: Share) { ... }
    fn unavailable(&self) -> Option<String> { ... }
    fn ubft(&self) -> bool { ... }
}
Expand description

A part of the chip the planner can size.

Required Methods§

Source

fn name(&self) -> String

Name in the planner.

Source

fn role(&self) -> Role

What the component does.

Source

fn knobs(&self) -> Vec<Knob>

Build options.

Source

fn set_knob(&mut self, index: usize, value: f64)

Set knob index to value.

Source

fn plan(&self, share: &Share, cx: &Context) -> Option<Plan>

Best build within share, or None if nothing fits.

Provided Methods§

Source

fn fixed(&self) -> Option<Share>

An allowance taken off the top of the budget before the powers divide the rest (the SHA line’s part of the LUT split), or None to take a share of its side.

Source

fn build_flags(&self, _plan: &Plan) -> BuildFlags

The compile-time settings that build plan (constants, features), as key = value pairs.

Source

fn size_for(&self, _per_second: f64, _cx: &Context) -> Option<Share>

A line that sizes itself to demand (“auto”): the allowance of its smallest build that supplies per_second units of what it supplies (SHA-512 blocks) at cx’s clock, or None when its size is set by hand (the default). The planner (plan_chip) calls it with the demand of the chip it plans, so the line never limits the chip.

Source

fn resize(&mut self, _allowance: Share)

Remember the allowance the planner settled on for an auto-sized line (apply_layout calls it), so fixed and the next plan start from it.

Source

fn unavailable(&self) -> Option<String>

Why the current knob settings cannot be planned at all (an option that is offered but not implemented yet), or None. The TUI shows it instead of “nothing fits”.

Source

fn ubft(&self) -> bool

A uBFT module: a service built to sit beside a uBFT replica (its streams and key slots), or the replica’s own footprint. Only the uBFT modes plan it, and they plan nothing else (Mode::admits).

Implementors§