From 5961eab84bd2d394f3ca94f9482622180d796010 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 21 Nov 2023 23:10:10 +0100 Subject: [PATCH] Regenerating stubs and DRC/LVS doc --- src/doc/doc/about/drc_ref_global.xml | 18 + src/doc/doc/about/drc_ref_netter.xml | 108 ++- src/pymod/distutils_src/klayout/dbcore.pyi | 828 ++++++++++++-------- src/pymod/distutils_src/klayout/laycore.pyi | 4 +- 4 files changed, 610 insertions(+), 348 deletions(-) diff --git a/src/doc/doc/about/drc_ref_global.xml b/src/doc/doc/about/drc_ref_global.xml index 0e80df7f37..f18b0f0e70 100644 --- a/src/doc/doc/about/drc_ref_global.xml +++ b/src/doc/doc/about/drc_ref_global.xml @@ -855,6 +855,15 @@ This function will evaluate the conditions c1 to cn and return the current primary shape if all conditions renders an empty result. See if_all for an example how to use the if_... functions.

+

"ignore_extraction_errors" - Specifies whether to ignore extraction errors

+ +

Usage:

+
    +
  • ignore_extraction_errors(value)
  • +
+

+See Netter#ignore_extraction_errors for a description of that function. +

"info" - Outputs as message to the logger or progress window

Usage:

@@ -2058,6 +2067,15 @@ To disable tiling mode use
flat or deep.

Tiling mode will disable deep mode (see deep).

+

"top_level" - Specifies that the circuit is a chip top level circuit

+ +

Usage:

+
    +
  • top_level(flag)
  • +
+

+See Netter#top_level for a description of that function. +

"verbose" - Sets or resets verbose mode

Usage:

diff --git a/src/doc/doc/about/drc_ref_netter.xml b/src/doc/doc/about/drc_ref_netter.xml index 983268f9fc..8fd41f6f50 100644 --- a/src/doc/doc/about/drc_ref_netter.xml +++ b/src/doc/doc/about/drc_ref_netter.xml @@ -242,7 +242,7 @@ joins. Connections are accumulated. The connections defined so far can be cleared with
clear_connections.

-

"connect_explicit" - Specifies a list of net names for nets to connect explicitly

+

"connect_explicit" - Specifies a list of net names for nets to connect ("must connect" nets)

Usage:

Use this method to explicitly connect nets even if there is no physical connection. -As this breaks with the concept of physical verification, this feature should be used -with care. -

-The first version of this function will connect all nets listed in the "net_names" array -in the top level cell. The second version takes a cell name pattern and connects all nets listed -in "net_names" for cells matching this pattern. -

-A use case for this method is the following: consider a set of standard cells. These do not have a bulk -or n-well pin in the schematics. They also do not have build in tie-down diodes for the -substrate connections. In this case there is a build-in discrepancy between the -schematics and the layout: bulk and VSS are separate nets within the layout, but the -schematic does not list them as separate. The solution is to make an explicit connection -between VDD and n-well and VSS and bulk, provided VDD and VSS are properly labelled as "VDD" and "VSS" -and n-well and bulk are accessible as named nets (for bulk you can use "connect_global"). -

-The following code will establish an explicit connection for all cells called "INV.." between -BULK and VSS nets: +The concept is similar to implicit connection (see connect_implicit). The method gets +a list of nets which are connected virtually, even if there is no physical connection. +The first version applies this scheme to all cells, the second version to cells matching +the cell name pattern. The cell name pattern follows the usual glob style form (e.g. "A*" +applies the connection in all cells whose name starts with "A"). +

+This method is useful to establish a logical connection which is made later up on the +next level of hierarchy. For example, a standard cell my not contain substrate or well +taps as these may be made by tap or spare cells. Logically however, the cell only has +one power or ground pin for the devices and substrate or well. In order to match both +representations - for example for the purpose of LVS - the dual power or ground pins have +to be connected. Assuming that there is a global net "BULK" for the substrate and a +net "VSS" for the sources of the NMOS devices, the following statement will create this +connection for all cell names beginning with "INV":

 connect_global(bulk, "BULK")
