pub enum Node {
Single(SingleNode),
Par(ParNodes),
}
Expand description
Node can either be a SingleNode (i.e., a single node) or ParNodes (i.e., a group of
nodes that are executing in parallel).
Most methods in Node
simply call the equivalent methods for each
of the two possible variants.
Perhaps could be more compactly implemented as a Trait.
Variants§
Single(SingleNode)
Par(ParNodes)
Implementations§
Source§impl Node
impl Node
Sourcepub fn instantiate_fsms(
&mut self,
builder: &mut Builder<'_>,
coloring: &HashMap<Id, Id>,
colors_to_max_values: &HashMap<Id, (u64, u64)>,
colors_to_fsm: &mut HashMap<Id, (Option<RRC<StaticFSM>>, Option<RRC<StaticFSM>>)>,
one_hot_cutoff: u64,
)
pub fn instantiate_fsms( &mut self, builder: &mut Builder<'_>, coloring: &HashMap<Id, Id>, colors_to_max_values: &HashMap<Id, (u64, u64)>, colors_to_fsm: &mut HashMap<Id, (Option<RRC<StaticFSM>>, Option<RRC<StaticFSM>>)>, one_hot_cutoff: u64, )
Instantiate the necessary registers.
The equivalent methods for the two variants contain more implementation
details.
coloring
, colors_to_max_values
, and colors_to_fsm
are necessary
to know whether we actually need to instantiate a new FSM, or we can
juse use another node’s FSM.
Sourcepub fn count_to_n(
&mut self,
builder: &mut Builder<'_>,
incr_start_cond: Option<Guard<Nothing>>,
)
pub fn count_to_n( &mut self, builder: &mut Builder<'_>, incr_start_cond: Option<Guard<Nothing>>, )
Count to n. Need to call instantiate_fsms
before calling count_to_n
.
The equivalent methods for the two variants contain more implementation
details.
incr_start_cond
can optionally guard the 0->1 transition.
Sourcepub fn realize(
&mut self,
ignore_timing_guards: bool,
static_groups: &Vec<RRC<StaticGroup>>,
reset_early_map: &mut HashMap<Id, Id>,
fsm_info_map: &mut HashMap<Id, (Id, Guard<Nothing>, Guard<Nothing>)>,
group_rewrites: &mut PortRewriteMap,
builder: &mut Builder<'_>,
)
pub fn realize( &mut self, ignore_timing_guards: bool, static_groups: &Vec<RRC<StaticGroup>>, reset_early_map: &mut HashMap<Id, Id>, fsm_info_map: &mut HashMap<Id, (Id, Guard<Nothing>, Guard<Nothing>)>, group_rewrites: &mut PortRewriteMap, builder: &mut Builder<'_>, )
“Realize” the static groups into dynamic groups.
The main challenge is converting %[i:j] into fsm guards.
Need to call instantiate_fsms
and
count_to_n
before calling realize
.
The equivalent methods for the two variants contain more implementation
details.
reset_early_map
, fsm_info_map
, and group_rewrites
are just metadata
to make it easier to rewrite control, add wrappers, etc.
Source§impl Node
The following methods are used to help build the conflict graph for coloring
to share FSMs
impl Node
The following methods are used to help build the conflict graph for coloring to share FSMs
Sourcepub fn get_all_nodes(&self) -> Vec<Id>
pub fn get_all_nodes(&self) -> Vec<Id>
Get the names of all nodes (i.e., the names of the groups for each node in the tree).
Sourcepub fn add_conflicts(&self, conflict_graph: &mut GraphColoring<Id>)
pub fn add_conflicts(&self, conflict_graph: &mut GraphColoring<Id>)
Adds conflicts between nodes in the tree that execute at the same time.
Sourcepub fn get_max_value<F>(&self, name: &Id, f: &F) -> u64
pub fn get_max_value<F>(&self, name: &Id, f: &F) -> u64
Get max value of all nodes in the tree, according to some function f.
f
takes in a Tree (i.e., a node type) and returns a u64
.
Source§impl Node
impl Node
pub fn preprocess_static_interface_assigns( assign: &mut Assignment<StaticTiming>, comp_sig: RRC<Cell>, )
Source§impl Node
impl Node
Sourcepub fn take_root_assigns(&mut self) -> Vec<Assignment<Nothing>>
pub fn take_root_assigns(&mut self) -> Vec<Assignment<Nothing>>
Take the assignments of the root of the tree and return them. This only works on a single node (i.e., the `Tree`` variant).
Sourcepub fn get_root_name(&mut self) -> Id
pub fn get_root_name(&mut self) -> Id
Get the name of the root of the tree and return them. This only works on a single node (i.e., the `Tree`` variant).
Sourcepub fn get_group_name(&self) -> Id
pub fn get_group_name(&self) -> Id
Get the name of the group at the root of the tree (if a Tree
variant) or
of the equivalent par
group (i.e., the name of the group that triggers
execution of all the trees) if a Par
variant.
Sourcepub fn get_latency(&self) -> u64
pub fn get_latency(&self) -> u64
Gets latency of the overall tree.
Auto Trait Implementations§
impl Freeze for Node
impl !RefUnwindSafe for Node
impl !Send for Node
impl !Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
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