Module libreda_pnr::db[][src]

The prelude helps to import most commonly used modules.

Modules

traits

Common traits for geometrical objects.

Structs

Cell

A Cell is a container for geometrical shapes organized on different layers. Additionally to the geometrical shapes a cell can also contain instances of other cells.

CellInstance

An actual instance of a cell.

Circuit

Copied from KLayout: Circuits are the basic building blocks of the netlist. A circuit has pins by which it can connect to the outside. Pins are created using create_pin and are represented by the Pin class.

CircuitInstance

Represents an instantiation of a Circuit (a sub-circuit).

ComplexTransform

Transformation described by a mirroring at the x axis, then a rotation around the origin, then a scaling, then a translation. This transformation allows rotations by arbitrary angles.

DefaultCircuitInstRef

Default implementation for CircuitInstRef. This is just a wrapper around a netlist and a circuit ID.

DefaultCircuitRef

Default implementation for CircuitRef. This is just a wrapper around a netlist and a circuit ID.

Edge

An edge (line segment) is represented by its starting point and end point.

Index

An identifier for an arbitrary type T. This is a wrapper around usize which is bound to a type T.

IrregularRepetition

Describe a non-equispaced repetition by storing a list of offsets.

LayerInfo

Meta-data of a layer.

Layout

Data structure which holds cells and cell instances.

Matrix2dTransform

Description of a transformation in the euclidean plane by a 2x2 matrix A. Transforming a point p is computed by the matrix product A*p.

Matrix3dTransform

Affine transformation represented as a 3x3 matrix like:

MultiPolygon

A MultiPolygon is a list of polygons. There is no restrictions on the polygons (they can be intersecting, empty, etc.).

Net

Copied from KLayout: A single net. A net connects multiple pins or terminals together. Pins are either pin or subcircuits of outgoing pins of the circuit the net lives in. Terminals are connections made to specific terminals of devices. Net objects are created inside a circuit with Circuit#create_net. To connect a net to an outgoing pin of a circuit, use Circuit#connect_pin, to disconnect a net from an outgoing pin use Circuit#disconnect_pin. To connect a net to a pin of a subcircuit, use SubCircuit#connect_pin, to disconnect a net from a pin of a subcircuit, use SubCircuit#disconnect_pin. To connect a net to a terminal of a device, use Device#connect_terminal, to disconnect a net from a terminal of a device, use Device#disconnect_terminal.

Path

Path is essentially a chain of line segments but with a possibly a non-zero width. It can be thought of the shape resulting by a stroke of a thick pen along the line segments.

Pin

Definition of a pin into a circuit. TODO: Make multi-bit capable.

PinInstance

A PinInstance represents the pin of a circuit instance. Each PinInstance corresponds to a Pin definition of the instantiated circuit.

Point

A point is defined by a x and y coordinate in the euclidean plane.

PointString

A point string is a finite sequence of points. TODO: Implement Deref for accessing the list of points.

Polygon

A polygon possibly with holes. The polygon is defined by a hull and a list of holes which are both SimplePolygons.

Port

A port is a group of pins that are treated as a multi-wire signal.

REdge

An rectilinear edge (horizontal or vertical line segment) is represented by its starting point and end point.

RcNetlist

Collection of circuits.

RcString

Resource counted string, used for names. RcStrings can be efficiently cloned.

Rect

A rectangle which is oriented along the x an y axis and represented by its lower left and upper right corner.

RegularRepetition

Describe a equi-spaced n*m two-dimensional repetition as a lattice. The offsets are computed as (i*a, j*b) for i in 0..n and j in 0..m. a and b the distance vectors between two neighbouring points.

Rot90Transform

Transformation that consists only of a rotation by a multiple of 90 degrees around the origin (0, 0).

Shape

Wrapper around a Geometry struct.

Shapes

Shapes<T> is a collection of Shape<T> structs. Each of the elements is assigned an index when inserted into the collection.

SimplePolygon

A SimplePolygon is a polygon defined by vertices. It does not contain holes but can be self-intersecting.

SimpleRPolygon

A SimpleRPolygon is a rectilinear polygon. It does not contain holes but can be self-intersecting. The vertices are stored in an implicit format (one coordinate of two neighbour vertices is always the same for rectilinear polygons). This reduces memory usage but has the drawback that edges must alternate between horizontal and vertical. Vertices between two edges of the same orientation will be dropped.

