calyx_opt::analysis

Trait WithStatic

Source
pub trait WithStatic
where Self: GetAttributes,
{ type Info; // Required method fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>; // Provided method fn update_static(&mut self, extra: &Self::Info) -> Option<u64> { ... } }
Expand description

Trait to propagate and extra “static” attributes through ir::Control. Calling the update function ensures that the current program, as well as all sub-programs have a “static” attribute on them. Usage:

use calyx::analysis::compute_static::WithStatic;
let con: ir::Control = todo!(); // A complex control program
con.update(&HashMap::new());    // Compute the static information for the program

Required Associated Types§

Source

type Info

Extra information needed to compute static information for this type.

Required Methods§

Source

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

Compute the static information for the type if possible and update all sub-programs.

Provided Methods§

Source

fn update_static(&mut self, extra: &Self::Info) -> Option<u64>

Compute the static information for the type if possible and add it to its attribute. Implementors should instead implement WithStatic::compute_static and call this function on sub-programs. Ensures: All sub-programs of the type will also be updated.

Implementations on Foreign Types§

Source§

impl WithStatic for Control

Source§

type Info = HashMap<Id, u64>

Source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

Source§

impl WithStatic for Enable

Source§

type Info = ()

Source§

fn compute_static(&mut self, _: &Self::Info) -> Option<u64>

Source§

impl WithStatic for If

Source§

type Info = HashMap<Id, u64>

Source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

Source§

impl WithStatic for Invoke

Source§

type Info = HashMap<Id, u64>

Source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

Source§

impl WithStatic for Par

Source§

type Info = HashMap<Id, u64>

Source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

Source§

impl WithStatic for Repeat

Source§

type Info = HashMap<Id, u64>

Source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

Source§

impl WithStatic for Seq

Source§

type Info = HashMap<Id, u64>

Source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

Source§

impl WithStatic for While

Source§

type Info = HashMap<Id, u64>

Source§

fn compute_static(&mut self, extra: &Self::Info) -> Option<u64>

Implementors§