pub struct SingleNode {
pub latency: u64,
pub num_repeats: u64,
pub num_states: u64,
pub root: (Id, Vec<Assignment<Nothing>>),
pub fsm_schedule: BTreeMap<(u64, u64), StateType>,
pub children: Vec<(Node, (u64, u64))>,
pub fsm_cell: Option<RRC<StaticFSM>>,
pub iter_count_cell: Option<RRC<StaticFSM>>,
}
Expand description
SingleNode
struct.
Fields§
§latency: u64
latency of one iteration.
num_repeats: u64
number of repeats. (So “total” latency = latency
x num_repeats
)
num_states: u64
number of states in this node
root: (Id, Vec<Assignment<Nothing>>)
(name of static group, assignments to build a corresponding dynamic group)
fsm_schedule: BTreeMap<(u64, u64), StateType>
maps cycles (i,j) -> fsm state type.
Here is an example FSM schedule:
Cycles FSM State (i.e., fsm.out
)
(0..10) -> Normal[0,10)
(10..30) -> Offload(10) // Offloading to child
(30..40) -> Normal[11, 21)
(40,80) -> Offload(21)
(80,100)-> Normal[22, 42)
children: Vec<(Node, (u64, u64))>
vec of (Node Object, cycles for which that child is executing).
Note that you can build fsm_schedule
from just this information,
but it’s convenient to have fsm_schedule
avaialable.
fsm_cell: Option<RRC<StaticFSM>>
Keep track of where we are within a single iteration.
If latency
== 1, then we don’t need an fsm_cell
.
iter_count_cell: Option<RRC<StaticFSM>>
Keep track of which iteration we are on. If iteration count == 1, then
we don’t need an iter_count_cell
.
Implementations§
Source§impl SingleNode
impl SingleNode
Sourcepub fn make_assign_dyn(
&mut self,
assign: Assignment<StaticTiming>,
global_view: bool,
ignore_timing: bool,
builder: &mut Builder<'_>,
) -> Assignment<Nothing>
pub fn make_assign_dyn( &mut self, assign: Assignment<StaticTiming>, global_view: bool, ignore_timing: bool, builder: &mut Builder<'_>, ) -> Assignment<Nothing>
Takes in static assignment assign
and returns a dynamic assignments
For example, it could transform the guard %[2:3] -> fsm.out >= 2 & fsm.out <= 3
global_view
: are you just querying for a given iteration, or are
you querying for the entire tree’s execution?
- if
global_view
is true, then you have to include the iteration count register in the assignment’s guard. - if
global_view
is false, then you dont’ have to include it
ignore_timing
: remove static timing guards instead of transforming them
into an FSM query. Note that in order to do this, the timing guard must
equal %[0:1], otherwise we will throw an error. This option is here
mainly to save resource usage.
Source§impl SingleNode
These methods handle adding conflicts to the tree (to help coloring for
sharing FSMs)
impl SingleNode
These methods handle adding conflicts to the tree (to help coloring for sharing FSMs)
pub fn get_all_nodes(&self) -> Vec<Id>
pub fn add_conflicts(&self, conflict_graph: &mut GraphColoring<Id>)
pub fn get_max_value<F>(&self, name: &Id, f: &F) -> u64
Auto Trait Implementations§
impl Freeze for SingleNode
impl !RefUnwindSafe for SingleNode
impl !Send for SingleNode
impl !Sync for SingleNode
impl Unpin for SingleNode
impl !UnwindSafe for SingleNode
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> 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