API reference - Class LayoutToNetlist

Notation used in Ruby API documentation

Module: db

Description: A generic framework for extracting netlists from layouts

Sub-classes: BuildNetHierarchyMode

This class wraps various concepts from db::NetlistExtractor and db::NetlistDeviceExtractor and more. It is supposed to provide a framework for extracting a netlist from a layout.

The use model of this class consists of five steps which need to be executed in this order.

You can also use the extractor with an existing DeepShapeStore object or even flat data. In this case, preparation means importing existing regions with the register method. If you want to use the LayoutToNetlist object with flat data, use the 'LayoutToNetlist(topcell, dbu)' constructor. If you want to use it with hierarchical data and an existing DeepShapeStore object, use the 'LayoutToNetlist(dss)' constructor.

This class has been introduced in version 0.26.

Public constructors

new LayoutToNetlist ptrnew(const RecursiveShapeIterator iter)Creates a new extractor connected to an original layout
new LayoutToNetlist ptrnewCreates a new and empty extractor object
new LayoutToNetlist ptrnew(DeepShapeStore ptr dss)Creates a new extractor object reusing an existing DeepShapeStore object
new LayoutToNetlist ptrnew(DeepShapeStore ptr dss,
unsigned int layout_index)
Creates a new extractor object reusing an existing DeepShapeStore object
new LayoutToNetlist ptrnew(string topcell_name,
double dbu)
Creates a new extractor object with a flat DSS

Public methods

