Skip to main content

Module pps_plan

Module pps_plan 

Source
Expand description

Hardware-free: builds and is tested on the host too. What each PPS slot does, decided without I/O.

Hardware-free on purpose: it compiles on the host, where cargo test runs the tests below. crate::io::pps executes what [Planner::plan] picks.

Structs§

Held
The part of a bank read that planning depends on.
Planner
What the loop knows: the module’s last bank read and what it last wrote.
PpsSetpoint
What the module should hold. Sampled every slot.

Enums§

Slot
What a slot is for. A slot runs at most one transaction.
Transaction
The one transaction a slot decided on.

Constants§

AUX_EVERY_TICKS
Every this many ticks, the tick’s second read becomes the Slot::Aux transaction: once a second at PPS_TICK_MS 100 ms.
PPS_MIN_GAP_MS
The least time from the end of one transaction to the start of the next: the module NACKs one addressed right after another. A slot’s transaction ends ~1 ms in, so on time the slot grid keeps this with room to spare.
PPS_SLOT_MS
Slot length. A slot holds one transaction of at most ~1 ms; the rest is the gap the module needs before it answers the next one.
PPS_TICK_MS
A tick: one pass through SCHEDULE.
SCHEDULE
One tick. Every write slot is followed by a read slot, so each write is verified before the next one, and no slot is ever back to back with another transaction: they are PPS_SLOT_MS apart.

Functions§

next_slot_start
When the next slot starts, in µs, given when this one started and when its transaction ended (end == start without one). On time that is the next grid point. Late, a stalled executor, it is a full PPS_MIN_GAP_MS after the end: missed slots are skipped, never run back to back to catch up.
slot_at
The slot at index of tick tick. With an auxiliary transaction, the second read of every AUX_EVERY_TICKSth tick is it, so it is spaced from the module’s traffic like any other slot.