pub struct Cell { /* private fields */ }
Expand description
A cell.
Implementations§
source§impl Cell
impl Cell
sourcepub fn add_node(&mut self, name: impl Into<ArcStr>) -> SliceOne
pub fn add_node(&mut self, name: impl Into<ArcStr>) -> SliceOne
Creates a new 1-bit signal in this cell.
sourcepub fn add_bus(&mut self, name: impl Into<ArcStr>, width: usize) -> Slice
pub fn add_bus(&mut self, name: impl Into<ArcStr>, width: usize) -> Slice
Creates a new 1-dimensional bus in this cell.
sourcepub fn expose_port(&mut self, signal: impl Into<SignalId>, direction: Direction)
pub fn expose_port(&mut self, signal: impl Into<SignalId>, direction: Direction)
Exposes the given signal as a port.
If the signal is a bus, the entire bus is exposed. It is not possible to expose only a portion of a bus. Create two separate buses instead.
§Panics
Panics if the provided signal does not exist.
sourcepub fn signals(&self) -> impl Iterator<Item = (SignalId, &SignalInfo)>
pub fn signals(&self) -> impl Iterator<Item = (SignalId, &SignalInfo)>
Iterate over the signals of this cell.
sourcepub fn signal(&self, id: SignalId) -> &SignalInfo
pub fn signal(&self, id: SignalId) -> &SignalInfo
sourcepub fn try_signal(&self, id: SignalId) -> Option<&SignalInfo>
pub fn try_signal(&self, id: SignalId) -> Option<&SignalInfo>
Get the signal associated with the given ID.
sourcepub fn signal_named(&self, name: &str) -> &SignalInfo
pub fn signal_named(&self, name: &str) -> &SignalInfo
Get the signal associated with the given name.
§Panics
Panics if no signal with the given name exists.
sourcepub fn try_signal_named(&self, name: &str) -> Option<&SignalInfo>
pub fn try_signal_named(&self, name: &str) -> Option<&SignalInfo>
Get the signal associated with the given ID.
sourcepub fn instance(&self, id: InstanceId) -> &Instance
pub fn instance(&self, id: InstanceId) -> &Instance
Get the instance associated with the given ID.
§Panics
Panics if no instance with the given ID exists.
sourcepub fn try_instance(&self, id: InstanceId) -> Option<&Instance>
pub fn try_instance(&self, id: InstanceId) -> Option<&Instance>
Get the instance associated with the given ID.
sourcepub fn instance_named(&self, name: &str) -> &Instance
pub fn instance_named(&self, name: &str) -> &Instance
sourcepub fn try_instance_named(&self, name: &str) -> Option<&Instance>
pub fn try_instance_named(&self, name: &str) -> Option<&Instance>
Gets the instance with the given name.
sourcepub fn instance_from_path_element(
&self,
elem: &InstancePathElement
) -> &Instance
pub fn instance_from_path_element( &self, elem: &InstancePathElement ) -> &Instance
Gets the instance associated with the given path element.
sourcepub fn add_instance(&mut self, instance: Instance) -> InstanceId
pub fn add_instance(&mut self, instance: Instance) -> InstanceId
Add the given instance to the cell.
sourcepub fn instances(&self) -> impl Iterator<Item = (InstanceId, &Instance)>
pub fn instances(&self) -> impl Iterator<Item = (InstanceId, &Instance)>
Iterate over the instances of this cell.