void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
Regionantenna_check(const Region gate,
const Region metal,
double ratio,
variant[] diodes = [],
Texts ptr texts = nil)
Runs an antenna check on the extracted clusters
Regionantenna_check(const Region gate,
double gate_perimeter_factor,
const Region metal,
double metal_perimeter_factor,
double ratio,
variant[] diodes = [],
Texts ptr texts = nil)
Runs an antenna check on the extracted clusters taking the perimeter into account
Regionantenna_check(const Region gate,
double gate_area_factor,
double gate_perimeter_factor,
const Region metal,
double metal_area_factor,
double metal_perimeter_factor,
double ratio,
variant[] diodes = [],
Texts ptr texts = nil)
Runs an antenna check on the extracted clusters taking the perimeter into account and providing an area factor
[const]doublearea_ratioGets the area_ratio parameter for the hierarchical network processor
voidarea_ratio=(double r)Sets the area_ratio parameter for the hierarchical network processor
[const]voidbuild_all_nets(const CellMapping cmap,
Layout target,
map<unsigned int,const Region ptr> lmap,
variant net_cell_name_prefix = nil,
variant netname_prop = nil,
LayoutToNetlist::BuildNetHierarchyMode hier_mode = BNH_Flatten,
variant circuit_cell_name_prefix = nil,
variant device_cell_name_prefix = nil)
Builds a full hierarchical representation of the nets
[const]voidbuild_net(const Net net,
Layout target,
Cell target_cell,
map<unsigned int,const Region ptr> lmap,
variant netname_prop = nil,
LayoutToNetlist::BuildNetHierarchyMode hier_mode = BNH_Flatten,
variant circuit_cell_name_prefix = nil,
variant device_cell_name_prefix = nil)
Builds a net representation in the given layout and cell
[const]voidbuild_nets(const Net ptr[] nets,
const CellMapping cmap,
Layout target,
map<unsigned int,const Region ptr> lmap,
variant net_cell_name_prefix = nil,
variant netname_prop = nil,
LayoutToNetlist::BuildNetHierarchyMode hier_mode = BNH_Flatten,
variant circuit_cell_name_prefix = nil,
variant device_cell_name_prefix = nil)
Like build_all_nets, but with the ability to select some nets.
CellMappingcell_mapping_into(Layout layout,
Cell cell,
bool with_device_cells = false)
Creates a cell mapping for copying shapes from the internal layout to the given target layout.
CellMappingcell_mapping_into(Layout layout,
Cell cell,
const Net ptr[] nets,
bool with_device_cells = false)
Creates a cell mapping for copying shapes from the internal layout to the given target layout.
voidcheck_extraction_errorsRaises an exception if extraction errors are present
voidclear_join_net_namesClears all implicit net joining expressions.
voidclear_join_netsClears all explicit net joining expressions.
voidconnect(const Region l)Defines an intra-layer connection for the given layer.
voidconnect(const Region a,
const Region b)
Defines an inter-layer connection for the given layers.
voidconnect(const Region a,
const Texts b)
Defines an inter-layer connection for the given layers.
voidconnect(const Texts a,
const Region b)
Defines an inter-layer connection for the given layers.
unsigned longconnect_global(const Region l,
string global_net_name)
Defines a connection of the given layer with a global net.
unsigned longconnect_global(const Texts l,
string global_net_name)
Defines a connection of the given text layer with a global net.
CellMappingconst_cell_mapping_into(const Layout layout,
const Cell cell)
Creates a cell mapping for copying shapes from the internal layout to the given target layout.
[const]stringdescriptionGets the description of the database
voiddescription=(string arg1)Sets the description of the database
[const]doubledevice_scalingGets the device scaling factor
voiddevice_scaling=(double f)Sets the device scaling factor
DeepShapeStoredssGets a reference to the internal DSS object.
[const,iter]LogEntryDataeach_log_entryIterates over all log entries collected during device and netlist extraction.
voidextract_devices(DeviceExtractorBase extractor,
map<string,ShapeCollection ptr> layers)
Extracts devices
voidextract_netlistRuns the netlist extraction
[const]stringfilenameGets the file name of the database
[const]stringgeneratorGets the generator string.
voidgenerator=(string generator)Sets the generator string.
[const]stringglobal_net_name(unsigned long global_net_id)Gets the global net name for the given global net ID.
[const]boolinclude_floating_subcircuitsGets a flag indicating whether to include floating subcircuits in the netlist.
voidinclude_floating_subcircuits=(bool flag)Sets a flag indicating whether to include floating subcircuits in the netlist.
Layout ptrinternal_layoutGets the internal layout
Cell ptrinternal_top_cellGets the internal top cell
[const]boolis_extracted?Gets a value indicating whether the netlist has been extracted
[const]boolis_persisted?(const Region layer)Returns true, if the given layer is a persisted region.
[const]boolis_persisted?(const Texts layer)Returns true, if the given layer is a persisted texts collection.
voidjoin_net_names(string pattern)Specifies another pattern for implicit joining of nets for the top level cell.
voidjoin_net_names(string cell_pattern,
string pattern)
Specifies another pattern for implicit joining of nets for the cells from the given cell pattern.
voidjoin_nets(string[] net_names)Specifies another name list for explicit joining of nets for the top level cell.
voidjoin_nets(string cell_pattern,
string[] net_names)
Specifies another name list for explicit joining of nets for the cells from the given cell pattern.
voidkeep_dssResumes ownership over the DSS object if created with an external one.
new Region ptrlayer_by_index(unsigned int index)Gets a layer object for the given index.
new Region ptrlayer_by_name(string name)Gets a layer object for the given name.
[const]stringlayer_name(const ShapeCollection l)Gets the name of the given layer
[const]stringlayer_name(unsigned int l)Gets the name of the given layer (by index)
[const]string[]layer_namesReturns a list of names of the layer kept inside the LayoutToNetlist object.
[const]unsigned intlayer_of(const Region l)Gets the internal layer for a given extraction layer
[const]unsigned intlayer_of(const Texts l)Gets the internal layer for a given text collection
new Region ptrmake_layer(string name = )Creates a new, empty hierarchical region
new Region ptrmake_layer(unsigned int layer_index,
string name = )
Creates a new hierarchical region representing an original layer
new Region ptrmake_polygon_layer(unsigned int layer_index,
string name = )
Creates a new region representing an original layer taking polygons and texts
new Texts ptrmake_text_layer(unsigned int layer_index,
string name = )
Creates a new region representing an original layer taking texts only
[const]unsigned longmax_vertex_count
voidmax_vertex_count=(unsigned long n)Sets the max_vertex_count parameter for the hierarchical network processor
[const]stringnameGets the name of the database
voidname=(string arg1)Sets the name of the database
[const]Netlist ptrnetlistgets the netlist extracted (0 if no extraction happened yet)
[const]stringoriginal_fileGets the original file name of the database
voidoriginal_file=(string arg1)Sets the original file name of the database
Net ptrprobe_net(const Region of_layer,
const DPoint point,
SubCircuit ptr[] ptr sc_path_out = nil,
Circuit ptr initial_circuit = nil)
Finds the net by probing a specific location on the given layer
Net ptrprobe_net(const Region of_layer,
const Point point,
SubCircuit ptr[] ptr sc_path_out = nil,
Circuit ptr initial_circuit = nil)
Finds the net by probing a specific location on the given layer
voidread(string path)Reads the extracted netlist from the file.
voidread_l2n(string path)Reads the extracted netlist from the file.
voidregister(const ShapeCollection l,
string n = )
Names the given layer
voidreset_extractedResets the extracted netlist and enables re-extraction
[const]new Region ptrshapes_of_net(const Net net,
const Region of_layer,
bool recursive = true,
const ICplxTrans trans = unity)
Returns all shapes of a specific net and layer.
[const]voidshapes_of_net(const Net net,
const Region of_layer,
bool recursive,
Shapes to,
unsigned long propid = 0,
const ICplxTrans trans = unity)
Sends all shapes of a specific net and layer to the given Shapes container.
[const]intthreadsGets the number of threads to use for operations which support multiple threads
voidthreads=(int n)Sets the number of threads to use for operations which support multiple threads
[const]booltop_level_modeGets a flag indicating whether top level mode is enabled.
voidtop_level_mode=(bool flag)Sets a flag indicating whether top level mode is enabled.
voidwrite(string path,
bool short_format = false)
Writes the extracted netlist to a file.
voidwrite_l2n(string path,
bool short_format = false)
Writes the extracted netlist to a file.

