calyx_opt::analysis

Struct SingleNode

Source
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

Source

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)

Source

pub fn get_all_nodes(&self) -> Vec<Id>

Source

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

Source

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

Auto Trait Implementations§

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.