pub struct CellBuilder<S: Schema + ?Sized> { /* private fields */ }
Expand description

A builder for creating a schematic cell.

Implementations§

source§

impl<S: Schema + ?Sized> CellBuilder<S>

source

pub fn flatten(&mut self)

Marks this cell to be flattened.

source

pub fn signal<TY: HardwareType>( &mut self, name: impl Into<ArcStr>, ty: TY ) -> <TY as HardwareType>::Bundle

Create a new signal with the given name and hardware type.

source

pub fn connect<D1, D2>(&mut self, s1: D1, s2: D2)
where D1: Flatten<Node> + Connect<D2>, D2: Flatten<Node>,

Connect all signals in the given data instances.

source

pub fn connect_multiple<D>(&mut self, s2: &[D])
where D: Flatten<Node>,

Connect all signals in the given data instances.

source

pub fn set_scir(&mut self, scir: ScirBinding<S>)

Marks this cell as a SCIR cell.

source

pub fn set_primitive(&mut self, primitive: PrimitiveBinding<S>)

Marks this cell as a primitive.

source

pub fn ctx(&self) -> &Context

Gets the global context.

source

pub fn generate<B: Schematic<S>>(&mut self, block: B) -> SchemaCellHandle<S, B>

Starts generating a block in a new thread and returns a handle to its cell.

Can be used to check data stored in the cell or other generated results before adding the cell to the current schematic with CellBuilder::add.

To generate and add the block simultaneously, use CellBuilder::instantiate.

source

pub fn generate_blocking<B: Schematic<S>>( &mut self, block: B ) -> Result<SchemaCellHandle<S, B>>

Generates a cell corresponding to block and returns a handle to it.

Blocks on generation. Useful for handling errors thrown by the generation of a cell immediately.

As with CellBuilder::generate, the resulting handle must be added to the schematic with CellBuilder::add before it can be connected as an instance.

source

pub fn add<B: ExportsNestedData>( &mut self, cell: SchemaCellHandle<S, B> ) -> Instance<B>

Adds a cell generated with CellBuilder::generate to the current schematic.

Does not block on generation. If immediate error recovery is desired, check errors before calling this function using CellHandle::try_cell.

§Panics

If the instantiated cell fails to generate, this function will eventually cause a panic after the parent cell’s generator completes. To avoid this, return errors using Instance::try_data before your generator returns.

source

pub fn instantiate<B: Schematic<S>>(&mut self, block: B) -> Instance<B>

Instantiates a schematic view of the given block.

This function generates and adds the cell to the schematic. If checks need to be done on the generated cell before it is added to the schematic, use CellBuilder::generate and CellBuilder::add.

Spawns a thread that generates the underlying cell. If immediate error recovery is desired, use the generate and add workflow mentioned above.

§Panics

If the instantiated cell fails to generate, this function will eventually cause a panic after the parent cell’s generator completes. To avoid this, return errors using Instance::try_data before your generator returns.

If an error is not returned from the enclosing generator, but this function returns an error, the enclosing generator will panic since the instantiation irrecoverably failed.

source

pub fn instantiate_named<B: Schematic<S>>( &mut self, block: B, name: impl Into<ArcStr> ) -> Instance<B>

Instantiates a block and assigns a name to the instance.

See CellBuilder::instantiate for details.

Callers must ensure that instance names are unique.

source

pub fn instantiate_blocking<B: Schematic<S>>( &mut self, block: B ) -> Result<Instance<B>>

Instantiates a schematic view of the given block, blocking on generator for underlying cell. Returns an error if the generator returned an error.

See SubCellBuilder::instantiate for details.

§Panics

If an error is not returned from the enclosing generator, but this function returns an error, the enclosing generator will panic since the instantiation irrecoverably failed.

source

pub fn instantiate_connected<B, C>(&mut self, block: B, io: C)
where B: Schematic<S>, C: IsBundle, <B::Io as HardwareType>::Bundle: Connect<C>,

Creates an instance using CellBuilder::instantiate and immediately connects its ports.

source

pub fn instantiate_connected_named<B, C>( &mut self, block: B, io: C, name: impl Into<ArcStr> )
where B: Schematic<S>, C: IsBundle, <B::Io as HardwareType>::Bundle: Connect<C>,

Creates an instance using CellBuilder::instantiate and immediately connects its ports.

source

pub fn sub_builder<S2: Schema + ?Sized>(&mut self) -> SubCellBuilder<'_, S, S2>
where S: FromSchema<S2>,

Creates a SubCellBuilder for instantiating blocks from schema S2.

Auto Trait Implementations§

§

impl<S> !RefUnwindSafe for CellBuilder<S>

§

impl<S: ?Sized> Send for CellBuilder<S>

§

impl<S: ?Sized> Sync for CellBuilder<S>

§

impl<S: ?Sized> Unpin for CellBuilder<S>
where <S as Schema>::Primitive: Unpin,

§

impl<S> !UnwindSafe for CellBuilder<S>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CustomHardwareType<Flipped<T>> for U

source§

fn from_layout_type(other: &Flipped<T>) -> U

Creates this layout type from another layout type.
source§

impl<T, U> CustomHardwareType<InOut<T>> for U

source§

fn from_layout_type(other: &InOut<T>) -> U

Creates this layout type from another layout type.
source§

impl<T, U> CustomHardwareType<Input<T>> for U

source§

fn from_layout_type(other: &Input<T>) -> U

Creates this layout type from another layout type.
source§

impl<T, U> CustomHardwareType<Output<T>> for U

source§

fn from_layout_type(other: &Output<T>) -> U

Creates this layout type from another layout type.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> Connect<&T> for T

source§

impl<T> Connect<T> for T

source§

impl<T> Primitive for T