Public static methods and constants

[static,const]LayoutToNetlist::BuildNetHierarchyModeBNH_DisconnectedThis constant tells build_net and build_all_nets to produce local nets without connections to subcircuits (used for the "hier_mode" parameter).
[static,const]LayoutToNetlist::BuildNetHierarchyModeBNH_FlattenThis constant tells build_net and build_all_nets to flatten the nets (used for the "hier_mode" parameter).
[static,const]LayoutToNetlist::BuildNetHierarchyModeBNH_SubcircuitCellsThis constant tells build_net and build_all_nets to produce a hierarchy of subcircuit cells per net (used for the "hier_mode" parameter).

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const,iter]LogEntryDataeach_errorUse of this method is deprecated. Use each_log_entry instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

BNH_Disconnected

Signature: [static,const] LayoutToNetlist::BuildNetHierarchyMode BNH_Disconnected

Description: This constant tells build_net and build_all_nets to produce local nets without connections to subcircuits (used for the "hier_mode" parameter).

Python specific notes:
The object exposes a readable attribute 'BNH_Disconnected'. This is the getter.

BNH_Flatten

Signature: [static,const] LayoutToNetlist::BuildNetHierarchyMode BNH_Flatten

Description: This constant tells build_net and build_all_nets to flatten the nets (used for the "hier_mode" parameter).

Python specific notes:
The object exposes a readable attribute 'BNH_Flatten'. This is the getter.

BNH_SubcircuitCells

Signature: [static,const] LayoutToNetlist::BuildNetHierarchyMode BNH_SubcircuitCells

Description: This constant tells build_net and build_all_nets to produce a hierarchy of subcircuit cells per net (used for the "hier_mode" parameter).

Python specific notes:
The object exposes a readable attribute 'BNH_SubcircuitCells'. This is the getter.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

antenna_check

(1) Signature: Region antenna_check (const Region gate, const Region metal, double ratio, variant[] diodes = [], Texts ptr texts = nil)

Description: Runs an antenna check on the extracted clusters

The antenna check will traverse all clusters and run an antenna check for all root clusters. The antenna ratio is defined by the total area of all "metal" shapes divided by the total area of all "gate" shapes on the cluster. Of all clusters where the antenna ratio is larger than the limit ratio all metal shapes are copied to the output region as error markers.

The simple call is:

l2n = ... # a LayoutToNetlist object
l2n.extract_netlist
# check for antenna ratio 10.0 of metal vs. poly:
errors = l2n.antenna(poly, metal, 10.0)

You can include diodes which rectify the antenna effect. Provide recognition layers for theses diodes and include them in the connections. Then specify the diode layers in the antenna call:

...
# include diode_layer1:
errors = l2n.antenna(poly, metal, 10.0, [ diode_layer1 ])
# include diode_layer1 and diode_layer2:errors = l2n.antenna(poly, metal, 10.0, [ diode_layer1, diode_layer2 ])

Diodes can be configured to partially reduce the antenna effect depending on their area. This will make the diode_layer1 increase the ratio by 50.0 per square micrometer area of the diode:

...
# diode_layer1 increases the ratio by 50 per square micrometer area:
errors = l2n.antenna(poly, metal, 10.0 [ [ diode_layer, 50.0 ] ])

If 'texts' is non-nil, this text collection will receive labels explaining the error in terms of area values and relevant ratio.

The 'texts' parameter has been added in version 0.27.11.

(2) Signature: Region antenna_check (const Region gate, double gate_perimeter_factor, const Region metal, double metal_perimeter_factor, double ratio, variant[] diodes = [], Texts ptr texts = nil)

Description: Runs an antenna check on the extracted clusters taking the perimeter into account

This version of the antenna_check method allows taking the perimeter of gate or metal into account. The effective area is computed using:

Aeff = A + P * t

Here Aeff is the area used in the check, A is the polygon area, P the perimeter and t the perimeter factor. This formula applies to gate polygon area/perimeter with 'gate_perimeter_factor' for t and metal polygon area/perimeter with 'metal_perimeter_factor'. The perimeter_factor has the dimension of micrometers and can be thought of as the width of the material. Essentially the side walls of the material are taking into account for the surface area as well.

This variant has been introduced in version 0.26.6.

(3) Signature: Region antenna_check (const Region gate, double gate_area_factor, double gate_perimeter_factor, const Region metal, double metal_area_factor, double metal_perimeter_factor, double ratio, variant[] diodes = [], Texts ptr texts = nil)

Description: Runs an antenna check on the extracted clusters taking the perimeter into account and providing an area factor

This (most generic) version of the antenna_check method allows taking the perimeter of gate or metal into account and also provides a scaling factor for the area part. The effective area is computed using:

Aeff = A * f + P * t

Here f is the area factor and t the perimeter factor. A is the polygon area and P the polygon perimeter. A use case for this variant is to set the area factor to zero. This way, only perimeter contributions are considered.

