pub struct Rewriter {
pub port_map: PortRewriteMap,
pub cell_map: RewriteMap<Cell>,
pub group_map: RewriteMap<Group>,
pub comb_group_map: RewriteMap<CombGroup>,
pub static_group_map: RewriteMap<StaticGroup>,
}
Expand description
A structure to track rewrite maps for ports. Stores both cell rewrites and direct port rewrites. Attempts to apply port rewrites first before trying the cell rewrite.
Fields
port_map: PortRewriteMap
Mapping from canonical names of ports to port instances
cell_map: RewriteMap<Cell>
Mapping from names of cells to cell instance.
group_map: RewriteMap<Group>
Mapping from names of groups to group instance.
comb_group_map: RewriteMap<CombGroup>
Mapping from names of combinational groups to combinational group instance.
static_group_map: RewriteMap<StaticGroup>
Mapping from names of static groups to static group instance.
Implementations
sourceimpl Rewriter
impl Rewriter
sourcepub fn get(&self, port_ref: &RRC<Port>) -> Option<RRC<Port>>
pub fn get(&self, port_ref: &RRC<Port>) -> Option<RRC<Port>>
Get any port rewrite defined for the given port.
sourcepub fn rewrite_guard<T>(&self, guard: &mut Guard<T>)
pub fn rewrite_guard<T>(&self, guard: &mut Guard<T>)
Rewrite assignments in a guard
sourcepub fn rewrite_assign<T>(&self, assign: &mut Assignment<T>)
pub fn rewrite_assign<T>(&self, assign: &mut Assignment<T>)
Rewrite an assignment
sourcepub fn rewrite_invoke(&self, inv: &mut Invoke)
pub fn rewrite_invoke(&self, inv: &mut Invoke)
Rewrite a invoke
node using a RewriteMapir::Cell and a RewriteMapir::CombGroup
sourcepub fn rewrite_static_invoke(&self, inv: &mut StaticInvoke)
pub fn rewrite_static_invoke(&self, inv: &mut StaticInvoke)
Rewrite a static invoke
node using a RewriteMapir::Cell and a RewriteMapir::CombGroup
sourcepub fn rewrite_static_control(&self, sc: &mut StaticControl)
pub fn rewrite_static_control(&self, sc: &mut StaticControl)
Given a control program, rewrite all uses of cells, groups, and comb groups using the given rewrite maps.
sourcepub fn rewrite_control(&self, c: &mut Control)
pub fn rewrite_control(&self, c: &mut Control)
Given a control program, rewrite all uses of cells, groups, and comb groups using the given rewrite maps.