@@ -275,14 +272,19 @@ connect_global(bulk, "BULK")
 connect_explicit("INV*", [ "BULK", "VSS" ])
 

+The resulting net and pin will carry a name made from the combination of the connected +nets. In this case it will be "BULK,VSS". +

+The virtual connection in general bears the risk of missing a physical connection. +The "connect_explicit" feature therefore checks whether the connection is made physically +on the next hierarchy level ("must connect" nets), except for top-level cells for which +it is assumed that this connection is made later. +A warning is raised instead for top level cells. +

Explicit connections also imply implicit connections between different parts of one of the nets. In the example before, "VSS" pieces without a physical connection will also be connected.

-When you use explicit connections you should make sure by other ways that the connection -is made physically. For example, for the bulk/n-well pin example above, by enforcing at least one -tie-down diode per n-well island and in the substrate by means of a DRC rule. -

The explicit connections are applied on the next net extraction and cleared on "clear_connections".

@@ -298,7 +300,7 @@ Global nets are common to all cells. Global nets automatically connect to parent cells throughs implied pins. An example is the substrate (bulk) net which connects to shapes belonging to tie-down diodes. "l" can be a polygon or text layer.

-

"connect_implicit" - Specifies a search pattern for labels which create implicit net connections

+

"connect_implicit" - Specifies a search pattern for implicit net connections ("must connect" nets)

Usage:

    @@ -306,23 +308,28 @@ to shapes belonging to tie-down diodes. "l" can be a polygon or text layer.
  • connect_implicit(cell_pattern, label_pattern)

-Use this method to supply label strings which create implicit net connections -on the top level circuit in the first version. This feature is useful to connect identically labelled nets -while a component isn't integrated yet. If the component is integrated, nets may be connected -on a higher hierarchy level - e.g. by a power mesh. Inside the component this net consists -of individual islands. To properly perform netlist extraction and comparison, these islands -need to be connected even though there isn't a physical connection. "connect_implicit" can -achive this if these islands are labelled with the same text on the top level of the -component. -

-In the second version, the pattern can be specified for a cell range (given by a cell name pattern or a -single cell name). These pattern are applied to non-top cells. The unspecific pattern -has priority over the cell-specific ones. As the cell selector is a pattern itself, a -single cell may fall into more than one category. In this case, the label filters are -combined. +This method specifies a net name search pattern, either for all cells or for +certain cells, given by a name search pattern. Search pattern follow the usual glob +form (e.g. "A*" for all cells or nets with names starting with "A"). +

+Then, for nets matching the net name pattern and for which there is more than +one subnet, the subnets are connected. "Subnets" are physically disconnected parts +of a net which carry the same name. +

+This feature is useful for example for power nets which are complete in a cell, +but are supposed to be connected upwards in the hierarchy ("must connect" nets). +Physically there are multiple nets, logically - and specifically in the schematic for +the purpose of LVS - there is only one net. +"connect_implicit" now creates a virtual, combined physical net that matches the logical net. +

+This is general bears the risk of missing a physical connection. The "connect_implicit" +feature therefore checks whether the connection is made physically on the next hierarchy +level, except for top-level cells for which it is assumed that this connection is made +later. A warning is raised instead for top level cells.

The implicit connections are applied on the next net extraction and cleared -on "clear_connections". +on "clear_connections". Another feature is connect_explicit which allows connecting +differently named subnets in a similar fashion.

"device_scaling" - Specifies a dimension scale factor for the geometrical device properties

