Struct calyx_opt::passes::SimplifyStaticGuards
source · [−]pub struct SimplifyStaticGuards;
Expand description
Simplifies Static Guards In particular if g = g1 & g2 & …gn, then it takes all of the g_i’s that are “static timing intervals”, e.g., %[2:3], and combines them into one timing interval. For example: (port.out | !port1.out) & (port2.out == port3.out) & %[2:8] & %[5:10] ? becomes (port.out | !port1.out) & (port2.out == port3.out) & %[5:8] ? by “combining” %[2:8] & %[5:10]
Implementations
sourceimpl SimplifyStaticGuards
impl SimplifyStaticGuards
sourcepub fn separate_anded_intervals(
g: Guard<StaticTiming>,
cur_anded_intervals: &mut Vec<(u64, u64)>
) -> Option<Guard<StaticTiming>>
pub fn separate_anded_intervals(
g: Guard<StaticTiming>,
cur_anded_intervals: &mut Vec<(u64, u64)>
) -> Option<Guard<StaticTiming>>
takes in g, and separates the “anded intervals” from the rest of the guard. In other words, if we can rewrite g as g1 & g2 & …. gn, then we take all of the g_i’s that are static timing intervals (e.g., %[2:3]) and return a vec of (u64, u64)s. We also return the Some(rest of guard) (i.e., the parts that aren’t “anded” intervals) if they exist e.g.: port.out & port1.out & %[3:5] & %[4:6] -> Some(port.out & port1.out), vec[(3,5), (4,6)] %[3:5] & %[4:6] -> None, vec[(3,5), (4,6)]
Trait Implementations
sourceimpl Default for SimplifyStaticGuards
impl Default for SimplifyStaticGuards
sourcefn default() -> SimplifyStaticGuards
fn default() -> SimplifyStaticGuards
sourceimpl Named for SimplifyStaticGuards
impl Named for SimplifyStaticGuards
sourcefn description() -> &'static str
fn description() -> &'static str
sourceimpl Visitor for SimplifyStaticGuards
impl Visitor for SimplifyStaticGuards
sourcefn start(
&mut self,
comp: &mut Component,
_: &LibrarySignatures,
_comps: &[Component]
) -> VisResult
fn start(
&mut self,
comp: &mut Component,
_: &LibrarySignatures,
_comps: &[Component]
) -> VisResult
sourcefn precondition(_ctx: &Context) -> Option<String>where
Self: Sized,
fn precondition(_ctx: &Context) -> Option<String>where
Self: Sized,
sourcefn start_context(&mut self, _ctx: &mut Context) -> VisResult
fn start_context(&mut self, _ctx: &mut Context) -> VisResult
ir::Context
before visiting the components.sourcefn finish_context(&mut self, _ctx: &mut Context) -> VisResult
fn finish_context(&mut self, _ctx: &mut Context) -> VisResult
ir::Context
after visiting the components.sourcefn iteration_order() -> Orderwhere
Self: Sized,
fn iteration_order() -> Orderwhere
Self: Sized,
sourcefn traverse_component(
&mut self,
comp: &mut Component,
signatures: &LibrarySignatures,
components: &[Component]
) -> CalyxResult<()>where
Self: Sized,
fn traverse_component(
&mut self,
comp: &mut Component,
signatures: &LibrarySignatures,
components: &[Component]
) -> CalyxResult<()>where
Self: Sized,
sourcefn do_pass(&mut self, context: &mut Context) -> CalyxResult<()>where
Self: Sized + ConstructVisitor + Named,
fn do_pass(&mut self, context: &mut Context) -> CalyxResult<()>where
Self: Sized + ConstructVisitor + Named,
ir::Context
.
The function mutably borrows the control
program in each component and
traverses it. Read more