pdkmaster.dispatch

The dispatch module contains classes inspirec by the visitor pattern in order to allow to execute code specific to a certain object type but also allow to have common code for all subclasses of a common parent class.

For each type of base class there is a sepearate *Dispatched class that are based on the same principle. If one wants to implement some code for a class, typically one subclasses the corresponding dispatcher class and then overloads one of the methods to implement class specific code. The method name to overload is based on the class name. Code for a common parent class can be implement by only overloaded the corresponding method for this common class without needing to overload each of the subclasses. For multi-inheritance each of the super classes methods will be tried in order. The dispatched for the base ‘_Shape’ class will raise NotImplementedError if not overloaded.

API Notes

  • The multi-inheritance support is still done ad-hoc and may in the future be changed in a backwards incompatible way for code expecting certain order for calling parent classes.

pdkmaster.dispatch.shape

class pdkmaster.dispatch.shape.ShapeDispatcher[source]

Bases: object

Dispatch to class method based on type of _Shape subclasses.

This dispatcher follows the common way of working in the dispatch module. Exception is the “geometry.MultiPartShape._Part”, for this one can overload the MultiPartShape__Part method. The default implementation with call the dispatcher on the part_shape of the given object. Assume that dispatcher is called with a MultiPartShape._Part with object part with part.part_shape of type Rect. Then the default implement will call the Rect method with part.part_shape as shape.

Point(point: Point, *args, **kwargs)[source]
Line(line: Line, *args, **kwargs)[source]
Polygon(polygon: Polygon, *args, **kwargs)[source]
Rect(rect: Rect, *args, **kwargs)[source]
MultiPath(mp: MultiPath, *args, **kwargs)[source]
Ring(ring: Ring, *args, **kwargs)[source]
RectRing(ring: RectRing, *args, **kwargs)[source]
MultiPartShape(mps: MultiPartShape, *args, **kwargs)[source]
MultiPartShape__Part(part: _Part, *args, **kwargs)[source]
MultiShape(ms: MultiShape, *args, **kwargs)[source]
RepeatedShape(rs: RepeatedShape, *args, **kwargs)[source]
ArrayShape(array: ArrayShape, *args, **kwargs)[source]

pdkmaster.dispatch.primitive

class pdkmaster.dispatch.primitive.PrimitiveDispatcher[source]

Bases: object

Dispatch to class method based on type of _Primitive subclasses.

This dispatcher follows the common way of working in the dispatch module.

Base(prim: Base, *args, **kwargs)[source]
Marker(prim: Marker, *args, **kwargs)[source]
Auxiliary(prim: Auxiliary, *args, **kwargs)[source]
ExtraProcess(prim: ExtraProcess, *args, **kwargs)[source]
Insulator(prim: Insulator, *args, **kwargs)[source]
Implant(prim: Implant, *args, **kwargs)[source]
Well(prim: Well, *args, **kwargs)[source]
DeepWell(prim: DeepWell, *args, **kwargs)[source]
WaferWire(prim: WaferWire, *args, **kwargs)[source]
GateWire(prim: GateWire, *args, **kwargs)[source]
MetalWire(prim: MetalWire, *args, **kwargs)[source]
MIMTop(prim: MIMTop, *args, **kwargs)[source]
TopMetalWire(prim: TopMetalWire, *args, **kwargs)[source]
Via(prim, *args: Via, **kwargs)[source]
PadOpening(prim: PadOpening, *args, **kwargs)[source]
Resistor(prim: Resistor, *args, **kwargs)[source]
MIMCapacitor(prim: MIMCapacitor, *args, **kwargs)[source]
Diode(prim: Diode, *args, **kwargs)[source]
MOSFETGate(prim: MOSFETGate, *args, **kwargs)[source]
MOSFET(prim: MOSFET, *args, **kwargs)[source]
Bipolar(prim: Bipolar, *args, **kwargs)[source]
MinWidth(prim: MinWidth, *args, **kwargs)[source]
Spacing(prim: Spacing, *args, **kwargs)[source]
Enclosure(prim: Enclosure, *args, **kwargs)[source]
NoOverlap(prim: NoOverlap, *args, **kwargs)[source]