@@ -394,6 +401,17 @@ extract_devices(mos4("NMOS4"), { :SD => nsd, :G => gate, :P => poly, :W The return value of this method will be the device class of the devices generated in the extraction step (see DeviceClass).

+

"ignore_extraction_errors" - Specifies whether to ignore extraction errors

+ +

Usage:

+
    +
  • ignore_extraction_errors(value)
  • +
+

+With this value set to false (the default), "extract_netlist" will raise +an exception upon extraction errors. Otherwise, extraction errors will be logged +but no error is raised. +

"l2n_data" - Gets the internal LayoutToNetlist object

Usage:

@@ -416,4 +434,18 @@ layout analysis. Hence, all
connect, connect statements will clear the netlist and re-extract it again.

+

"top_level" - Specifies top level mode

+ +

Usage:

+
    +
  • top_level(value)
  • +
+

+With this value set to false (the default), it is assumed that the +circuit is not used as a top level chip circuit. In that case, for +example must-connect nets which are not connected are reported as +as warnings. If top level mode is set to true, such disconnected +nets are reported as errors as this indicates a missing physical +connection. +

diff --git a/src/pymod/distutils_src/klayout/dbcore.pyi b/src/pymod/distutils_src/klayout/dbcore.pyi index 5d366fa7e7..b80b91062b 100644 --- a/src/pymod/distutils_src/klayout/dbcore.pyi +++ b/src/pymod/distutils_src/klayout/dbcore.pyi @@ -3696,7 +3696,7 @@ class Circuit(NetlistObject): @brief Joins (connects) two nets into one This method will connect the 'with' net with 'net' and remove 'with'. - This method has been introduced in version 0.26.4. + This method has been introduced in version 0.26.4. Starting with version 0.28.13, net names will be formed from both input names, combining them with as a comma-separated list. """ def net_by_cluster_id(self, cluster_id: int) -> Net: r""" @@ -4110,12 +4110,12 @@ class CompoundRegionOperationNode: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: @@ -4140,12 +4140,12 @@ class CompoundRegionOperationNode: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" @@ -4230,12 +4230,12 @@ class CompoundRegionOperationNode: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" @@ -4320,12 +4320,12 @@ class CompoundRegionOperationNode: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" @@ -11283,7 +11283,8 @@ class DText: Setter: @brief Sets the horizontal alignment - This is the version accepting integer values. It's provided for backward compatibility. + This property specifies how the text is aligned relative to the anchor point. + This property has been introduced in version 0.22 and extended to enums in 0.28. """ size: float r""" @@ -14917,14 +14918,18 @@ class DeviceExtractorBase: This method has been added in version 0.27.3. """ - def each_error(self) -> Iterator[NetlistDeviceExtractorError]: + def each_error(self) -> Iterator[LogEntryData]: r""" - @brief Iterates over all errors collected in the device extractor. + @brief Iterates over all log entries collected in the device extractor.Starting with version 0.28.13, the preferred name of the method is 'each_log_entry' as log entries have been generalized to become warnings too. """ def each_layer_definition(self) -> Iterator[NetlistDeviceExtractorLayerDefinition]: r""" @brief Iterates over all layer definitions. """ + def each_log_entry(self) -> Iterator[LogEntryData]: + r""" + @brief Iterates over all log entries collected in the device extractor.Starting with version 0.28.13, the preferred name of the method is 'each_log_entry' as log entries have been generalized to become warnings too. + """ def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -18912,7 +18917,7 @@ class Edges(ShapeCollection): """ class EdgeType: r""" - @brief This enum specifies the the edge type for edge angle filters. + @brief This enum specifies the edge type for edge angle filters. This enum was introduced in version 0.28. """ @@ -21522,6 +21527,42 @@ class GenericDeviceExtractor(DeviceExtractorBase): Use this unit to compute device properties. It is the database unit multiplied with the device scaling factor. """ + @overload + def warn(self, category_name: str, category_description: str, message: str) -> None: + r""" + @brief Issues a warning with the given category name and description, message + Warnings have been introduced in version 0.28.13. + """ + @overload + def warn(self, category_name: str, category_description: str, message: str, geometry: DPolygon) -> None: + r""" + @brief Issues a warning with the given category name and description, message and micrometer-units polygon geometry + Warnings have been introduced in version 0.28.13. + """ + @overload + def warn(self, category_name: str, category_description: str, message: str, geometry: Polygon) -> None: + r""" + @brief Issues a warning with the given category name and description, message and database-unit polygon geometry + Warnings have been introduced in version 0.28.13. + """ + @overload + def warn(self, message: str) -> None: + r""" + @brief Issues a warning with the given message + Warnings have been introduced in version 0.28.13. + """ + @overload + def warn(self, message: str, geometry: DPolygon) -> None: + r""" + @brief Issues a warning with the given message and micrometer-units polygon geometry + Warnings have been introduced in version 0.28.13. + """ + @overload + def warn(self, message: str, geometry: Polygon) -> None: + r""" + @brief Issues a warning with the given message and database-unit polygon geometry + Warnings have been introduced in version 0.28.13. + """ class GenericDeviceParameterCompare(EqualDeviceParameters): r""" @@ -21585,99 +21626,22 @@ class GenericNetlistCompareLogger(NetlistCompareLogger): The \NetlistComparer class will send compare events to a logger derived from this class. Use this class to implement your own logger class. You can override on of its methods to receive certain kind of events. This class has been introduced in version 0.26. """ - class Severity: - r""" - @brief This class represents the log severity level for \GenericNetlistCompareLogger#log_entry. - This enum has been introduced in version 0.28. - """ - Error: ClassVar[GenericNetlistCompareLogger.Severity] - r""" - @brief An error - """ - Info: ClassVar[GenericNetlistCompareLogger.Severity] - r""" - @brief Information only - """ - NoSeverity: ClassVar[GenericNetlistCompareLogger.Severity] - r""" - @brief Unspecific severity - """ - Warning: ClassVar[GenericNetlistCompareLogger.Severity] - r""" - @brief A warning - """ - @overload - @classmethod - def new(cls, i: int) -> GenericNetlistCompareLogger.Severity: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> GenericNetlistCompareLogger.Severity: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: GenericNetlistCompareLogger.Severity) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ + Error: ClassVar[Severity] + r""" + @brief Specifies error severity (preferred action is stop) + """ + Info: ClassVar[Severity] + r""" + @brief Specifies info severity (print if requested, otherwise silent) + """ + NoSeverity: ClassVar[Severity] + r""" + @brief Specifies no particular severity (default) + """ + Warning: ClassVar[Severity] + r""" + @brief Specifies warning severity (log with high priority, but do not stop) + """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -21790,12 +21754,12 @@ class HAlign: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -27137,6 +27101,13 @@ class Layout: r""" @brief Cancels the "in changes" state (see "start_changes") """ + def error_layer(self) -> int: + r""" + @brief Returns the index of the error layer + The error layer is used to place error texts on it, for example when a PCell evaluation fails. + + This method has been added in version 0.23.13. + """ @overload def find_layer(self, info: LayerInfo) -> Any: r""" @@ -29019,12 +28990,12 @@ class LayoutToNetlist: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __init__(self, i: int) -> None: @@ -29049,12 +29020,12 @@ class LayoutToNetlist: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ def __repr__(self) -> str: r""" @@ -29173,6 +29144,22 @@ class LayoutToNetlist: Setter: @brief Sets the number of threads to use for operations which support multiple threads """ + top_level_mode: bool + r""" + Getter: + @brief 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. + + Setter: + @brief 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. + """ @overload @classmethod def new(cls) -> LayoutToNetlist: @@ -29463,6 +29450,12 @@ class LayoutToNetlist: 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. """ + def check_extraction_errors(self) -> None: + r""" + @brief Raises an exception if extraction errors are present + + This method has been introduced in version 0.28.13. + """ def clear_join_net_names(self) -> None: r""" @brief Clears all implicit net joining expressions. @@ -29566,6 +29559,16 @@ class LayoutToNetlist: r""" @hide """ + def each_error(self) -> Iterator[LogEntryData]: + r""" + @brief Iterates over all log entries collected during device and netlist extraction. + This method has been introduced in version 0.28.13. + """ + def each_log_entry(self) -> Iterator[LogEntryData]: + r""" + @brief Iterates over all log entries collected during device and netlist extraction. + This method has been introduced in version 0.28.13. + """ def extract_devices(self, extractor: DeviceExtractorBase, layers: Dict[str, ShapeCollection]) -> None: r""" @brief Extracts devices @@ -31285,6 +31288,183 @@ class LoadLayoutOptions: Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. """ +class LogEntryData: + r""" + @brief A generic log entry + This class is used for example by the device extractor (see \NetlistDeviceExtractor) to keep errors or warnings that occurred during extraction of the devices. + + Other classes also make use of this object to store errors, warnings or information. The log entry object features a severity (warning, error, info), a message, an optional category name and description (good for filtering if needed) and an optional \DPolygon object for indicating some location or error marker. + The original class used to be "NetlistDeviceExtractorError" which had been introduced in version 0.26. It was generalized and renamed in version 0.28.13 as it was basically not useful as a separate class. + """ + Error: ClassVar[Severity] + r""" + @brief Specifies error severity (preferred action is stop) + """ + Info: ClassVar[Severity] + r""" + @brief Specifies info severity (print if requested, otherwise silent) + """ + NoSeverity: ClassVar[Severity] + r""" + @brief Specifies no particular severity (default) + """ + Warning: ClassVar[Severity] + r""" + @brief Specifies warning severity (log with high priority, but do not stop) + """ + category_description: str + r""" + Getter: + @brief Gets the category description. + See \category_name= for details about categories. + Setter: + @brief Sets the category description. + See \category_name= for details about categories. + """ + category_name: str + r""" + Getter: + @brief Gets the category name. + See \category_name= for more details. + Setter: + @brief Sets the category name. + The category name is optional. If given, it specifies a formal category name. Errors with the same category name are shown in that category. If in addition a category description is specified (see \category_description), this description will be displayed as the title. + """ + cell_name: str + r""" + Getter: + @brief Gets the cell name. + See \cell_name= for details about this attribute. + Setter: + @brief Sets the cell name. + The cell (or circuit) name specifies the cell or circuit the log entry is related to. If the log entry is an error or warning generated during device extraction, the cell name is the circuit the device should have appeared in. + """ + geometry: DPolygon + r""" + Getter: + @brief Gets the geometry. + See \geometry= for more details. + Setter: + @brief Sets the geometry. + The geometry is optional. If given, a marker may be shown when selecting this error. + """ + message: str + r""" + Getter: + @brief Gets the message text. + + Setter: + @brief Sets the message text. + """ + severity: Severity + r""" + Getter: + @brief Gets the severity attribute. + + Setter: + @brief Sets the severity attribute. + """ + @classmethod + def new(cls) -> LogEntryData: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LogEntryData: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> LogEntryData: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def __repr__(self, with_geometry: Optional[bool] = ...) -> str: + r""" + @brief Gets the string representation of this error or warning. + This method has been introduced in version 0.28.13. + """ + def __str__(self, with_geometry: Optional[bool] = ...) -> str: + r""" + @brief Gets the string representation of this error or warning. + This method has been introduced in version 0.28.13. + """ + def _create(self) -> None: + r""" + @brief 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. + """ + def _destroy(self) -> None: + r""" + @brief 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. + """ + def _destroyed(self) -> bool: + r""" + @brief 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. + """ + def _is_const_object(self) -> bool: + r""" + @brief 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. + """ + def _manage(self) -> None: + r""" + @brief 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. + """ + def _unmanage(self) -> None: + r""" + @brief 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. + """ + def assign(self, other: LogEntryData) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief 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. + """ + def destroy(self) -> None: + r""" + @brief 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. + """ + def destroyed(self) -> bool: + r""" + @brief 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. + """ + def dup(self) -> LogEntryData: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @brief 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. + """ + def to_s(self, with_geometry: Optional[bool] = ...) -> str: + r""" + @brief Gets the string representation of this error or warning. + This method has been introduced in version 0.28.13. + """ + class Manager: r""" @brief A transaction manager class @@ -32865,14 +33045,14 @@ class NetPinRef: @overload def net(self) -> Net: r""" - @brief Gets the net this pin reference is attached to (non-const version). - - This constness variant has been introduced in version 0.26.8 + @brief Gets the net this pin reference is attached to. """ @overload def net(self) -> Net: r""" - @brief Gets the net this pin reference is attached to. + @brief Gets the net this pin reference is attached to (non-const version). + + This constness variant has been introduced in version 0.26.8 """ def pin(self) -> Pin: r""" @@ -33123,14 +33303,14 @@ class NetTerminalRef: @overload def net(self) -> Net: r""" - @brief Gets the net this terminal reference is attached to (non-const version). - - This constness variant has been introduced in version 0.26.8 + @brief Gets the net this terminal reference is attached to. """ @overload def net(self) -> Net: r""" - @brief Gets the net this terminal reference is attached to. + @brief Gets the net this terminal reference is attached to (non-const version). + + This constness variant has been introduced in version 0.26.8 """ def terminal_def(self) -> DeviceTerminalDefinition: r""" @@ -33893,16 +34073,16 @@ class Netlist: @overload def circuit_by_cell_index(self, cell_index: int) -> Circuit: r""" - @brief Gets the circuit object for a given cell index (const version). + @brief Gets the circuit object for a given cell index. If the cell index is not valid or no circuit is registered with this index, nil is returned. - - This constness variant has been introduced in version 0.26.8. """ @overload def circuit_by_cell_index(self, cell_index: int) -> Circuit: r""" - @brief Gets the circuit object for a given cell index. + @brief Gets the circuit object for a given cell index (const version). If the cell index is not valid or no circuit is registered with this index, nil is returned. + + This constness variant has been introduced in version 0.26.8. """ @overload def circuit_by_name(self, name: str) -> Circuit: @@ -33921,19 +34101,19 @@ class Netlist: @overload def circuits_by_name(self, name_pattern: str) -> List[Circuit]: r""" - @brief Gets the circuit objects for a given name filter (const version). + @brief Gets the circuit objects for a given name filter. The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. - - This constness variant has been introduced in version 0.26.8. + This method has been introduced in version 0.26.4. """ @overload def circuits_by_name(self, name_pattern: str) -> List[Circuit]: r""" - @brief Gets the circuit objects for a given name filter. + @brief Gets the circuit objects for a given name filter (const version). The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. - This method has been introduced in version 0.26.4. + + This constness variant has been introduced in version 0.26.8. """ def combine_devices(self) -> None: r""" @@ -33991,30 +34171,30 @@ class Netlist: @overload def each_circuit_bottom_up(self) -> Iterator[Circuit]: r""" - @brief Iterates over the circuits bottom-up + @brief Iterates over the circuits bottom-up (const version) Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. + + This constness variant has been introduced in version 0.26.8. """ @overload def each_circuit_bottom_up(self) -> Iterator[Circuit]: r""" - @brief Iterates over the circuits bottom-up (const version) + @brief Iterates over the circuits bottom-up Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. - - This constness variant has been introduced in version 0.26.8. """ @overload def each_circuit_top_down(self) -> Iterator[Circuit]: r""" - @brief Iterates over the circuits top-down (const version) + @brief Iterates over the circuits top-down Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. - - This constness variant has been introduced in version 0.26.8. """ @overload def each_circuit_top_down(self) -> Iterator[Circuit]: r""" - @brief Iterates over the circuits top-down + @brief Iterates over the circuits top-down (const version) Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. + + This constness variant has been introduced in version 0.26.8. """ @overload def each_device_class(self) -> Iterator[DeviceClass]: @@ -34922,147 +35102,6 @@ class NetlistCrossReference(NetlistCompareLogger): This method has been introduced in version 0.27. """ -class NetlistDeviceExtractorError: - r""" - @brief An error that occurred during device extraction - The device extractor will keep errors that occurred during extraction of the devices. It does not by using this error class. - - An error is basically described by the cell/circuit it occurs in and the message. In addition, a geometry may be attached forming a marker that can be shown when the error is selected. The geometry is given as a \DPolygon object. If no geometry is specified, this polygon is empty. - - For categorization of the errors, a category name and description may be specified. If given, the errors will be shown in the specified category. The category description is optional. - - This class has been introduced in version 0.26. - """ - category_description: str - r""" - Getter: - @brief Gets the category description. - See \category_name= for details about categories. - Setter: - @brief Sets the category description. - See \category_name= for details about categories. - """ - category_name: str - r""" - Getter: - @brief Gets the category name. - See \category_name= for more details. - Setter: - @brief Sets the category name. - The category name is optional. If given, it specifies a formal category name. Errors with the same category name are shown in that category. If in addition a category description is specified (see \category_description), this description will be displayed as the title of. - """ - cell_name: str - r""" - Getter: - @brief Gets the cell name. - See \cell_name= for details about this attribute. - Setter: - @brief Sets the cell name. - The cell name is the name of the layout cell which was treated. This is also the name of the circuit the device should have appeared in (it may be dropped because of this error). If netlist hierarchy manipulation happens however, the circuit may not exist any longer or may be renamed. - """ - geometry: DPolygon - r""" - Getter: - @brief Gets the geometry. - See \geometry= for more details. - Setter: - @brief Sets the geometry. - The geometry is optional. If given, a marker will be shown when selecting this error. - """ - message: str - r""" - Getter: - @brief Gets the message text. - - Setter: - @brief Sets the message text. - """ - @classmethod - def new(cls) -> NetlistDeviceExtractorError: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetlistDeviceExtractorError: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetlistDeviceExtractorError: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @brief 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. - """ - def _destroy(self) -> None: - r""" - @brief 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. - """ - def _destroyed(self) -> bool: - r""" - @brief 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. - """ - def _is_const_object(self) -> bool: - r""" - @brief 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. - """ - def _manage(self) -> None: - r""" - @brief 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. - """ - def _unmanage(self) -> None: - r""" - @brief 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. - """ - def assign(self, other: NetlistDeviceExtractorError) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @brief 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. - """ - def destroy(self) -> None: - r""" - @brief 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. - """ - def destroyed(self) -> bool: - r""" - @brief 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. - """ - def dup(self) -> NetlistDeviceExtractorError: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @brief 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. - """ - class NetlistDeviceExtractorLayerDefinition: r""" @brief Describes a layer used in the device extraction @@ -36576,12 +36615,12 @@ class PCellParameterState: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: @@ -39198,12 +39237,12 @@ class PreferredOrientation: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __init__(self, i: int) -> None: @@ -39228,12 +39267,12 @@ class PreferredOrientation: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -39383,12 +39422,12 @@ class PropertyConstraint: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __init__(self, i: int) -> None: @@ -39413,12 +39452,12 @@ class PropertyConstraint: @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer for inequality + @brief Compares two enums for inequality """ @overload def __ne__(self, other: object) -> bool: r""" - @brief Compares two enums for inequality + @brief Compares an enum with an integer for inequality """ def __repr__(self) -> str: r""" @@ -40851,12 +40890,12 @@ class Region(ShapeCollection): @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: @@ -44541,6 +44580,177 @@ class SaveLayoutOptions: This method has been introduced in version 0.22. Beginning with version 0.23, this method always returns true, since the only consumer for the return value, Layout#write, now ignores that parameter and automatically determines the compression mode from the file name. """ +class Severity: + r""" + @brief This enum specifies the severity level for log entries. + + This enum was introduced in version 0.28.13. + """ + Error: ClassVar[Severity] + r""" + @brief Specifies error severity (preferred action is stop) + """ + Info: ClassVar[Severity] + r""" + @brief Specifies info severity (print if requested, otherwise silent) + """ + NoSeverity: ClassVar[Severity] + r""" + @brief Specifies no particular severity (default) + """ + Warning: ClassVar[Severity] + r""" + @brief Specifies warning severity (log with high priority, but do not stop) + """ + @overload + @classmethod + def new(cls, i: int) -> Severity: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> Severity: + r""" + @brief Creates an enum from a string value + """ + def __copy__(self) -> Severity: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Severity: + r""" + @brief Creates a copy of self + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: Severity) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def _create(self) -> None: + r""" + @brief 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. + """ + def _destroy(self) -> None: + r""" + @brief 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. + """ + def _destroyed(self) -> bool: + r""" + @brief 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. + """ + def _is_const_object(self) -> bool: + r""" + @brief 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. + """ + def _manage(self) -> None: + r""" + @brief 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. + """ + def _unmanage(self) -> None: + r""" + @brief 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. + """ + def assign(self, other: Severity) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @brief 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. + """ + def destroy(self) -> None: + r""" + @brief 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. + """ + def destroyed(self) -> bool: + r""" + @brief 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. + """ + def dup(self) -> Severity: + r""" + @brief Creates a copy of self + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def is_const_object(self) -> bool: + r""" + @brief 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. + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + class Shape: r""" @brief An object representing a shape in the layout database @@ -44967,8 +45177,9 @@ class Shape: This method has been introduced in version 0.26. Setter: - @brief Replaces the shape by the given edge pair (in micrometer units) - This method replaces the shape by the given edge pair, like \edge_pair= with a \EdgePair argument does. This version translates the edge pair from micrometer units to database units internally. + @brief Replaces the shape by the given edge pair + This method replaces the shape by the given edge pair. This method can only be called for editable layouts. It does not change the user properties of the shape. + Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. This method has been introduced in version 0.26. """ @@ -45174,10 +45385,11 @@ class Shape: Starting with version 0.23, this method returns nil, if the shape does not represent a text. Setter: - @brief Replaces the shape by the given text (in micrometer units) - This method replaces the shape by the given text, like \text= with a \Text argument does. This version translates the text from micrometer units to database units internally. + @brief Replaces the shape by the given text object + This method replaces the shape by the given text object. This method can only be called for editable layouts. It does not change the user properties of the shape. + Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. - This method has been introduced in version 0.25. + This method has been introduced in version 0.22. """ text_dpos: DVector r""" @@ -45315,10 +45527,10 @@ class Shape: Applies to texts only. Will throw an exception if the object is not a text. Setter: - @brief Sets the text transformation in micrometer units + @brief Sets the text transformation Applies to texts only. Will throw an exception if the object is not a text. - This method has been introduced in version 0.25. + This method has been introduced in version 0.23. """ text_valign: int r""" @@ -48368,6 +48580,12 @@ class SubCircuit(NetlistObject): Usually it's not required to call this method. It has been introduced in version 0.24. """ @overload + def circuit(self) -> Circuit: + r""" + @brief Gets the circuit the subcircuit lives in. + This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. + """ + @overload def circuit(self) -> Circuit: r""" @brief Gets the circuit the subcircuit lives in (non-const version). @@ -48376,10 +48594,9 @@ class SubCircuit(NetlistObject): This constness variant has been introduced in version 0.26.8 """ @overload - def circuit(self) -> Circuit: + def circuit_ref(self) -> Circuit: r""" - @brief Gets the circuit the subcircuit lives in. - This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. + @brief Gets the circuit referenced by the subcircuit. """ @overload def circuit_ref(self) -> Circuit: @@ -48390,11 +48607,6 @@ class SubCircuit(NetlistObject): This constness variant has been introduced in version 0.26.8 """ @overload - def circuit_ref(self) -> Circuit: - r""" - @brief Gets the circuit referenced by the subcircuit. - """ - @overload def connect_pin(self, pin: Pin, net: Net) -> None: r""" @brief Connects the given pin to the specified net. @@ -48917,7 +49129,8 @@ class Text: Setter: @brief Sets the horizontal alignment - This is the version accepting integer values. It's provided for backward compatibility. + This property specifies how the text is aligned relative to the anchor point. + This property has been introduced in version 0.22 and extended to enums in 0.28. """ size: int r""" @@ -48953,8 +49166,7 @@ class Text: Setter: @brief Sets the vertical alignment - This property specifies how the text is aligned relative to the anchor point. - This property has been introduced in version 0.22 and extended to enums in 0.28. + This is the version accepting integer values. It's provided for backward compatibility. """ x: int r""" diff --git a/src/pymod/distutils_src/klayout/laycore.pyi b/src/pymod/distutils_src/klayout/laycore.pyi index ea74542096..d3dad085ce 100644 --- a/src/pymod/distutils_src/klayout/laycore.pyi +++ b/src/pymod/distutils_src/klayout/laycore.pyi @@ -4987,12 +4987,12 @@ class LayoutViewBase: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: