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§
Provided Methods§
Sourcefn fixed(&self) -> Option<Share>
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.
Sourcefn build_flags(&self, _plan: &Plan) -> BuildFlags
fn build_flags(&self, _plan: &Plan) -> BuildFlags
The compile-time settings that build plan (constants, features),
as key = value pairs.
Sourcefn size_for(&self, _per_second: f64, _cx: &Context) -> Option<Share>
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.
Sourcefn resize(&mut self, _allowance: Share)
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.
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”.
Sourcefn ubft(&self) -> bool
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).