This variant has been introduced in version 0.26.6.

area_ratio

Signature: [const] double area_ratio

Description: Gets the area_ratio parameter for the hierarchical network processor

See area_ratio= for details about this attribute.

Python specific notes:
The object exposes a readable attribute 'area_ratio'. This is the getter.

area_ratio=

Signature: void area_ratio= (double r)

Description: Sets the area_ratio parameter for the hierarchical network processor

This parameter controls splitting of large polygons in order to reduce the error made by the bounding box approximation.

Python specific notes:
The object exposes a writable attribute 'area_ratio'. This is the setter.

build_all_nets

Signature: [const] void build_all_nets (const CellMapping cmap, Layout target, map<unsigned int,const Region ptr> lmap, variant net_cell_name_prefix = nil, variant netname_prop = nil, LayoutToNetlist::BuildNetHierarchyMode hier_mode = BNH_Flatten, variant circuit_cell_name_prefix = nil, variant device_cell_name_prefix = nil)

Description: Builds a full hierarchical representation of the nets

cmap:The mapping of internal layout to target layout for the circuit mapping
target:The target layout
lmap:Target layer indexes (keys) and net regions (values)
hier_mode:See description of this method
netname_prop:An (optional) property name to which to attach the net name
circuit_cell_name_prefix:See method description
net_cell_name_prefix:See method description
device_cell_name_prefix:See above

This method copies all nets into cells corresponding to the circuits. It uses the 'cmap' object to determine the target cell (create it with "cell_mapping_into" or "const_cell_mapping_into"). If no mapping is provided for a specific circuit cell, the nets are copied into the next mapped parent as many times as the circuit cell appears there (circuit flattening).

The method has three net annotation modes:

  • No annotation (net_cell_name_prefix == nil and netname_prop == nil): the shapes will be put into the target cell simply.
  • Net name property (net_cell_name_prefix == nil and netname_prop != nil): the shapes will be annotated with a property named with netname_prop and containing the net name string.
  • Individual subcells per net (net_cell_name_prefix != 0): for each net, a subcell is created and the net shapes will be put there (name of the subcell = net_cell_name_prefix + net name). (this mode can be combined with netname_prop too).

