Expand description
Substrate’s layout generator framework.
§Examples
§Simple
impl ExportsLayoutData for Inverter {
type LayoutData = ();
}
impl Layout<ExamplePdk> for Inverter {
fn layout(
&self,
io: &mut Builder<<Self as Block>::Io>,
cell: &mut substrate::layout::CellBuilder<ExamplePdk>,
) -> substrate::error::Result<Self::LayoutData> {
io.vss.push(IoShape::with_layers(
cell.ctx.layers.met1,
Rect::from_sides(25, 0, 75, 25),
));
io.vdd.push(IoShape::with_layers(
cell.ctx.layers.met1,
Rect::from_sides(25, 175, 75, 200),
));
io.din.push(IoShape::with_layers(
cell.ctx.layers.met1,
Rect::from_sides(0, 50, 25, 150),
));
io.dout.push(IoShape::with_layers(
cell.ctx.layers.met1,
Rect::from_sides(75, 50, 100, 150),
));
cell.draw(Shape::new(
cell.ctx.layers.met1,
Rect::from_sides(0, 0, 100, 200),
))?;
Ok(())
}
}
§With data
impl ExportsLayoutData for Buffer {
type LayoutData = BufferData;
}
impl Layout<ExamplePdk> for Buffer {
fn layout(
&self,
io: &mut Builder<<Self as Block>::Io>,
cell: &mut CellBuilder<ExamplePdk>,
) -> substrate::error::Result<Self::LayoutData> {
let inv1 = cell.generate(Inverter::new(self.strength));
let inv2 = inv1.clone().align_bbox(AlignMode::ToTheRight, &inv1, 10);
cell.draw(inv1.clone())?;
cell.draw(inv2.clone())?;
io.vdd.merge(inv1.io().vdd);
io.vdd.merge(inv2.io().vdd);
io.vss.merge(inv1.io().vss);
io.vss.merge(inv2.io().vss);
io.din.merge(inv1.io().din);
io.dout.merge(inv2.io().dout);
Ok(BufferData { inv1, inv2 })
}
}
Modules§
- Bounding box utilities.
- Basic layout elements.
- Layout result and error types.
- Utilities for GDS conversion.
- Tiling structures and helpers.
- Routing track management.
Structs§
- A generic layout cell.
- A layout cell builder.
- A handle to a schematic cell that is being generated.
- A receiver for drawing layout objects.
- A generic layout instance.
- Layout-specific context data.
- A transformed view of a cell, usually created by accessing the cell of an instance.
Traits§
- An object that can be drawn in a
CellBuilder
. - An object where
Box<Self>
can be drawn. - A block that exports data from its layout.
- A block that can be laid out in process design kit
PDK
. - Data exported from a generated layout.
Derive Macros§
- Derives
substrate::layout::Layout
for any Substrate block. - Derives
substrate::layout::Data
for a struct.