openepda.updk module

openepda.updk.py

This file contains tools to work with uPDK files.

Author: Dima Pustakhod Copyright: 2020, TU/e - PITC and authors

class openepda.updk.BB(name: str, bb_data: dict, skip_checks: bool = False)[source]

Building block class to handle the uPDK block data.

property cell_names

Return names of the existing cells

property full_name

Return full name unique for a given set of parameters.

Returns

full_name – full BB name. Takes into account current parameter values.

Return type

str

get_cell(name) → Optional[nd.Cell][source]

Get cell by the name.

For p-cells, it provides access to previously generated cells with other parameters.

Parameters

name (str) – The name of the generated cell.

Returns

cell

Return type

Optional[nazca.Cell]

get_or_make_cell() → Optional[nd.Cell][source]

Create a cell for the building block.

If the cell already exists, it will be returned. This method runs only if nazca package is installed. The cell is also added to private attribute _cells.

Returns

cell – None is returned in case if nazca is not installed, of if error occurs.

Return type

Optional[nazca.Cell]

get_parameter(name) → openepda.updk.Parameter[source]

Get parameter by name

Parameters

name (str) – parameter name

Returns

parameter – parameter instance

Return type

Parameter

get_pin(name)openepda.updk.Pin[source]

Get pin by name

Parameters

name (str) – pin name

Returns

Pin – Pin instance

Return type

Pin

property is_pcell

Flag if the building block is parametric.

Returns

True if the building block is a p-cell, False if it is static.

Return type

bool

class openepda.updk.BBox(sw: Tuple[numbers.Real, numbers.Real], ne: Tuple[numbers.Real, numbers.Real], parent: Optional[BB] = None)[source]

Class to handle building block bounding boxes.

Bounding box is a rectangle aligned with XY axis, and is characterized by its south-west and north-east corners.

static from_points(pts: Iterable[Tuple[numbers.Real, numbers.Real]], parent: openepda.updk.ParametrizedEntity = None)[source]

Create a bounding box from a list of points.

Points can describe any polygon.

Parameters
  • pts (Iterable[Tuple[Real, Real]]) – List of (x, y) coordinates of the points.

  • parent (Optional[ParametrizedEntity]) – Parent for the bounding box.

Returns

Minimal bounding box which includes all points.

Return type

BBox

property length

Bounding box size along X-axis

Returns

Return type

Real

property width

Bounding box size along Y-axis

Returns

Return type

Real

class openepda.updk.ParametrizedChildEntity(parent: openepda.updk.ParametrizedEntity = None)[source]

Mixin class implementing access to parent parameters

get_parameter_values()[source]

Implementation of the interface method, using parent parameters.

class openepda.updk.ParametrizedEntity[source]

Interface for classes with parameters.

class openepda.updk.Pin(name: str, pin_data: Dict, skip_checks: bool = False, parent: Optional[BB] = None)[source]
class openepda.updk.UPDK(updk_data)[source]

Class to handle the uPDK file data.

property cells

All generated cells for all building blocks.

export_cells(filename) → bool[source]

Export building block cells to a GDSII file.

This method runs only if nazca package is installed. The cells should be first created using UPDK.make_cells() method.

Parameters

filename (str) – The target GDSII filename.

Returns

result – True if the cells were created successfully

Return type

bool

static from_file(filename)[source]

Create a UPDK instance from a uPDK file.

Parameters

filename – str or a path-like object

Returns

updk

Return type

UPDK

get_building_block(name)openepda.updk.BB[source]

Get building block by name

Parameters

name (str) – building block name

Returns

bb – building block instance

Return type

BB

get_cells(bb_name) → List[nd.Cell][source]

All generated cells for a given building block.

make_cell(bb_name) → Optional[str][source]

Make a cell for a bb with currently set parameters.

make_cells() → bool[source]

Create cells for the building blocks.

This method runs only if nazca package is installed. Only static cells are processed now. The created cells are available via UPDK.cells property.

Returns

result – True if the cells were created successfully

Return type

bool

openepda.updk.ensure_num(func: Callable[[openepda.updk.ParametrizedEntity], Any]) → Callable[[openepda.updk.ParametrizedEntity], Union[numbers.Real, List[Union[numbers.Real, List[TNestedRealList]]]]][source]

Decorator to ensure numeric type of the returned values.

This decorator is used to ensure that the returned value has a numeric type. It passes the returned value through the evaluate_expression() function.

This decorator is to be used on methods only, as it required the first argument of the decorated function to accept the class instance.

If your would like to wrap a property, first apply this decorator, and then apply @property decorator:

```python class A():

@property @ensure_num def value(self):

return 100

```

Parameters

func (Callable[[ParametrizedEntity], Any]) – method to be wrapped

Returns

func – wrapped method

Return type

Callable[[ParametrizedEntity], TNestedRealList]