Struct substrate::context::PdkContext
source · pub struct PdkContext<PDK: Pdk + ?Sized> {
pub pdk: Arc<PDK>,
pub layers: Arc<PDK::Layers>,
/* private fields */
}
Expand description
A Context
with an associated PDK PDK
.
Fields§
§pdk: Arc<PDK>
PDK configuration and general data.
layers: Arc<PDK::Layers>
The PDK layer set.
Implementations§
source§impl<PDK: Pdk> PdkContext<PDK>
impl<PDK: Pdk> PdkContext<PDK>
sourcepub fn generate_layout<T: Layout<PDK>>(&self, block: T) -> LayoutCellHandle<T>
pub fn generate_layout<T: Layout<PDK>>(&self, block: T) -> LayoutCellHandle<T>
Generates a layout for block
in the background.
Returns a handle to the cell being generated.
sourcepub fn write_layout<T: Layout<PDK>>(
&self,
block: T,
path: impl AsRef<Path>
) -> Result<()>
pub fn write_layout<T: Layout<PDK>>( &self, block: T, path: impl AsRef<Path> ) -> Result<()>
Writes a layout to a GDS file.
sourcepub fn write_layout_all(
&self,
cells: impl IntoIterator<Item = Arc<RawCell>>,
path: impl AsRef<Path>
) -> Result<()>
pub fn write_layout_all( &self, cells: impl IntoIterator<Item = Arc<RawCell>>, path: impl AsRef<Path> ) -> Result<()>
Writes a set of layout cells to a GDS file.
sourcepub fn read_gds(&self, path: impl AsRef<Path>) -> Result<ImportedGds>
pub fn read_gds(&self, path: impl AsRef<Path>) -> Result<ImportedGds>
Reads a layout from a GDS file.
sourcepub fn read_gds_cell(
&self,
path: impl AsRef<Path>,
cell: impl Into<ArcStr>
) -> Result<Arc<RawCell>>
pub fn read_gds_cell( &self, path: impl AsRef<Path>, cell: impl Into<ArcStr> ) -> Result<Arc<RawCell>>
Reads the layout of a single cell from a GDS file.
sourcepub fn install_layers<L: Layers>(&self) -> Arc<L>
pub fn install_layers<L: Layers>(&self) -> Arc<L>
Installs a new layer set in the context.
Allows for accessing GDS layers or other extra layers that are not present in the PDK.
sourcepub fn get_gds_layer(&self, spec: GdsLayerSpec) -> Option<LayerId>
pub fn get_gds_layer(&self, spec: GdsLayerSpec) -> Option<LayerId>
Gets a layer by its GDS layer spec.
Should generally not be used except for situations involving GDS import, where layers may be imported at runtime.
Methods from Deref<Target = Context>§
sourcepub fn with_pdk<PDK: Pdk>(&self) -> PdkContext<PDK>
pub fn with_pdk<PDK: Pdk>(&self) -> PdkContext<PDK>
Creates a PdkContext
for the given installed PDK.
The PDK must first be installed in the context.
sourcepub fn generate_cross_schematic<S1: Schema + ?Sized, S2: FromSchema<S1> + ?Sized, B: Schematic<S1>>(
&self,
block: B
) -> SchemaCellHandle<S2, B>
pub fn generate_cross_schematic<S1: Schema + ?Sized, S2: FromSchema<S1> + ?Sized, B: Schematic<S1>>( &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<S: Schema + ?Sized, T: Schematic<S>>(
&self,
block: T
) -> SchemaCellHandle<S, T>
pub fn generate_schematic<S: Schema + ?Sized, T: Schematic<S>>( &self, block: T ) -> SchemaCellHandle<S, T>
Generates a schematic for block
in the background.
Returns a handle to the cell being generated.
sourcepub fn export_scir<S: Schema + ?Sized, T: Schematic<S>>(
&self,
block: T
) -> Result<RawLib<S>, ConvError>
pub fn export_scir<S: Schema + ?Sized, T: Schematic<S>>( &self, block: T ) -> Result<RawLib<S>, 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 simulate<S, T>(
&self,
block: T,
work_dir: impl Into<PathBuf>
) -> Result<T::Output>
pub fn simulate<S, T>( &self, block: T, work_dir: impl Into<PathBuf> ) -> Result<T::Output>
Simulate the given testbench.
The simulator must be installed in the context.
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.
Trait Implementations§
source§impl<PDK: Pdk> Clone for PdkContext<PDK>
impl<PDK: Pdk> Clone for PdkContext<PDK>
Auto Trait Implementations§
impl<PDK> !RefUnwindSafe for PdkContext<PDK>
impl<PDK: ?Sized> Send for PdkContext<PDK>
impl<PDK: ?Sized> Sync for PdkContext<PDK>
impl<PDK: ?Sized> Unpin for PdkContext<PDK>
impl<PDK> !UnwindSafe for PdkContext<PDK>
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, U> CustomHardwareType<Flipped<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<Flipped<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &Flipped<T>) -> U
fn from_layout_type(other: &Flipped<T>) -> U
source§impl<T, U> CustomHardwareType<InOut<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<InOut<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &InOut<T>) -> U
fn from_layout_type(other: &InOut<T>) -> U
source§impl<T, U> CustomHardwareType<Input<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<Input<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &Input<T>) -> U
fn from_layout_type(other: &Input<T>) -> U
source§impl<T, U> CustomHardwareType<Output<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
impl<T, U> CustomHardwareType<Output<T>> for Uwhere
U: CustomHardwareType<T>,
T: HardwareType,
source§fn from_layout_type(other: &Output<T>) -> U
fn from_layout_type(other: &Output<T>) -> U
§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>
. 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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
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> 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