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§
Source§impl 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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rewriter
impl !RefUnwindSafe for Rewriter
impl !Send for Rewriter
impl !Sync for Rewriter
impl Unpin for Rewriter
impl !UnwindSafe for Rewriter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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