SimpleTransform

Describes a geometric transformation that consists of a optional mirroring along the x-axis followed by a rotation by a multiple of 90 degrees followed by a displacement.

Text

A text is a point associated with a string. This struct does not define how the text should be rendered on screen.

Vector

Vector defines a two dimensional vector with x and y components in the Euclidean plane.

Enums

Angle

Angle expressed as a multiple of 90 degrees.

ContainsResult

This is a result type for containment checks.

Direction

Signal type for pins.

EdgeIntersection

Return type for the edge-edge intersection functions. Stores all possible results of a edge to edge intersection.

Geometry

Abstracted geometrical shape.

LayoutDbError

Error type that can be returned during data base operations.

LineIntersection

Return type for the line-line intersection functions. Stores all possible results of a line to line intersection.

Orientation

Relative orientation of two geometrical objects such as vectors.

PathEndType

Encoding for the type of the beginning and end of the path.

PropertyValue

Property value type. Properties can hold different types that are encapsulated in this enum.

REdgeIntersection

Return type for the edge-edge intersection functions. Stores all possible results of a edge to edge intersection.

REdgeOrientation

Orientation of a rectilinear edge.

RLineIntersection

Return type for the line-line intersection functions. Stores all possible results of a line to line intersection.

Repetition

Describe the regular or irregular repetition of a geometrical object.

Side

Location relative to a directed line or edge. Something can be on the left of the line, right of the line or on top of the line (center).

TerminalRef

Describes where a net is connected to.

Constants

PREC_DISTANCE

Precision for distance related decisions.

Traits

BoundingBox

Calculation of the 'bounding box', i.e. the smallest rectangle that contains the geometrical object.

CircuitInstRef

A reference to a circuit instance.

CircuitRef

A reference to a circuit.

CoordinateType

Trait for types that can be used as coordinates in the euclidean plane. In practice this are integers, floats and possible rational numbers.

Deref

Used for immutable dereferencing operations, like *v.

DoubledOrientedArea

Calculate the doubled oriented area of a geometry. Using the doubled area allows to compute the area without using fractions. This is especially helpful when computing in integer coordinates.

LayoutStreamReader

Trait for reading a layout from a byte stream.

LayoutStreamWriter

Trait for writing a layout to a byte stream.

MapPointwise

Transform the geometrical object by transforming each point of it.

Mirror

Mirror at the x or y axis.

NetlistBase

Most basic trait of a netlist.

NetlistEdit

Trait for netlists that support editing.

NetlistReader

Read a netlist from a byte stream.

NetlistWriter

Write a netlist to a byte stream.

RotateOrtho

Rotate by a integer multiple of 90 degrees.

Scale

Scale the geometrical shape. Scaling center is the origin (0, 0).

TextType

Trait for types that can be used as the text of this label. The most simple solution is to use String. However, in many cases where the same text is used in many labels it might be desirable to use 'string interning' for more efficient memory usage. Then an Rc<String> could be used for instance.

ToPolygon

Trait for the conversion of a geometric shape to a polygon.

Translate

Translate the geometrical object by a vector.

TryBoundingBox

Try the calculation of the 'bounding box', i.e. the smallest rectangle that contains the geometrical object. In some cases this is not always possible, so the try might fail. For instance a set of polygons does not have a bounding box if the set is empty.

TryCastCoord

This trait defines the type-casting of the coordinate types for geometrical objects.

WindingNumber

Compute the winding number of a geometrical object around a point. The winding number is used to check if a point is contained in a shape.

WithProperties

A trait for associating user defined properties with a type.

Zero

Defines an additive identity element for Self.

Type Definitions

CellIndex

Data type used for identifying a cell.

CellInstId

Data type used for identifying a cell instance.

CellReference

Mutable shared reference to a Cell.

CircuitIndex

Data type used for identifying a circuit.

CircuitInstIndex

Data type used for identifying a circuit instance (sub circuit).

Coord

Integer coordinate type.

DistanceType

Default type for euclidean distances.

FloatType

Default floating point type.

LayerIndex

Data type used for identifying a layer.

NetIndex

Data type used for identifying a net.

SInt

Default signed integer type.

UInt

Default unsigned integer type.