pub struct Context {
pub executor: Arc<dyn Executor>,
pub cache: Cache,
/* private fields */
}
Expand description
The global context.
Stores configuration such as the PDK and tool plugins to use during generation.
Cheaply clonable.
Fields§
§executor: Arc<dyn Executor>
The executor to which commands should be submitted.
cache: Cache
A cache for storing the results of expensive computations.
Implementations§
Source§impl Context
impl Context
Sourcepub fn builder() -> ContextBuilder
pub fn builder() -> ContextBuilder
Creates a builder for constructing a context.
Sourcepub fn generate_cross_schematic<B: Schematic, S2: FromSchema<B::Schema> + ?Sized>(
&self,
block: B,
) -> SchemaCellHandle<S2, B>
pub fn generate_cross_schematic<B: Schematic, S2: FromSchema<B::Schema> + ?Sized>( &self, block: B, ) -> SchemaCellHandle<S2, B>
Generates a schematic of a block in schema S1
for use in schema S2
.
Can only generate a cross schematic with one layer of FromSchema
indirection.
Sourcepub fn generate_schematic<T: Schematic>(
&self,
block: T,
) -> SchemaCellHandle<T::Schema, T>
pub fn generate_schematic<T: Schematic>( &self, block: T, ) -> SchemaCellHandle<T::Schema, T>
Generates a schematic for block
in the background.
Returns a handle to the cell being generated.
Sourcepub fn export_scir<T: Schematic>(
&self,
block: T,
) -> Result<RawLib<T::Schema>, ConvError>
pub fn export_scir<T: Schematic>( &self, block: T, ) -> Result<RawLib<T::Schema>, ConvError>
Export the given block and all sub-blocks as a SCIR library.
Returns a SCIR library and metadata for converting between SCIR and Substrate formats.
Sourcepub fn export_scir_all<S: Schema + ?Sized>(
&self,
cells: &[&RawCell<S>],
) -> Result<RawLib<S>, ConvError>
pub fn export_scir_all<S: Schema + ?Sized>( &self, cells: &[&RawCell<S>], ) -> Result<RawLib<S>, ConvError>
Export the given cells and all their subcells as a SCIR library.
Returns a SCIR library and metadata for converting between SCIR and Substrate formats.
Sourcepub fn get_sim_controller<S, T>(
&self,
block: T,
work_dir: impl Into<PathBuf>,
) -> Result<SimController<S, T>>
pub fn get_sim_controller<S, T>( &self, block: T, work_dir: impl Into<PathBuf>, ) -> Result<SimController<S, T>>
Returns a simulation controller for the given testbench and simulator.
Sourcepub fn install<I>(&mut self, installation: I) -> Arc<I>where
I: PrivateInstallation,
pub fn install<I>(&mut self, installation: I) -> Arc<I>where
I: PrivateInstallation,
Installs the given PrivateInstallation
.
Only one installation of any given type can exist. Overwrites conflicting installations of the same type.
Sourcepub fn get_or_install<I>(&self, installation: I) -> Arc<I>where
I: PrivateInstallation,
pub fn get_or_install<I>(&self, installation: I) -> Arc<I>where
I: PrivateInstallation,
Installs the given PrivateInstallation
.
Returns the existing installation if one is present.
Sourcepub fn get_private_installation<I: PrivateInstallation>(&self) -> Option<Arc<I>>
pub fn get_private_installation<I: PrivateInstallation>(&self) -> Option<Arc<I>>
Gets a private installation from the context installation map.
Sourcepub fn get_installation<I: Installation>(&self) -> Option<Arc<I>>
pub fn get_installation<I: Installation>(&self) -> Option<Arc<I>>
Gets an installation from the context installation map.
Sourcepub fn generate_layout<T: Layout>(&self, block: T) -> LayoutCellHandle<T>
pub fn generate_layout<T: Layout>(&self, block: T) -> LayoutCellHandle<T>
Generates a layout for block
in the background.
Returns a handle to the cell being generated.
Sourcepub fn export_layir<T: Layout>(
&self,
block: T,
) -> Result<RawLib<<T::Schema as Schema>::Layer>>
pub fn export_layir<T: Layout>( &self, block: T, ) -> Result<RawLib<<T::Schema as Schema>::Layer>>
Exports the layout of a block to a LayIR library.
Sourcepub fn export_layir_all<'a, L: Clone + 'a>(
&self,
cells: impl IntoIterator<Item = &'a RawCell<L>>,
) -> Result<RawLib<L>>
pub fn export_layir_all<'a, L: Clone + 'a>( &self, cells: impl IntoIterator<Item = &'a RawCell<L>>, ) -> Result<RawLib<L>>
Writes a set of layout cells to a LayIR library.
Sourcepub fn import_layir<S: Schema>(
&self,
lib: Library<S::Layer>,
top: CellId,
) -> Result<Arc<RawCell<S::Layer>>>
pub fn import_layir<S: Schema>( &self, lib: Library<S::Layer>, top: CellId, ) -> Result<Arc<RawCell<S::Layer>>>
Imports a LayIR library into the context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request