In addition, net hierarchy is covered in three ways:

  • No connection indicated (hier_mode == BNH_Disconnected: the net shapes are simply put into their respective circuits. The connections are not indicated.
  • Subnet hierarchy (hier_mode == BNH_SubcircuitCells): for each root net, a full hierarchy is built to accommodate the subnets (see build_net in recursive mode).
  • Flat (hier_mode == BNH_Flatten): each net is flattened and put into the circuit it belongs to.

If a device cell name prefix is given, cells will be produced for each device abstract using a name like device_cell_name_prefix + device name. Otherwise the device shapes are treated as part of the net.

build_net

Signature: [const] void build_net (const Net net, Layout target, Cell target_cell, map<unsigned int,const Region ptr> lmap, variant netname_prop = nil, LayoutToNetlist::BuildNetHierarchyMode hier_mode = BNH_Flatten, variant circuit_cell_name_prefix = nil, variant device_cell_name_prefix = nil)

Description: Builds a net representation in the given layout and cell

target:The target layout
target_cell:The target cell
lmap:Target layer indexes (keys) and net regions (values)
hier_mode:See description of this method
netname_prop:An (optional) property name to which to attach the net name
cell_name_prefix:Chooses recursive mode if non-null
device_cell_name_prefix:See above

This method puts the shapes of a net into the given target cell using a variety of options to represent the net name and the hierarchy of the net.

If the netname_prop name is not nil, a property with the given name is created and assigned the net name.

Net hierarchy is covered in three ways:

  • No connection indicated (hier_mode == BNH_Disconnected: the net shapes are simply put into their respective circuits. The connections are not indicated.
  • Subnet hierarchy (hier_mode == BNH_SubcircuitCells): for each root net, a full hierarchy is built to accommodate the subnets (see build_net in recursive mode).
  • Flat (hier_mode == BNH_Flatten): each net is flattened and put into the circuit it belongs to.
If a device cell name prefix is given, cells will be produced for each device abstract using a name like device_cell_name_prefix + device name. Otherwise the device shapes are treated as part of the net.

build_nets

Signature: [const] void build_nets (const Net ptr[] nets, const CellMapping cmap, Layout target, map<unsigned int,const Region ptr> lmap, variant net_cell_name_prefix = nil, variant netname_prop = nil, LayoutToNetlist::BuildNetHierarchyMode hier_mode = BNH_Flatten, variant circuit_cell_name_prefix = nil, variant device_cell_name_prefix = nil)

Description: Like build_all_nets, but with the ability to select some nets.

cell_mapping_into

(1) Signature: CellMapping cell_mapping_into (Layout layout, Cell cell, bool with_device_cells = false)

Description: Creates a cell mapping for copying shapes from the internal layout to the given target layout.

If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. Use this option, if you want to access device terminal shapes per device.

CAUTION: this function may create new cells in 'layout'. Use const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it.

(2) Signature: CellMapping cell_mapping_into (Layout layout, Cell cell, const Net ptr[] nets, bool with_device_cells = false)

Description: Creates a cell mapping for copying shapes from the internal layout to the given target layout.

This version will only create cells which are required to represent the nets from the 'nets' argument.

If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. Use this option, if you want to access device terminal shapes per device.

CAUTION: this function may create new cells in 'layout'. Use const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it.

check_extraction_errors

Signature: void check_extraction_errors

Description: Raises an exception if extraction errors are present

This method has been introduced in version 0.28.13.

clear_join_net_names

Signature: void clear_join_net_names

Description: Clears all implicit net joining expressions.

See extract_netlist for more details about this feature.

This method has been introduced in version 0.27 and replaces the arguments of extract_netlist.

clear_join_nets

Signature: void clear_join_nets

Description: Clears all explicit net joining expressions.

See extract_netlist for more details about this feature.

Explicit net joining has been introduced in version 0.27.

connect

(1) Signature: void connect (const Region l)

Description: Defines an intra-layer connection for the given layer.

The layer is either an original layer created with make_includelayer and its variants or a derived layer. Certain limitations apply. It's safe to use boolean operations for deriving layers. Other operations are applicable as long as they are capable of delivering hierarchical layers.

(2) Signature: void connect (const Region a, const Region b)

Description: Defines an inter-layer connection for the given layers.

The conditions mentioned with intra-layer connect apply for this method too.

(3) Signature: void connect (const Region a, const Texts b)

Description: Defines an inter-layer connection for the given layers.

The conditions mentioned with intra-layer connect apply for this method too. As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons.

This variant has been introduced in version 0.27.

(4) Signature: void connect (const Texts a, const Region b)

Description: Defines an inter-layer connection for the given layers.

The conditions mentioned with intra-layer connect apply for this method too. As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons.

This variant has been introduced in version 0.27.

connect_global

(1) Signature: unsigned long connect_global (const Region l, string global_net_name)

Description: Defines a connection of the given layer with a global net.

This method returns the ID of the global net. Use global_net_name to get the name back from the ID.

(2) Signature: unsigned long connect_global (const Texts l, string global_net_name)

Description: Defines a connection of the given text layer with a global net.

This method returns the ID of the global net. Use global_net_name to get the name back from the ID. This variant has been introduced in version 0.27.

const_cell_mapping_into

Signature: CellMapping const_cell_mapping_into (const Layout layout, const Cell cell)

Description: Creates a cell mapping for copying shapes from the internal layout to the given target layout.

This version will not create new cells in the target layout. If the required cells do not exist there yet, flatting will happen.

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

description

Signature: [const] string description

Description: Gets the description of the database

Python specific notes:
The object exposes a readable attribute 'description'. This is the getter.

description=

Signature: void description= (string arg1)

Description: Sets the description of the database

Python specific notes:
The object exposes a writable attribute 'description'. This is the setter.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

device_scaling

Signature: [const] double device_scaling

Description: Gets the device scaling factor

See device_scaling= for details about this attribute.

Python specific notes:
The object exposes a readable attribute 'device_scaling'. This is the getter.

device_scaling=

Signature: void device_scaling= (double f)

Description: Sets the device scaling factor

This factor will scale the physical properties of the extracted devices accordingly. The scale factor applies an isotropic shrink (<1) or expansion (>1).

Python specific notes:
The object exposes a writable attribute 'device_scaling'. This is the setter.

dss

Signature: DeepShapeStore dss

Description: Gets a reference to the internal DSS object.

each_error

Signature: [const,iter] LogEntryData each_error

Description: Iterates over all log entries collected during device and netlist extraction.

Use of this method is deprecated. Use each_log_entry instead

This method has been introduced in version 0.28.13.

each_log_entry

Signature: [const,iter] LogEntryData each_log_entry

Description: Iterates over all log entries collected during device and netlist extraction.

This method has been introduced in version 0.28.13.

extract_devices

Signature: void extract_devices (DeviceExtractorBase extractor, map<string,ShapeCollection ptr> layers)

Description: Extracts devices

See the class description for more details. This method will run device extraction for the given extractor. The layer map is specific for the extractor and uses the region objects derived with make_layer and its variants.

In addition, derived regions can be passed too. Certain limitations apply. It's safe to use boolean operations for deriving layers. Other operations are applicable as long as they are capable of delivering hierarchical layers.

If errors occur, the device extractor will contain theses errors.

extract_netlist

Signature: void extract_netlist

Description: Runs the netlist extraction

See the class description for more details.

This method has been made parameter-less in version 0.27. Use include_floating_subcircuits= and join_net_names as substitutes for the arguments of previous versions.

filename

Signature: [const] string filename

Description: Gets the file name of the database

The filename is the name under which the database is stored or empty if it is not associated with a file.

generator

Signature: [const] string generator

Description: Gets the generator string.

The generator is the script that created this database.

Python specific notes:
The object exposes a readable attribute 'generator'. This is the getter.

generator=

Signature: void generator= (string generator)

Description: Sets the generator string.

Python specific notes:
The object exposes a writable attribute 'generator'. This is the setter.

global_net_name

Signature: [const] string global_net_name (unsigned long global_net_id)

Description: Gets the global net name for the given global net ID.

include_floating_subcircuits

Signature: [const] bool include_floating_subcircuits

Description: Gets a flag indicating whether to include floating subcircuits in the netlist.

See include_floating_subcircuits= for details.

This attribute has been introduced in version 0.27.

Python specific notes:
The object exposes a readable attribute 'include_floating_subcircuits'. This is the getter.

include_floating_subcircuits=

Signature: void include_floating_subcircuits= (bool flag)

Description: Sets a flag indicating whether to include floating subcircuits in the netlist.

With 'include_floating_subcircuits' set to true, subcircuits with no connection to their parent circuit are still included in the circuit as floating subcircuits. Specifically on flattening this means that these subcircuits are properly propagated to their parent instead of appearing as additional top circuits.

This attribute has been introduced in version 0.27 and replaces the arguments of extract_netlist.

Python specific notes:
The object exposes a writable attribute 'include_floating_subcircuits'. This is the setter.

internal_layout

Signature: Layout ptr internal_layout

Description: Gets the internal layout

Usually it should not be required to obtain the internal layout. If you need to do so, make sure not to modify the layout as the functionality of the netlist extractor depends on it.

internal_top_cell

Signature: Cell ptr internal_top_cell

Description: Gets the internal top cell

Usually it should not be required to obtain the internal cell. If you need to do so, make sure not to modify the cell as the functionality of the netlist extractor depends on it.

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

is_extracted?

Signature: [const] bool is_extracted?

Description: Gets a value indicating whether the netlist has been extracted

This method has been introduced in version 0.27.1.

is_persisted?

(1) Signature: [const] bool is_persisted? (const Region layer)

Description: Returns true, if the given layer is a persisted region.

Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Named layers are persisted, unnamed layers are not. Only persisted, named layers can be put into connect.

(2) Signature: [const] bool is_persisted? (const Texts layer)

Description: Returns true, if the given layer is a persisted texts collection.

Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Named layers are persisted, unnamed layers are not. Only persisted, named layers can be put into connect.

The variant for Texts collections has been added in version 0.27.

join_net_names

(1) Signature: void join_net_names (string pattern)

Description: Specifies another pattern for implicit joining of nets for the top level cell.

Use this method to register a pattern for net labels considered in implicit net joining. Implicit net joining allows connecting multiple parts of the same nets (e.g. supply rails) without need for a physical connection. The pattern specifies labels to look for. When parts are labelled with a name matching the expression, the parts carrying the same name are joined.

This method adds a new pattern. Use clear_join_net_names to clear the registered pattern.

Each pattern is a glob expression. Valid glob expressions are:

  • "" no implicit connections.
  • "*" to make all labels candidates for implicit connections.
  • "VDD" to make all 'VDD'' nets candidates for implicit connections.
  • "VDD" to make all 'VDD'+suffix nets candidates for implicit connections.
  • "{VDD,VSS}" to all VDD and VSS nets candidates for implicit connections.

Label matching is case sensitive.

This method has been introduced in version 0.27 and replaces the arguments of extract_netlist.

(2) Signature: void join_net_names (string cell_pattern, string pattern)

Description: Specifies another pattern for implicit joining of nets for the cells from the given cell pattern.

This method allows applying implicit net joining for specific cells, not only for the top cell.

This method adds a new pattern. Use clear_join_net_names to clear the registered pattern.

This method has been introduced in version 0.27 and replaces the arguments of extract_netlist.

join_nets

(1) Signature: void join_nets (string[] net_names)

Description: Specifies another name list for explicit joining of nets for the top level cell.

Use this method to join nets from the set of net names. All these nets will be connected together forming a single net. Explicit joining will imply implicit joining for the involved nets - partial nets involved will be connected too (intra-net joining).

This method adds a new name list. Use clear_join_nets to clear the registered pattern.

Explicit net joining has been introduced in version 0.27.

(2) Signature: void join_nets (string cell_pattern, string[] net_names)

Description: Specifies another name list for explicit joining of nets for the cells from the given cell pattern.

This method allows applying explicit net joining for specific cells, not only for the top cell.

This method adds a new name list. Use clear_join_nets to clear the registered pattern.

Explicit net joining has been introduced in version 0.27.

keep_dss

Signature: void keep_dss

Description: Resumes ownership over the DSS object if created with an external one.

layer_by_index

Signature: new Region ptr layer_by_index (unsigned int index)

Description: Gets a layer object for the given index.

Only named layers can be retrieved with this method. The returned object is a copy which represents the named layer.

layer_by_name

Signature: new Region ptr layer_by_name (string name)

Description: Gets a layer object for the given name.

The returned object is a copy which represents the named layer.

layer_name

(1) Signature: [const] string layer_name (const ShapeCollection l)

Description: Gets the name of the given layer

(2) Signature: [const] string layer_name (unsigned int l)

Description: Gets the name of the given layer (by index)

layer_names

Signature: [const] string[] layer_names

Description: Returns a list of names of the layer kept inside the LayoutToNetlist object.

layer_of

(1) Signature: [const] unsigned int layer_of (const Region l)

Description: Gets the internal layer for a given extraction layer

This method is required to derive the internal layer index - for example for investigating the cluster tree.

(2) Signature: [const] unsigned int layer_of (const Texts l)

Description: Gets the internal layer for a given text collection

This method is required to derive the internal layer index - for example for investigating the cluster tree.

The variant for Texts collections has been added in version 0.27.

make_layer

(1) Signature: new Region ptr make_layer (string name = )

Description: Creates a new, empty hierarchical region

The name is optional. If given, the layer will already be named accordingly (see register).

(2) Signature: new Region ptr make_layer (unsigned int layer_index, string name = )

Description: Creates a new hierarchical region representing an original layer

'layer_index' is the layer index of the desired layer in the original layout. This variant produces polygons and takes texts for net name annotation. A variant not taking texts is make_polygon_layer. A Variant only taking texts is make_text_layer.

The name is optional. If given, the layer will already be named accordingly (see register).

make_polygon_layer

Signature: new Region ptr make_polygon_layer (unsigned int layer_index, string name = )

Description: Creates a new region representing an original layer taking polygons and texts

See make_layer for details.

The name is optional. If given, the layer will already be named accordingly (see register).

make_text_layer

Signature: new Texts ptr make_text_layer (unsigned int layer_index, string name = )

Description: Creates a new region representing an original layer taking texts only

See make_layer for details.

The name is optional. If given, the layer will already be named accordingly (see register).

Starting with version 0.27, this method returns a Texts object.

max_vertex_count

Signature: [const] unsigned long max_vertex_count

Description:

See max_vertex_count= for details about this attribute.

Python specific notes:
The object exposes a readable attribute 'max_vertex_count'. This is the getter.

max_vertex_count=

Signature: void max_vertex_count= (unsigned long n)

Description: Sets the max_vertex_count parameter for the hierarchical network processor

This parameter controls splitting of large polygons in order to enhance performance for very big polygons.

Python specific notes:
The object exposes a writable attribute 'max_vertex_count'. This is the setter.

name

Signature: [const] string name

Description: Gets the name of the database

Python specific notes:
The object exposes a readable attribute 'name'. This is the getter.

name=

Signature: void name= (string arg1)

Description: Sets the name of the database

Python specific notes:
The object exposes a writable attribute 'name'. This is the setter.

netlist

Signature: [const] Netlist ptr netlist

Description: gets the netlist extracted (0 if no extraction happened yet)

new

(1) Signature: [static] new LayoutToNetlist ptr new (const RecursiveShapeIterator iter)

Description: Creates a new extractor connected to an original layout

This constructor will attach the extractor to an original layout through the shape iterator.

Python specific notes:
This method is the default initializer of the object.

(2) Signature: [static] new LayoutToNetlist ptr new

Description: Creates a new and empty extractor object

The main objective for this constructor is to create an object suitable for reading an annotated netlist.

Python specific notes:
This method is the default initializer of the object.

(3) Signature: [static] new LayoutToNetlist ptr new (DeepShapeStore ptr dss)

Description: Creates a new extractor object reusing an existing DeepShapeStore object

This constructor can be used if there is a DSS object already from which the shapes can be taken. This version can only be used with register to add layers (regions) inside the 'dss' object.

The make_... methods will not create new layers as there is no particular place defined where to create the layers.

The extractor will not take ownership of the dss object unless you call keep_dss.

Python specific notes:
This method is the default initializer of the object.

(4) Signature: [static] new LayoutToNetlist ptr new (DeepShapeStore ptr dss, unsigned int layout_index)

Description: Creates a new extractor object reusing an existing DeepShapeStore object

This constructor can be used if there is a DSS object already from which the shapes can be taken. NOTE: in this case, the make_... functions will create new layers inside this DSS. To register existing layers (regions) use register.

Python specific notes:
This method is the default initializer of the object.

(5) Signature: [static] new LayoutToNetlist ptr new (string topcell_name, double dbu)

Description: Creates a new extractor object with a flat DSS

topcell_name:The name of the top cell of the internal flat layout
dbu:The database unit to use for the internal flat layout

This constructor will create an extractor for flat extraction. Layers registered with register will be flattened. New layers created with make_... will be flat layers.

The database unit is mandatory because the physical parameter extraction for devices requires this unit for translation of layout to physical dimensions.

Python specific notes:
This method is the default initializer of the object.

original_file

Signature: [const] string original_file

Description: Gets the original file name of the database

The original filename is the layout file from which the netlist DB was created.

Python specific notes:
The object exposes a readable attribute 'original_file'. This is the getter.

original_file=

Signature: void original_file= (string arg1)

Description: Sets the original file name of the database

Python specific notes:
The object exposes a writable attribute 'original_file'. This is the setter.

probe_net

(1) Signature: Net ptr probe_net (const Region of_layer, const DPoint point, SubCircuit ptr[] ptr sc_path_out = nil, Circuit ptr initial_circuit = nil)

Description: Finds the net by probing a specific location on the given layer

This method will find a net looking at the given layer at the specific position. It will traverse the hierarchy below if no shape in the requested layer is found in the specified location. The function will report the topmost net from far above the hierarchy of circuits as possible.

If initial_circuit is given, the probing will start from this circuit and from the cell this circuit represents. By default, the probing will start from the top circuit.

If no net is found at all, 0 is returned.

It is recommended to use probe_net on the netlist right after extraction. Optimization functions such as Netlist#purge will remove parts of the net which means shape to net probing may no longer work for these nets.

If non-null and an array, 'sc_path_out' will receive a list of SubCircuits objects which lead to the net from the top circuit of the database.

This variant accepts a micrometer-unit location. The location is given in the coordinate space of the initial cell.

The sc_path_out and initial_circuit parameters have been added in version 0.27.

(2) Signature: Net ptr probe_net (const Region of_layer, const Point point, SubCircuit ptr[] ptr sc_path_out = nil, Circuit ptr initial_circuit = nil)

Description: Finds the net by probing a specific location on the given layer

See the description of the other probe_net variant. This variant accepts a database-unit location. The location is given in the coordinate space of the initial cell.

The sc_path_out and initial_circuit parameters have been added in version 0.27.

read

Signature: void read (string path)

Description: Reads the extracted netlist from the file.

This method employs the native format of KLayout.

read_l2n

Signature: void read_l2n (string path)

Description: Reads the extracted netlist from the file.

This method employs the native format of KLayout.

register

Signature: void register (const ShapeCollection l, string n = )

Description: Names the given layer

'l' must be a Region or Texts object. Flat regions or text collections must be registered with this function, before they can be used in connect. Registering will copy the shapes into the LayoutToNetlist object in this step to enable netlist extraction.

Naming a layer allows the system to indicate the layer in various contexts, i.e. when writing the data to a file. Named layers are also persisted inside the LayoutToNetlist object. They are not discarded when the Region object is destroyed.

If required, the system will assign a name automatically. This method has been generalized in version 0.27.

reset_extracted

Signature: void reset_extracted

Description: Resets the extracted netlist and enables re-extraction

This method is implicitly called when using connect or connect_global after a netlist has been extracted. This enables incremental connect with re-extraction.

This method has been introduced in version 0.27.1.

shapes_of_net

(1) Signature: [const] new Region ptr shapes_of_net (const Net net, const Region of_layer, bool recursive = true, const ICplxTrans trans = unity)

Description: Returns all shapes of a specific net and layer.

If 'recursive'' is true, the returned region will contain the shapes of all subcircuits too.

The optional 'trans' parameter allows applying a transformation to all shapes. It has been introduced in version 0.28.4.

(2) Signature: [const] void shapes_of_net (const Net net, const Region of_layer, bool recursive, Shapes to, unsigned long propid = 0, const ICplxTrans trans = unity)

Description: Sends all shapes of a specific net and layer to the given Shapes container.

If 'recursive'' is true, the returned region will contain the shapes of all subcircuits too. "prop_id" is an optional properties ID. If given, this property set will be attached to the shapes. The optional 'trans' parameter allows applying a transformation to all shapes. It has been introduced in version 0.28.4.

threads

Signature: [const] int threads

Description: Gets the number of threads to use for operations which support multiple threads

Python specific notes:
The object exposes a readable attribute 'threads'. This is the getter.

threads=

Signature: void threads= (int n)

Description: Sets the number of threads to use for operations which support multiple threads

Python specific notes:
The object exposes a writable attribute 'threads'. This is the setter.

top_level_mode

Signature: [const] bool top_level_mode

Description: Gets a flag indicating whether top level mode is enabled.

See top_level_mode= for details.

This attribute has been introduced in version 0.28.13.

Python specific notes:
The object exposes a readable attribute 'top_level_mode'. This is the getter.

top_level_mode=

Signature: void top_level_mode= (bool flag)

Description: Sets a flag indicating whether top level mode is enabled.

In top level mode, must-connect warnings are turned into errors for example. To enable top level mode, set this attribute to true. By default, top-level mode is turned off.

This attribute has been introduced in version 0.28.13.

Python specific notes:
The object exposes a writable attribute 'top_level_mode'. This is the setter.

write

Signature: void write (string path, bool short_format = false)

Description: Writes the extracted netlist to a file.

This method employs the native format of KLayout.

write_l2n

Signature: void write_l2n (string path, bool short_format = false)

Description: Writes the extracted netlist to a file.

This method employs the native format of KLayout.