Struct libreda_db::undo::Undo [−][src]
pub struct Undo<'a, T, U> { /* fields omitted */ }
Expand description
Wrapper around netlist, layout and L2N structures that allows undoing of operations.
Implementations
Return the number of undoable transactions.
Create a wrapper which allows to undo operations performed
on the LayoutEdit
trait.
Create a wrapper which allows to undo operations performed
on the NetlistEdit
trait.
Create a wrapper which allows to undo operations performed
on the HierarchyEdit
trait.
Undo the latest transaction. Does nothing if there’s no transaction left to be undone.
Trait Implementations
type CellInstId = T::CellInstId
type CellInstId = T::CellInstId
Cell instance identifier type.
Find a cell by its name.
Return the cell with the given name. Returns None
if the cell does not exist. Read more
fn cell_instance_by_name(
&self,
parent_cell: &Self::CellId,
name: &str
) -> Option<Self::CellInstId>
fn cell_instance_by_name(
&self,
parent_cell: &Self::CellId,
name: &str
) -> Option<Self::CellInstId>
Find a cell instance by its name.
Returns None
if the name does not exist. Read more
Get the name of the cell instance.
Get the ID of the parent cell of this instance.
Get the ID of the template cell of this instance.
Call a function on each cell of the netlist.
fn for_each_cell_instance<F>(&self, cell: &Self::CellId, f: F) where
F: FnMut(Self::CellInstId),
fn for_each_cell_instance<F>(&self, cell: &Self::CellId, f: F) where
F: FnMut(Self::CellInstId),
Call a function on each instance in this cell.
Call a function for each cell that is a child of this cell
.
Call a function for each cell that directly depends on cell
.
fn for_each_cell_reference<F>(&self, cell: &Self::CellId, f: F) where
F: FnMut(Self::CellInstId),
fn for_each_cell_reference<F>(&self, cell: &Self::CellId, f: F) where
F: FnMut(Self::CellInstId),
Iterate over all instances of this cell
, i.e. instances that use this cell as
a template. Read more
Get the number of cell instances inside the cell
.
Get a Vec
of all cell IDs in this netlist.
Get a Vec
of the IDs of all instances in this cell.
fn each_cell_instance(
&self,
cell: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellInstId>>
fn each_cell_instance(
&self,
cell: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellInstId>>
Iterate over all instances in a cell.
Get a Vec
of each cell that is a child of this cell
.
Iterate over all cells that are instantiated in this cell
.
Count all cells that are dependencies of cell
.
Get a Vec
of each cell that directly depends on cell
.
Iterate over each cell that directly depends on cell
.
Count all cells that are directly dependent on cell
, i.e. contain an instance of cell
.
Get a Vec
with all cell instances referencing this cell.
fn each_cell_reference(
&self,
cell: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellInstId>>
fn each_cell_reference(
&self,
cell: &Self::CellId
) -> Box<dyn Iterator<Item = Self::CellInstId>>
Iterate over all instances of this cell
, i.e. instances that use this cell as
a template. Read more
Count all instantiations of cell
.
Get a property of the top-level chip data structure.
fn get_cell_property(
&self,
cell: &Self::CellId,
key: &Self::NameType
) -> Option<PropertyValue>
fn get_cell_property(
&self,
cell: &Self::CellId,
key: &Self::NameType
) -> Option<PropertyValue>
Get a property of a cell.
fn get_cell_instance_property(
&self,
inst: &Self::CellInstId,
key: &Self::NameType
) -> Option<PropertyValue>
fn get_cell_instance_property(
&self,
inst: &Self::CellInstId,
key: &Self::NameType
) -> Option<PropertyValue>
Get a property of a cell instance.
Create a new and empty cell template. A cell template can be be instantiated in other cells. Read more
Remove a cell and all the instances of it. Read more
fn create_cell_instance(
&mut self,
parent_cell: &Self::CellId,
template_cell: &Self::CellId,
name: Option<Self::NameType>
) -> Self::CellInstId
fn create_cell_instance(
&mut self,
parent_cell: &Self::CellId,
template_cell: &Self::CellId,
name: Option<Self::NameType>
) -> Self::CellInstId
Create a new instance of template_cell
in parent_cell
.
Recursive instantiation is forbidden and might panic. Read more
Remove cell instance if it exists. Read more
Change the name of a cell instance. Read more
Change the name of a cell. Read more
Set a property of the top-level chip data structure..
fn set_cell_property(
&mut self,
cell: &Self::CellId,
key: Self::NameType,
value: PropertyValue
)
fn set_cell_property(
&mut self,
cell: &Self::CellId,
key: Self::NameType,
value: PropertyValue
)
Set a property of a cell.
fn set_cell_instance_property(
&mut self,
inst: &Self::CellInstId,
key: Self::NameType,
value: PropertyValue
)
fn set_cell_instance_property(
&mut self,
inst: &Self::CellInstId,
key: Self::NameType,
value: PropertyValue
)
Set a property of a cell instance.
Iterate over all defined layers.
Get the LayerInfo
data structure for this layer.
Find layer index by the (index, data type) tuple.
Find layer index by the name.
Compute the bounding box of the shapes on one layer. The bounding box also includes all child cell instances. Read more
Iterate over the IDs of all shapes in the cell on a specific layer.
Call a function for each shape on this layer.
Access a shape by its ID.
Get the parent cell and the layer of a shape as a (cell, layer) tuple.
Get the geometric transform that describes the location of a cell instance relative to its parent.
Compute the bounding box of the cell over all layers.
The bounding box is not defined if the cell is empty. In this
case return None
. Read more
fn for_each_shape_recursive<F>(
&self,
cell: &Self::CellId,
layer: &Self::LayerId,
f: F
) where
F: FnMut(SimpleTransform<Self::Coord>, &Self::ShapeId, &Geometry<Self::Coord>),
fn for_each_shape_recursive<F>(
&self,
cell: &Self::CellId,
layer: &Self::LayerId,
f: F
) where
F: FnMut(SimpleTransform<Self::Coord>, &Self::ShapeId, &Geometry<Self::Coord>),
Call a function f
for each shape of this cell and its sub cells.
Along to the geometric shape f
also gets a transformation as argument.
The transformation describes the actual position of the geometric shape relative to the cell
. Read more
fn get_shape_property(
&mut self,
shape: &Self::ShapeId,
key: &Self::NameType
) -> Option<PropertyValue>
fn get_shape_property(
&mut self,
shape: &Self::ShapeId,
key: &Self::NameType
) -> Option<PropertyValue>
Get a property of a shape.
impl<'a, T, U> LayoutEdit for Undo<'a, T, U> where
T: LayoutEdit,
U: From<LayoutUndoOp<T>> + From<HierarchyUndoOp<T>>,
impl<'a, T, U> LayoutEdit for Undo<'a, T, U> where
T: LayoutEdit,
U: From<LayoutUndoOp<T>> + From<HierarchyUndoOp<T>>,
Set the distance unit used in this layout in ‘pixels per micron’.
Create a new layer.
Use set_layer_name()
to define a name. Read more
Set the name of a layer or clear the layer name when passing None
.
This method should not change the ID of the layer.
Returns the previous name of the layer. Read more
Insert a geometric shape into the parent cell.
Remove shape from the parent cell.
Replace the geometry of a shape.
Set the geometric transform that describes the location of a cell instance relative to its parent.
fn set_shape_property(
&mut self,
shape: &Self::ShapeId,
key: Self::NameType,
_value: PropertyValue
)
fn set_shape_property(
&mut self,
shape: &Self::ShapeId,
key: Self::NameType,
_value: PropertyValue
)
Set a property of a shape.
Create a layer or return an existing one.
Pin instance identifier type. Uniquely identifies a pin instance in the whole netlist. A pin instance is a pin of a circuit instance. Read more
Get the ID of the template pin of this pin instance.
Get the signal direction of the pin.
Find a pin by its name.
Returns None
if no such pin can be found. Read more
Get the ID of the parent circuit of this pin.
Get the ID of the circuit instance that holds this pin instance.
Get the ID of the parent circuit of this net.
Get the internal net attached to this pin.
Get the external net attached to this pin instance.
Get the net of the logical constant zero.
Get the net of the logical constant one.
Find a net by its name inside the parent circuit.
Returns None
if no such net can be found. Read more
Call a function for each pin of the circuit.
fn for_each_pin_instance<F>(&self, circuit_inst: &Self::CellInstId, f: F) where
F: FnMut(Self::PinInstId),
fn for_each_pin_instance<F>(&self, circuit_inst: &Self::CellInstId, f: F) where
F: FnMut(Self::PinInstId),
Call a function for each pin instance of the circuit instance.
Call a function for net of the circuit.
Call a function for each pin connected to this net.
fn for_each_pin_instance_of_net<F>(&self, net: &Self::NetId, f: F) where
F: FnMut(Self::PinInstId),
fn for_each_pin_instance_of_net<F>(&self, net: &Self::NetId, f: F) where
F: FnMut(Self::PinInstId),
Call a function for each pin instance connected to this net.
Get the ID of a pin instance given the cell instance and the pin ID.
Get the net that is attached to this terminal.
Get a Vec
with the IDs of all pins of this circuit.
Iterate over all pins of a circuit.
Get a Vec
with the IDs of all pin instance of this circuit instance.
fn each_pin_instance<'a>(
&'a self,
circuit_instance: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::PinInstId> + 'a>
fn each_pin_instance<'a>(
&'a self,
circuit_instance: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::PinInstId> + 'a>
Iterate over all pin instances of a circuit.
fn each_external_net<'a>(
&'a self,
circuit_instance: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::NetId> + 'a>
fn each_external_net<'a>(
&'a self,
circuit_instance: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::NetId> + 'a>
Iterate over all external nets connected to the circuit instance. A net might appear more than once. Read more
fn for_each_external_net<F>(&self, circuit_instance: &Self::CellInstId, f: F) where
F: FnMut(Self::NetId),
fn for_each_external_net<F>(&self, circuit_instance: &Self::CellInstId, f: F) where
F: FnMut(Self::NetId),
Iterate over all external nets connected to the circuit instance. A net might appear more than once. Read more
Get a vector of all external nets connected to the circuit instance. A net might appear more than once. Read more
Get a Vec
with all nets in this circuit.
Iterate over all defined nets inside a circuit.
Return the number of nets defined inside a cell.
Get the number of pins that are connected to this net.
Get the number of pin instances that are connected to this net.
Get the number of terminals that are connected to this net.
Get a Vec
with all pin IDs connected to this net.
Iterate over all pins of a net.
Get a Vec
with all pin instance IDs connected to this net.
Iterate over all pins of a net.
fn for_each_terminal_of_net<F>(&self, net: &Self::NetId, f: F) where
F: FnMut(TerminalId<Self>),
fn for_each_terminal_of_net<F>(&self, net: &Self::NetId, f: F) where
F: FnMut(TerminalId<Self>),
Call a function for each terminal connected to this net.
Get a Vec
with all terminal IDs connected to this net.
fn each_terminal_of_net<'a>(
&'a self,
net: &Self::NetId
) -> Box<dyn Iterator<Item = TerminalId<Self>> + 'a>
fn each_terminal_of_net<'a>(
&'a self,
net: &Self::NetId
) -> Box<dyn Iterator<Item = TerminalId<Self>> + 'a>
Iterate over all terminals of a net.
impl<'a, T, U> NetlistEdit for Undo<'a, T, U> where
T: NetlistEdit,
U: From<NetlistUndoOp<T>> + From<HierarchyUndoOp<T>>,
impl<'a, T, U> NetlistEdit for Undo<'a, T, U> where
T: NetlistEdit,
U: From<NetlistUndoOp<T>> + From<HierarchyUndoOp<T>>,
Create a new pin in this circuit. Also adds the pin to all instances of the circuit. Read more
Remove the pin from this circuit and from all instances of this circuit.
Change the name of the pin, returns the old name. Read more
Create a net net that lives in the parent
circuit.
Set a new name for the net. This might panic if the name already exists. Returns the old name. Read more
Delete the net if it exists and disconnect all connected terminals.
Connect a pin to a net. Returns the old connected net, if any. Read more
Connect a pin instance to a net. Returns the old connected net, if any. Read more
Disconnect the pin from any connected net. Returns the old connected net, if any. Read more
Disconnect the pin instance from any connected net. Returns the old connected net, if any. Read more
fn connect_terminal(
&mut self,
terminal: &TerminalId<Self>,
net: Option<Self::NetId>
) -> Option<Self::NetId>
fn connect_terminal(
&mut self,
terminal: &TerminalId<Self>,
net: Option<Self::NetId>
) -> Option<Self::NetId>
Connect a terminal to a net. Returns the old connected net, if any. Read more
Disconnect the terminal from any connected net. Returns the old connected net, if any. Read more
Auto Trait Implementations
impl<'a, T, U> RefUnwindSafe for Undo<'a, T, U> where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<'a, T, U> !UnwindSafe for Undo<'a, T, U>
Blanket Implementations
Mutably borrows from an owned value. Read more
Remove all child instances inside the cell
.
Remove the cell instance and all cells which are then not used anymore.
Remove the cell and all other cells which are then not used anymore.
Get a cell instance object by its ID.
Check if the cell is a top level cell. This is done by checking that no other cells have an instance of this cell. Read more
Check if the cell is a leaf cell. This is done by checking that this cell contains no other cell instances. Read more
Iterate over all top level cells.
Iterate over all leaf cells, i.e. cells which contain no other cells.
Take all terminals that are connected to old_net
and connect them to new_net
instead.
The old net is no longer used and removed. Read more
Replace the circuit instance with its contents. Remove the circuit instance afterwards. Does not purge nets nor unconnected instances. So there could be unconnected nets or unconnected instances. Read more
Flatten all instances of this circuit by replacing them with their content. Remove the circuit from the netlist afterwards. For top level circuits this is equivalent to removing them. Read more
Delete all unconnected nets in this circuit. Return number of purged nets. Read more
Delete all unconnected nets in all circuits. Return number of purged nets. Read more
Get a reference to a pin from a pin ID.
Get a reference to a pin instance.
Get a reference to a terminal.
Check if the net is either the constant LOW or HIGH.
fn nets_of_cell_instance(
&self,
inst: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::NetId>>
fn nets_of_cell_instance(
&self,
inst: &Self::CellInstId
) -> Box<dyn Iterator<Item = Self::NetId>>
Get all nets that are connected to the circuit instance.
fn for_each_circuit_instance_of_net<F>(&self, net: &Self::NetId, f: F) where
F: FnMut(Self::CellInstId),
fn for_each_circuit_instance_of_net<F>(&self, net: &Self::NetId, f: F) where
F: FnMut(Self::CellInstId),
Visit all circuit instances connected to this net. An instance is touched not more than once. Read more
Iterate over all circuit instances connected to this net. An instance is touched not more than once. Read more