calyx_opt::analysis

Enum Node

Source
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§

Implementations§

Source§

impl Node

Source

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.

Source

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.

Source

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

pub fn query_between( &mut self, query: (u64, u64), builder: &mut Builder<'_>, ) -> Guard<Nothing>

Get the equivalent fsm guard when the tree is between cycles i and j, i.e., when i <= cycle_count < j. The equivalent methods for the two variants contain more implementation details.

Source§

impl Node

The following methods are used to help build the conflict graph for coloring to share FSMs

Source

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).

Source

pub fn add_conflicts(&self, conflict_graph: &mut GraphColoring<Id>)

Adds conflicts between nodes in the tree that execute at the same time.

Source

pub fn get_max_value<F>(&self, name: &Id, f: &F) -> u64
where F: Fn(&SingleNode) -> 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

Source§

impl Node

Source

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).

Source

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).

Source

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.

Source

pub fn get_latency(&self) -> u64

Gets latency of the overall tree.

Source

pub fn get_children(&mut self) -> &mut Vec<(Node, (u64, u64))>

Gets the children of root of the tree (if a Tree variant) or of the threads (i.e., trees) that are scheduled to execute (if a Par variant.)

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.