From c160f7f43fdc6eb597678ffe5138d8cb4de0931d Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 6 Jan 2021 02:20:36 +0100 Subject: [PATCH] Documentation updates --- scripts/extract_doc.rb | 20 +- .../drc/built-in-macros/_drc_complex_ops.rb | 40 +- .../built-in-macros/_drc_cop_integration.rb | 84 ++- src/lay/lay/doc/about/drc_ref.xml | 1 + src/lay/lay/doc/about/drc_ref_drc.xml | 664 ++++++++++++++++++ src/lay/lay/doc/about/drc_ref_global.xml | 572 ++++++++++++++- src/lay/lay/doc/about/drc_ref_layer.xml | 77 +- src/lay/lay/doc/about/index.xml | 6 - src/lay/lay/layHelpResources.qrc | 1 + 9 files changed, 1388 insertions(+), 77 deletions(-) create mode 100644 src/lay/lay/doc/about/drc_ref_drc.xml diff --git a/scripts/extract_doc.rb b/scripts/extract_doc.rb index eb9a149d8..1d659f503 100755 --- a/scripts/extract_doc.rb +++ b/scripts/extract_doc.rb @@ -127,6 +127,14 @@ class Scope < DocItem @items = {} end + def merge(other) + if !self.brief + self.brief = other.brief + self.doc = other.doc + self.synopsis = other.synopsis + end + end + def add_doc_item(mod, block) item = DocItem::new(mod, block) @items[item.name] = item @@ -136,7 +144,7 @@ class Scope < DocItem def produce_doc - doc = < @@ -197,8 +205,14 @@ class Collector # is a scope block @scopes ||= {} - @current_scope = Scope::new(@mod, block) - @scopes[@current_scope.name] = @current_scope + scope = Scope::new(@mod, block) + if ! @scopes[scope.name] + @current_scope = scope + @scopes[scope.name] = scope + else + @current_scope = @scopes[scope.name] + @current_scope.merge(scope) + end else @current_scope && @current_scope.add_doc_item(@mod, block) diff --git a/src/drc/drc/built-in-macros/_drc_complex_ops.rb b/src/drc/drc/built-in-macros/_drc_complex_ops.rb index df3e9c9f9..8569143f0 100644 --- a/src/drc/drc/built-in-macros/_drc_complex_ops.rb +++ b/src/drc/drc/built-in-macros/_drc_complex_ops.rb @@ -175,7 +175,7 @@ CODE # It is applicable on polygon expressions. The result will be the input # polygons if the area condition is met. # - # See \drc for more details about comparison specs. + # See \Layer#drc for more details about comparison specs. # # The following example will select all polygons with an area less than 2.0 square micrometers: # @@ -184,7 +184,7 @@ CODE # out = in.drc(primary.area < 2.0) # equivalent # @/code # - # The area method is available as a plain function or as a method on \DRC expressions. + # The area method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.area". def area @@ -200,7 +200,7 @@ CODE # count. "count" is used as a method on a expression. It will evaluate the expression locally # and return the original result if the shape count in the result is matching the condition. # - # See \drc for more details about comparison specs. + # See \Layer#drc for more details about comparison specs. # # Note that the expression is evaluated locally: for each primary shape, the expression is # evaluated and the count of the resulting edge, edge pair or polygon set is taken. @@ -229,7 +229,7 @@ CODE # It is applicable on polygon expressions. The result will be the input # polygons if the perimeter condition is met. # - # See \drc for more details about comparison specs. + # See \Layer#drc for more details about comparison specs. # # The following example will select all polygons with a perimeter less than 10 micrometers: # @@ -238,7 +238,7 @@ CODE # out = in.drc(primary.perimeter < 10.0) # equivalent # @/code # - # The perimeter method is available as a plain function or as a method on \DRC expressions. + # The perimeter method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.perimeter". def perimeter @@ -254,7 +254,7 @@ CODE # It is applicable on polygon expressions. The result will be the input # polygons if the bounding box condition is met. # - # See \drc for more details about comparison specs. + # See \Layer#drc for more details about comparison specs. # # The following example will select all polygons whose bounding box smaller dimension is larger # than 200 nm: @@ -264,7 +264,7 @@ CODE # out = in.drc(primary.bbox_min > 200.nm) # equivalent # @/code # - # The "bbox_min" method is available as a plain function or as a method on \DRC expressions. + # The "bbox_min" method is available as a plain function or as a method on \DRC## expressions. # The plain function is equivalent to "primary.bbox_min". def bbox_min @@ -279,7 +279,7 @@ CODE # This operation acts similar to \DRC#bbox_min, but takes the larger dimension of the shape's # bounding box. # - # The "bbox_max" method is available as a plain function or as a method on \DRC expressions. + # The "bbox_max" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.bbox_max". def bbox_max @@ -297,7 +297,7 @@ CODE # hierarchical contexts: cells rotated by 90 degree have to be treated differently from # ones not rotated. This usually results in a larger computation effort and larger result files. # - # The "bbox_width" method is available as a plain function or as a method on \DRC expressions. + # The "bbox_width" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.bbox_width". def bbox_width @@ -315,7 +315,7 @@ CODE # hierarchical contexts: cells rotated by 90 degree have to be treated differently from # ones not rotated. This usually results in a larger computation effort and larger result files. # - # The "bbox_height" method is available as a plain function or as a method on \DRC expressions. + # The "bbox_height" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.bbox_height". def bbox_height @@ -338,7 +338,7 @@ CODE # out = in.drc(primary.length >= 1.um) # equivalent # @/code # - # The "length" method is available as a plain function or as a method on \DRC expressions. + # The "length" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.length". def length @@ -373,7 +373,7 @@ CODE # a performance penalty in hierarchical mode. If possible, consider using \DRC#rectilinear for # example to detect shapes with non-manhattan geometry instead of using angle checks. # - # The "angle" method is available as a plain function or as a method on \DRC expressions. + # The "angle" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.angle". def angle @@ -388,7 +388,7 @@ CODE # This operation acts on polygons and applies corner rounding the the given inner # and outer corner radius and the number of points n per full circle. See \Layer#rounded_corners for more details. # - # The "rounded_corners" method is available as a plain function or as a method on \DRC expressions. + # The "rounded_corners" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.rounded_corners". def rounded_corners(inner, outer, n) @@ -405,7 +405,7 @@ CODE # # This operation acts on polygons and applies polygon smoothing with the tolerance d. See \Layer#smoothed for more details. # - # The "smoothed" method is available as a plain function or as a method on \DRC expressions. + # The "smoothed" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.smoothed". def smoothed(d) @@ -444,7 +444,7 @@ CODE # out = in.drc(primary.corners < 0) # equivalent # @/code # - # The "corners" method is available as a plain function or as a method on \DRC expressions. + # The "corners" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.corners". def corners(as_dots = DRCAsDots::new(false)) @@ -464,7 +464,7 @@ CODE # @synopsis expression.middle([ options ]) # # The middle operation acts on polygons and has the same effect than \Layer#middle. - # It takes the same arguments. It is available as a method on \DRC expressions or + # It takes the same arguments. It is available as a method on \DRC# expressions or # as plain function, in which case it acts on the primary shapes. # %DRC% @@ -473,7 +473,7 @@ CODE # @synopsis expression.extent_refs([ options ]) # # The extent_refs operation acts on polygons and has the same effect than \Layer#extent_refs. - # It takes the same arguments. It is available as a method on \DRC expressions or + # It takes the same arguments. It is available as a method on \DRC# expressions or # as plain function, in which case it acts on the primary shapes. %w(middle extent_refs).each do |f| @@ -677,7 +677,7 @@ CODE # than the given number of polygons overlap. As the primary input is merged already, # it will always contribute as one. # - # The "merged" method is available as a plain function or as a method on \DRC expressions. + # The "merged" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.merged". def merged(*args) @@ -710,7 +710,7 @@ CODE # This method provides the same functionality as \Layer#sized and takes the same # arguments. It acts on polygon expressions. # - # The "sized" method is available as a plain function or as a method on \DRC expressions. + # The "sized" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.sized". def sized(*args) @@ -757,7 +757,7 @@ CODE # arguments. It returns the bounding boxes of the input objects. It acts on edge # edge pair and polygon expressions. # - # The "extents" method is available as a plain function or as a method on \DRC expressions. + # The "extents" method is available as a plain function or as a method on \DRC# expressions. # The plain function is equivalent to "primary.extents". def extents(e = 0) diff --git a/src/drc/drc/built-in-macros/_drc_cop_integration.rb b/src/drc/drc/built-in-macros/_drc_cop_integration.rb index 90123d186..2a76fa4df 100644 --- a/src/drc/drc/built-in-macros/_drc_cop_integration.rb +++ b/src/drc/drc/built-in-macros/_drc_cop_integration.rb @@ -2,11 +2,15 @@ module DRC + # %DRC% + # @scope + # @name Layer + class DRCLayer # %DRC% # @name drc - # @brief Provides a generic DRC function for use with \DRC expressions + # @brief Provides a generic DRC function for use with \DRC# expressions # @synopsis layer.drc(expression) # # This method implement the universal DRC which offers enhanced abilities, @@ -55,19 +59,19 @@ module DRC # @/code # # Another example computes a boolean AND between two layers before selecting - # the ones with an area larger than 1 square micrometer: + # the result polygons with an area larger than 1 square micrometer: # # @code # other = ... another layer .. # out = in.drc((primary & other).area > 1.0) # @/code # - # The last example shows how the "drc" operation can improve performance: as the + # This example demonstrates how the "drc" operation can improve performance: as the # boolean operation is computed locally and the result is discarded when no longer required, # less shapes need to be stored hence reducing the memory overhead and CPU time required # to manage these shapes. # - # For more details about the expression see the \DRC class documentation. + # For more details about the expression see the \DRC# class documentation. def drc(op) @engine._context("drc") do @@ -79,6 +83,10 @@ module DRC end + # %DRC% + # @scope + # @name global + class DRCEngine # %DRC% @@ -94,7 +102,7 @@ module DRC # out = in.drc(case(c1, r1, c2, r2, ..., cn, rn, rdef) # @/code # - # This function will evaluate c1 which is a universal DRC expression (see \drc). + # This function will evaluate c1 which is a universal DRC expression (see \Layer#drc). # If the result is not empty, "case" will evaluate and return r1. Otherwise it # will continue with c2 and the result of this expression is not empty it will # return r2. Otherwise it will continue with c3/r3 etc. @@ -139,7 +147,7 @@ module DRC # @brief Provides secondary input for the "drc" universal DRC function # @synopsis secondary(layer) # - # To supply additional input for the universal DRC expressions (see \drc), use + # To supply additional input for the universal DRC expressions (see \Layer#drc), use # "secondary" with a layer argument. This example provides a boolean AND # between l1 and l2: # @@ -168,7 +176,7 @@ module DRC # @brief Represents the primary input of the universal DRC function # @synopsis primary # - # The primary input of the universal DRC function is the layer the \drc function + # The primary input of the universal DRC function is the layer the \Layer#drc function # is called on. def primary @@ -182,7 +190,7 @@ module DRC # @brief Represents all other polygons from primary except the current one # @synopsis foreign # - # The primary input of the universal DRC function is the layer the \drc function + # The primary input of the universal DRC function is the layer the \Layer#drc function # is called on. This operation represents all "other" primary polygons while # \primary represents the current polygon. # @@ -218,7 +226,7 @@ module DRC # out = in.drc(if_all(area > 0.5, rectangle)) # @/code # - # The condition expressions can be of any type (edges, edge pairs and polygons). + # The condition expressions may be of any type (edges, edge pairs and polygons). # %DRC% # @name if_any @@ -270,10 +278,10 @@ CODE # @brief Selects primary shapes based on their bounding box height # @synopsis bbox_height (in condition) # - # This method creates a universal DRC expression (see \drc) to select primary shapes whose - # bounding box height satisfies the condition. Conditions can be written as arithmetic comparisons + # This method creates a universal DRC expression (see \Layer#drc) to select primary shapes whose + # bounding box height satisfies the condition. Conditions may be written as arithmetic comparisons # against numeric values. For example, "bbox_height < 2.0" will select all primary shapes whose - # bounding box height is less than 2 micrometers. See \drc for more details about comparison + # bounding box height is less than 2 micrometers. See \Layer#drc for more details about comparison # specs. Plain "bbox_min" is equivalent to "primary.bbox_min" - i.e. it is used on the primary # shape. Also see \DRC#bbox_min. @@ -282,21 +290,21 @@ CODE # @brief Selects primary shapes based on their bounding box width # @synopsis bbox_max (in condition) # - # See \drc, \bbox_height and \DRC#bbox_height for more details. + # See \Layer#drc, \bbox_height and \DRC#bbox_height for more details. # %DRC% # @name bbox_max # @brief Selects primary shapes based on their bounding box height or width, whichever is larger # @synopsis bbox_max (in condition) # - # See \drc, \bbox_max and \DRC#bbox_max for more details. + # See \Layer#drc, \bbox_max and \DRC#bbox_max for more details. # %DRC% # @name bbox_min # @brief Selects primary shapes based on their bounding box height or width, whichever is smaller # @synopsis bbox_max (in condition) # - # See \drc, \bbox_min and \DRC#bbox_min for more details. + # See \Layer#drc, \bbox_min and \DRC#bbox_min for more details. %w( bbox_height @@ -322,7 +330,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.area" (see \Layer#area). Without a layer # argument, "area" represents an area filter for primary shapes in - # \DRC expressions (see \drc and \DRC#area for more details). + # \DRC# expressions (see \Layer#drc and \DRC#area for more details). # %DRC% # @name hulls @@ -333,7 +341,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.hulls" (see \Layer#hulls). Without a layer # argument, "hulls" represents a hull contour extractor for primary shapes in - # \DRC expressions (see \drc and \DRC#hulls for more details). + # \DRC# expressions (see \Layer#drc and \DRC#hulls for more details). # %DRC% # @name holes @@ -344,7 +352,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.holes" (see \Layer#hulls). Without a layer # argument, "holes" represents a hole extractor for primary shapes in - # \DRC expressions (see \drc and \DRC#hulls for more details). + # \DRC# expressions (see \Layer#drc and \DRC#hulls for more details). # %DRC% # @name odd_polygons @@ -355,7 +363,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.odd_polygons" (see \Layer#odd_polygons). Without a layer # argument, "odd_polygons" represents an odd polygon filter for primary shapes in - # \DRC expressions (see \drc and \DRC#odd_polygons for more details). + # \DRC# expressions (see \Layer#drc and \DRC#odd_polygons for more details). # %DRC% # @name perimeter @@ -366,7 +374,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.perimeter" (see \Layer#perimeter). Without a layer # argument, "perimeter" represents a perimeter filter for primary shapes in - # \DRC expressions (see \drc and \DRC#perimeter for more details). + # \DRC# expressions (see \Layer#drc and \DRC#perimeter for more details). # %DRC% # @name rectangles @@ -377,7 +385,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.rectangles" (see \Layer#rectangles). Without a layer # argument, "rectangles" represents the rectangles filter for primary shapes in - # \DRC expressions (see \drc and \DRC#rectangles for more details). + # \DRC# expressions (see \Layer#drc and \DRC#rectangles for more details). # %DRC% # @name rectilinear @@ -388,7 +396,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.rectilinear" (see \Layer#rectilinear). Without a layer # argument, "rectilinear" represents the rectilinear polygons filter for primary shapes in - # \DRC expressions (see \drc and \DRC#rectilinear for more details). + # \DRC# expressions (see \Layer#drc and \DRC#rectilinear for more details). %w( area @@ -416,7 +424,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.corners" (see \Layer#corners). Without a layer # argument, "corners" represents the corner generator/filter in primary shapes for - # \DRC expressions (see \drc and \DRC#corners for more details). + # \DRC# expressions (see \Layer#drc and \DRC#corners for more details). def _cop_corners(as_dots = DRCAsDots::new(false)) # NOTE: this method is a fallback for the respective global ones which route to DRCLayer or here. @@ -432,7 +440,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.extent_refs" (see \Layer#extent_refs). Without a layer # argument, "extent_refs" represents the partial extents extractor on primary shapes within - # \DRC expressions (see \drc and \DRC#extent_refs for more details). + # \DRC# expressions (see \Layer#drc and \DRC#extent_refs for more details). # %DRC% # @name extents @@ -443,7 +451,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.extents" (see \Layer#extents). Without a layer # argument, "extents" represents the extents generator on primary shapes within - # \DRC expressions (see \drc and \DRC#extents for more details). + # \DRC# expressions (see \Layer#drc and \DRC#extents for more details). # %DRC% # @name middle @@ -454,7 +462,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.middle" (see \Layer#middle). Without a layer # argument, "middle" represents the bounding box center marker generator on primary shapes within - # \DRC expressions (see \drc and \DRC#middle for more details). + # \DRC# expressions (see \Layer#drc and \DRC#middle for more details). # %DRC% # @name rounded_corners @@ -465,7 +473,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.rounded_corners" (see \Layer#rounded_corners). Without a layer # argument, "rounded_corners" represents the corner rounding algorithm on primary shapes within - # \DRC expressions (see \drc and \DRC#rounded_corners for more details). + # \DRC# expressions (see \Layer#drc and \DRC#rounded_corners for more details). # %DRC% # @name sized @@ -478,7 +486,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.sized" (see \Layer#sized). Without a layer # argument, "sized" represents the polygon sizer on primary shapes within - # \DRC expressions (see \drc and \DRC#sized for more details). + # \DRC# expressions (see \Layer#drc and \DRC#sized for more details). # %DRC% # @name smoothed @@ -489,7 +497,7 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.smoothed" (see \Layer#smoothed). Without a layer # argument, "smoothed" represents the polygon smoother on primary shapes within - # \DRC expressions (see \drc and \DRC#smoothed for more details). + # \DRC# expressions (see \Layer#drc and \DRC#smoothed for more details). %w( extent_refs @@ -519,7 +527,7 @@ CODE # Without a layer argument, this method represents the selector of primary shapes # which entirely cover shapes from the other layer. This version can be put into # a condition indicating how many shapes of the other layer need to be covered. - # Use this variant within \DRC expressions (also see \drc). + # Use this variant within \DRC# expressions (also see \Layer#drc). # # For example, the following statement selects all input shapes which entirely # cover shapes from the "other" layer: @@ -567,7 +575,7 @@ CODE # # Without a layer argument, this method represents the selector of primary shapes # which are entirely inside shapes from the other layer. - # Use this variant within \DRC expressions (also see \drc). + # Use this variant within \DRC# expressions (also see \Layer#drc). # %DRC% # @name outside @@ -580,7 +588,7 @@ CODE # # Without a layer argument, this method represents the selector of primary shapes # which are entirely outside shapes from the other layer. - # Use this variant within \DRC expressions (also see \drc). + # Use this variant within \DRC# expressions (also see \Layer#drc). %w( covering @@ -606,13 +614,13 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.enclosing" (see \Layer#enclosing). # - # The version without the first layer is intended for use within \DRC expressions - # together with the \drc method. In this case, this function needs to be + # The version without the first layer is intended for use within \DRC# expressions + # together with the \Layer#drc method. In this case, this function needs to be # put into a condition to specify the check constraints. The other options # of \Layer#enclosing (e.g. metrics, projection constraints, angle limits etc.) # apply to this version too. # - # The conditions can involve an upper and lower limit. The following examples + # The conditions may involve an upper and lower limit. The following examples # illustrate the use of this function with conditions: # # @code @@ -656,13 +664,13 @@ CODE # This function can be used with a layer argument in which case it # is equivalent to "layer.width" (see \Layer#width). # - # The version without a layer it intended for use within \DRC expressions - # together with the \drc method. In this case, this function needs to be + # The version without a layer is intended for use within \DRC# expressions + # together with the \Layer#drc method. In this case, this function needs to be # put into a condition to specify the check constraints. The other options # of \Layer#width (e.g. metrics, projection constraints, angle limits etc.) # apply to this version too. # - # The conditions can involve an upper and lower limit. The following examples + # The conditions may involve an upper and lower limit. The following examples # illustrate the use of this function with conditions: # # @code diff --git a/src/lay/lay/doc/about/drc_ref.xml b/src/lay/lay/doc/about/drc_ref.xml index 72a5658de..b4a6a02d6 100644 --- a/src/lay/lay/doc/about/drc_ref.xml +++ b/src/lay/lay/doc/about/drc_ref.xml @@ -8,6 +8,7 @@ DRC Reference + diff --git a/src/lay/lay/doc/about/drc_ref_drc.xml b/src/lay/lay/doc/about/drc_ref_drc.xml new file mode 100644 index 000000000..6b0b4a6df --- /dev/null +++ b/src/lay/lay/doc/about/drc_ref_drc.xml @@ -0,0 +1,664 @@ + + + + + + + +DRC Reference: DRC expressions + +

+DRC expression objects represent abstract recipes for the Layer#drc universal DRC function. +For example, when using a universal DRC expression like this: +

+

+out = in.drc(width < 2.0)
+
+

+"width < 2.0" forms a DRC expression object. DRC expression objects have methods which +manipulate or evaluate the results of this expression. In addition, DRC expressions have a +result type, which is either polygon, edge or edge pair. The result type is defined by the +expression generating it. In the example above, "width < 2.0" is a DRC width check which +renders edge pairs. To obtain polygons from these edge pairs, use the "polygons" method: +

+

+out = in.drc((width < 2.0).polygons)
+
+

+The following documentation will list the methods available for DRC expression objects. +

+ +

"!" - Logical not

+ +

Usage:

+
    +
  • ! expression
  • +
+

+This operator will evaluate the expression after. If this expression renders +an empty result, the operator will return the primary shape. Otherwise it will +return an empty result. +

+This operator can be used together with predicates such a "rectangles" to +invert their meaning. For example, this code selects all primary shapes which +are not rectangles: +

+

+out = in.drc(! rectangles)
+out = in.drc(! primary.rectangles)   # equivalent
+
+

+

"&" - Boolean AND between the results of two expressions

+ +

Usage:

+
    +
  • expression & expression
  • +
+

+The & operator will compute the boolean AND between the results +of two expressions. The expression types need to be edge or polygon. +

+The following example computes the partial edges where width is less than +0.3 micrometers and space is less than 0.2 micrometers: +

+

+out = in.drc((width < 0.3).edges & (space < 0.2).edges)
+
+

+

"+" - Boolean OR between the results of two expressions

+ +

Usage:

+
    +
  • expression + expression
  • +
+

+The + operator will join the results of two expressions. +

+

"-" - Boolean NOT between the results of two expressions

+ +

Usage:

+
    +
  • expression - expression
  • +
+

+The - operator will compute the difference between the results +of two expressions. The NOT operation is defined for polygons, +edges and polygons subtracted from edges (first argument edge, +second argument polygon). +

+The following example will produce edge markers where the +width of is less then 0.3 micron but not inside polygons on +the "waive" layer: +

+

+out = in.drc((width < 0.3).edges - secondary(waive))
+
+

+

"^" - Boolean XOR between the results of two expressions

+ +

Usage:

+
    +
  • expression - expression
  • +
+

+The ^ operator will compute the XOR (symmetric difference) between the results +of two expressions. The XOR operation is defined for polygons and edges. +Both expressions must be of the same type. +

+

"angle" - Selects edges based on their angle

+ +

Usage:

+
    +
  • expression.angle (in condition)
  • +
+

+This operation selects edges by their angle, measured against the horizontal +axis in the mathematical sense. +

+For this measurement edges are considered without their direction and straight lines. +A horizontal edge has an angle of zero degree. A vertical one has +an angle of 90 degee. The angle range is from -90 (exclusive) to 90 degree (inclusive). +

+If the input shapes are not polygons or edge pairs, they are converted to edges +before the angle test is made. +

+For example, the following code selects all edges from the primary shape which are 45 degree +(up) or 135 degree (down). The "+" will join the results: +

+

+out = in.drc((angle == 45) + (angle == 135)) 
+out = in.drc((primary.angle == 45) + (primary.angle == 135))    # equivalent
+
+

+Note that angle checks usually imply the need to rotation variant formation as cells which +are placed unrotated and rotated by 90 degree cannot be considered identical. This imposes +a performance penalty in hierarchical mode. If possible, consider using DRC#rectilinear for +example to detect shapes with non-manhattan geometry instead of using angle checks. +

+The "angle" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.angle". +

+

"area" - Selects the primary shape if the area is meeting the condition

+ +

Usage:

+
    +
  • expression.area (in condition)
  • +
+

+This operation is used in conditions to select shapes based on their area. +It is applicable on polygon expressions. The result will be the input +polygons if the area condition is met. +

+See Layer#drc for more details about comparison specs. +

+The following example will select all polygons with an area less than 2.0 square micrometers: +

+

+out = in.drc(area < 2.0)
+out = in.drc(primary.area < 2.0)   # equivalent
+
+

+The area method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.area". +

+

"bbox_height" - Selects the primary shape if its bounding box height is meeting the condition

+ +

Usage:

+
    +
  • expression.bbox_height (in condition)
  • +
+

+This operation acts similar to DRC#bbox_min, but takes the height of the shape's +bounding box. In general, it's more advisable to use DRC#bbox_min or DRC#bbox_max +because bbox_height implies a certain orientation. This can imply variant formation in +hierarchical contexts: cells rotated by 90 degree have to be treated differently from +ones not rotated. This usually results in a larger computation effort and larger result files. +

+The "bbox_height" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.bbox_height". +

+

"bbox_max" - Selects the primary shape if its bounding box larger dimension is meeting the condition

+ +

Usage:

+
    +
  • expression.bbox_max (in condition)
  • +
+

+This operation acts similar to DRC#bbox_min, but takes the larger dimension of the shape's +bounding box. +

+The "bbox_max" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.bbox_max". +

+

"bbox_min" - Selects the primary shape if its bounding box smaller dimension is meeting the condition

+ +

Usage:

+
    +
  • expression.bbox_min (in condition)
  • +
+

+This operation is used in conditions to select shapes based on smaller dimension of their bounding boxes. +It is applicable on polygon expressions. The result will be the input +polygons if the bounding box condition is met. +

+See Layer#drc for more details about comparison specs. +

+The following example will select all polygons whose bounding box smaller dimension is larger +than 200 nm: +

+

+out = in.drc(bbox_min > 200.nm)
+out = in.drc(primary.bbox_min > 200.nm)   # equivalent
+
+

+The "bbox_min" method is available as a plain function or as a method on DRC# expressions. +The plain function is equivalent to "primary.bbox_min". +

+

"bbox_width" - Selects the primary shape if its bounding box width is meeting the condition

+ +

Usage:

+
    +
  • expression.bbox_width (in condition)
  • +
+

+This operation acts similar to DRC#bbox_min, but takes the width of the shape's +bounding box. In general, it's more advisable to use DRC#bbox_min or DRC#bbox_max +because bbox_width implies a certain orientation. This can imply variant formation in +hierarchical contexts: cells rotated by 90 degree have to be treated differently from +ones not rotated. This usually results in a larger computation effort and larger result files. +

+The "bbox_width" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.bbox_width". +

+

"centers" - Returns the part at the center of each edge of the input

+ +

Usage:

+
    +
  • expression.centers(length)
  • +
  • expression.end_segments(length, fraction)
  • +
+

+This method acts on edge expressions and delivers a specific part of each edge. +See layer#centers for details about this functionality. +

+

"corners (in condition)" - Applies smoothing

+ +

Usage:

+
    +
  • expression.corners
  • +
  • expression.corners(as_dots)
  • +
  • expression.corners(as_boxes)
  • +
+

+This operation acts on polygons and selects the corners of the polygons. +It can be put into a condition to select corners by their angles. The angle of +a corner is positive for a turn to the left if walking a polygon counterclockwise +and negative for the turn to the right. Angles take values between -180 and 180 degree. +

+When using "as_dots" for the argument, the operation will return single-point edges at +the selected corners. With "as_boxes" (the default), small (2x2 DBU) rectangles will be +produced at each selected corner. +

+The following example selects all corners: +

+

+out = in.drc(corners)
+out = in.drc(primary.corners)    # equivalent
+
+

+The following example selects all inner corners: +

+

+out = in.drc(corners < 0)
+out = in.drc(primary.corners < 0)    # equivalent
+
+

+The "corners" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.corners". +

+

"count" - Selects a expression result based on the number of (local) shapes

+ +

Usage:

+
    +
  • expression.count (in condition)
  • +
+

+This operation is used in conditions to select expression results based on their +count. "count" is used as a method on a expression. It will evaluate the expression locally +and return the original result if the shape count in the result is matching the condition. +

+See Layer#drc for more details about comparison specs. +

+Note that the expression is evaluated locally: for each primary shape, the expression is +evaluated and the count of the resulting edge, edge pair or polygon set is taken. +As the primary input will always have a single item (the local shape), using "count" on +primary does not really make sense. It can be used on derived expressions however. +

+The following example selects triangles: +

+

+out = in.drc(if_any(corners.count == 3))
+
+

+Note "if_any" which selects the primary shape if the argument evaluates to a non-empty +result. Without "if_any" three corners are returned for each triangle. +

+

"edges" - Converts the input shapes into edges

+ +

Usage:

+
    +
  • expression.edges
  • +
+

+Polygons will be separated into edges forming their contours. Edge pairs will be +decomposed into individual edges. +

+Contrary most other operations, "edges" does not have a plain function equivalent +as this is reserved for the function generating an edges layer. +To generate the edges of the primary shapes, use "primary" explicit as the source +for the edges: +

+

+out = in.drc(primary.edges)
+
+

+

"end_segments" - Returns the part at the end of each edge of the input

+ +

Usage:

+
    +
  • expression.end_segments(length)
  • +
  • expression.end_segments(length, fraction)
  • +
+

+This method acts on edge expressions and delivers a specific part of each edge. +See layer#end_segments for details about this functionality. +

+

"extended" - Returns polygons describing an area along the edges of the input

+ +

Usage:

+
    +
  • expression.extended([:begin => b,] [:end => e,] [:out => o,] [:in => i], [:joined => true])
  • +
  • expression.extended(b, e, o, i)
  • +
+

+This method acts on edge expressions. +It will create a polygon for each edge +tracing the edge with certain offsets to the edge. "o" is the offset applied to the +outer side of the edge, "i" is the offset applied to the inner side of the edge. +"b" is the offset applied at the beginning and "e" is the offset applied at the end. +

+

"extended_in" - Returns polygons describing an area along the edges of the input

+ +

Usage:

+
    +
  • expression.extended_in(d)
  • +
+

+This method acts on edge expressions. Polygons are generated for +each edge describing the edge drawn with a certain width extending into +the "inside" (the right side when looking from start to end). +This method is basically equivalent to the extended method: +"extended(0, 0, 0, dist)". +A version extending to the outside is extended_out. +

+

"extended_out" - Returns polygons describing an area along the edges of the input

+ +

Usage:

+
    +
  • expression.extended_out(d)
  • +
+

+This method acts on edge expressions. Polygons are generated for +each edge describing the edge drawn with a certain width extending into +the "outside" (the left side when looking from start to end). +This method is basically equivalent to the extended method: +"extended(0, 0, dist, 0)". +A version extending to the inside is extended_in. +

+

"extent_refs" - Returns partial references to the boundings boxes of the polygons

+ +

Usage:

+
    +
  • expression.extent_refs([ options ])
  • +
+

+The extent_refs operation acts on polygons and has the same effect than Layer#extent_refs. +It takes the same arguments. It is available as a method on DRC expressions or +as plain function, in which case it acts on the primary shapes. +

+

"extents" - Returns the bounding box of each input object

+ +

Usage:

+
    +
  • expression.extents([ enlargement ])
  • +
+

+This method provides the same functionality as Layer#extents and takes the same +arguments. It returns the bounding boxes of the input objects. It acts on edge +edge pair and polygon expressions. +

+The "extents" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.extents". +

+

"first_edges" - Returns the first edges of edge pairs

+ +

Usage:

+
    +
  • expression.extents([ enlargement ])
  • +
+

+This method acts on edge pair expressions and returns the first edges of the +edge pairs delivered by the expression. +

+

"holes" - Selects all holes from the input polygons

+ +

Usage:

+
    +
  • expression.holes
  • +
+

+This operation can be used as a plain function in which case it acts on primary +shapes or can be used as method on another DRC expression. +The following example selects all holes with an area larger than 2 square micrometers: +

+

+out = in.drc(holes.area > 2.um)
+out = in.drc(primary.holes.area > 2.um)   # equivalent
+
+

+

"hulls" - Selects all hulls from the input polygons

+ +

Usage:

+
    +
  • expression.hulls
  • +
+

+The hulls are the outer contours of the input polygons. By selecting hulls only, +all holes will be closed. +

+This operation can be used as a plain function in which case it acts on primary +shapes or can be used as method on another DRC expression. +The following example closes all holes: +

+

+out = in.drc(hulls)
+out = in.drc(primary.hulls)   # equivalent
+
+

+

"length" - Selects edges based on their length

+ +

Usage:

+
    +
  • expression.length (in condition)
  • +
+

+This operation will select those edges which are meeting the length +criterion. Non-edge shapes (polygons, edge pairs) will be converted to edges before. +

+For example, this code selects all edges from the primary shape which are longer or +equal than 1 micrometer: +

+

+out = in.drc(length >= 1.um) 
+out = in.drc(primary.length >= 1.um)   # equivalent
+
+

+The "length" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.length". +

+

"merged" - Returns the merged input polygons, optionally selecting multi-overlap

+ +

Usage:

+
    +
  • expression.merged
  • +
  • expression.merged(min_count)
  • +
+

+This operation will act on polygons. Without a min_count argument, the merged +polygons will be returned. +

+With a min_count argument, the result will include only those parts where more +than the given number of polygons overlap. As the primary input is merged already, +it will always contribute as one. +

+The "merged" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.merged". +

+

"middle" - Returns the centers of polygon bounding boxes

+ +

Usage:

+
    +
  • expression.middle([ options ])
  • +
+

+The middle operation acts on polygons and has the same effect than Layer#middle. +It takes the same arguments. It is available as a method on DRC expressions or +as plain function, in which case it acts on the primary shapes. +

+

"odd_polygons" - Selects all polygons which are non-orientable

+ +

Usage:

+
    +
  • expression.odd_polygons
  • +
+

+Non-orientable polygons are for example "8"-shape polygons. Such polygons are +usually considered harmful as their definition of covered area is depending on the +wrap count rule in place. +

+This operation can be used as a plain function in which case it acts on primary +shapes or can be used as method on another DRC expression. +

+

"perimeter" - Selects the primary shape if the perimeter is meeting the condition

+ +

Usage:

+
    +
  • expression.perimeter (in condition)
  • +
+

+This operation is used in conditions to select shapes based on their perimeter. +It is applicable on polygon expressions. The result will be the input +polygons if the perimeter condition is met. +

+See Layer#drc for more details about comparison specs. +

+The following example will select all polygons with a perimeter less than 10 micrometers: +

+

+out = in.drc(perimeter < 10.0)
+out = in.drc(primary.perimeter < 10.0)   # equivalent
+
+

+The perimeter method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.perimeter". +

+

"polygons" - Converts the input shapes into polygons

+ +

Usage:

+
    +
  • expression.polygons([ enlargement ])
  • +
+

+Generates polygons from the input shapes. Polygons stay polygons. Edges and edge pairs +are converted to polygons. For this, the enlargement parameter will specify the +edge thickness or augmentation applied to edge pairs. With the default enlargement +of zero edges will not be converted to valid polygons and degenerated edge pairs +will not become valid polygons as well. +

+Contrary most other operations, "polygons" does not have a plain function equivalent +as this is reserved for the function generating a polygon layer. +

+This method is useful for generating polygons from DRC violation markers as shown in +the following example: +

+

+out = in.drc((width < 0.5.um).polygons)
+
+

+

"rectangles" - Selects all polygons which are rectangles

+ +

Usage:

+
    +
  • expression.rectangles
  • +
+

+This operation can be used as a plain function in which case it acts on primary +shapes or can be used as method on another DRC expression. +The following example selects all rectangles: +

+

+out = in.drc(rectangles)
+out = in.drc(primary.rectangles)    # equivalent
+
+

+

"rectilinear" - Selects all polygons which are rectilinear

+ +

Usage:

+
    +
  • expression.rectilinear
  • +
+

+Rectilinear polygons only have vertical and horizontal edges. Such polygons are also +called manhattan polygons. +

+This operation can be used as a plain function in which case it acts on primary +shapes or can be used as method on another DRC expression. +The following example selects all manhattan polygons: +

+

+out = in.drc(rectilinear)
+out = in.drc(primary.rectilinear)    # equivalent
+
+

+

"rounded_corners" - Applies corner rounding

+ +

Usage:

+
    +
  • expression.rounded_corners(inner, outer, n)
  • +
+

+This operation acts on polygons and applies corner rounding the the given inner +and outer corner radius and the number of points n per full circle. See Layer#rounded_corners for more details. +

+The "rounded_corners" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.rounded_corners". +

+

"second_edges" - Returns the second edges of edge pairs

+ +

Usage:

+
    +
  • expression.extents([ enlargement ])
  • +
+

+This method acts on edge pair expressions and returns the second edges of the +edge pairs delivered by the expression. +

+

"sized" - Returns the sized version of the input

+ +

Usage:

+
    +
  • expression.sized(d [, mode])
  • +
  • expression.sized(dx, dy [, mode]))
  • +
+

+This method provides the same functionality as Layer#sized and takes the same +arguments. It acts on polygon expressions. +

+The "sized" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.sized". +

+

"smoothed" - Applies smoothing

+ +

Usage:

+
    +
  • expression.smoothed(d)
  • +
+

+This operation acts on polygons and applies polygon smoothing with the tolerance d. See Layer#smoothed for more details. +

+The "smoothed" method is available as a plain function or as a method on DRC expressions. +The plain function is equivalent to "primary.smoothed". +

+

"start_segments" - Returns the part at the beginning of each edge of the input

+ +

Usage:

+
    +
  • expression.start_segments(length)
  • +
  • expression.start_segments(length, fraction)
  • +
+

+This method acts on edge expressions and delivers a specific part of each edge. +See layer#start_segments for details about this functionality. +

+

"|" - Boolean OR between the results of two expressions

+ +

Usage:

+
    +
  • expression | expression
  • +
+

+The | operator will compute the boolean OR between the results of +two expressions. '+' is basically a synonym. Both expressions +must render the same type. +

+
diff --git a/src/lay/lay/doc/about/drc_ref_global.xml b/src/lay/lay/doc/about/drc_ref_global.xml index 38cc38445..9d9bd3cb5 100644 --- a/src/lay/lay/doc/about/drc_ref_global.xml +++ b/src/lay/lay/doc/about/drc_ref_global.xml @@ -7,11 +7,6 @@ DRC Reference: Global Functions -

-Some functions are available on global level and can be used without any object. -Most of them are convenience functions that basically act on some default object -or provide function-like alternatives for the methods. -

"antenna_check" - Performs an antenna check

@@ -22,6 +17,60 @@ or provide function-like alternatives for the methods.

See Netter#antenna_check for a description of that function.

+

"area" - Selects the primary shape if the area is meeting the condition

+ +

Usage:

+
    +
  • area (in condition)
  • +
  • area(layer)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.area" (see Layer#area). Without a layer +argument, "area" represents an area filter for primary shapes in +DRC expressions (see Layer#drc and DRC#area for more details). +

+

"bbox_height" - Selects primary shapes based on their bounding box height

+ +

Usage:

+
    +
  • bbox_height (in condition)
  • +
+

+This method creates a universal DRC expression (see Layer#drc) to select primary shapes whose +bounding box height satisfies the condition. Conditions may be written as arithmetic comparisons +against numeric values. For example, "bbox_height < 2.0" will select all primary shapes whose +bounding box height is less than 2 micrometers. See Layer#drc for more details about comparison +specs. Plain "bbox_min" is equivalent to "primary.bbox_min" - i.e. it is used on the primary +shape. Also see DRC#bbox_min. +

+

"bbox_max" - Selects primary shapes based on their bounding box height or width, whichever is larger

+ +

Usage:

+
    +
  • bbox_max (in condition)
  • +
+

+See Layer#drc, bbox_max and DRC#bbox_max for more details. +

+

"bbox_min" - Selects primary shapes based on their bounding box height or width, whichever is smaller

+ +

Usage:

+
    +
  • bbox_max (in condition)
  • +
+

+See Layer#drc, bbox_min and DRC#bbox_min for more details. +

+

"bbox_width" - Selects primary shapes based on their bounding box width

+ +

Usage:

+
    +
  • bbox_max (in condition)
  • +
+

+See Layer#drc, bbox_height and DRC#bbox_height for more details. +

"bjt3" - Supplies the BJT3 transistor extractor class

Usage:

@@ -85,6 +134,32 @@ The area_cap argument is the capacitance in Farad per square micrometer. See DeviceExtractorCapacitorWithBulk for more details about this extractor.

+

"case" - A conditional selector for the "drc" universal DRC function

+ +

Usage:

+
    +
  • case(...)
  • +
+

+This function provides a conditional selector for the "drc" function. +It is used this way: +

+

+out = in.drc(case(c1, r1, c2, r2, ..., cn, rn)
+out = in.drc(case(c1, r1, c2, r2, ..., cn, rn, rdef)
+
+

+This function will evaluate c1 which is a universal DRC expression (see Layer#drc). +If the result is not empty, "case" will evaluate and return r1. Otherwise it +will continue with c2 and the result of this expression is not empty it will +return r2. Otherwise it will continue with c3/r3 etc. +

+If an odd number of arguments is given, the last expression is evaluated if +none of the conditions c1..cn gives a non-empty result. +

+As a requirement, the result types of all r1..rn expressions and the rdef +needs to be the same - i.e. all need to render polygons or edges or edge pairs. +

"cell" - Selects a cell for input on the default source

Usage:

@@ -251,6 +326,50 @@ See
Netter#connect_global

See Netter#connect_implicit for a description of that function.

+

"corners" - Selects all polygons which are rectilinear

+ +

Usage:

+
    +
  • corners (in condition)
  • +
  • corners(layer)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.corners" (see Layer#corners). Without a layer +argument, "corners" represents the corner generator/filter in primary shapes for +DRC expressions (see Layer#drc and DRC#corners for more details). +

+

"covering" - Selects shapes entirely covering other shapes

+ +

Usage:

+
    +
  • covering(other) (in conditions)
  • +
  • covering(layer, other [, options ])
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.covering" (see Layer#covering). +

+Without a layer argument, this method represents the selector of primary shapes +which entirely cover shapes from the other layer. This version can be put into +a condition indicating how many shapes of the other layer need to be covered. +Use this variant within DRC expressions (also see Layer#drc). +

+For example, the following statement selects all input shapes which entirely +cover shapes from the "other" layer: +

+

+out = in.drc(covering(other))
+
+

+This example selects all input shapes which entire cover shapes from +the other layer and there are more than two shapes from "other" inside +primary shapes: +

+

+out = in.drc(covering(other) > 2)
+
+

"dbu" - Gets or sets the database unit to use

Usage:

@@ -380,6 +499,49 @@ See
Source#edge_pairs for a d

See Source#edges for a description of that function.

+

"enc" - Synonym for "enclosing"

+ +

Usage:

+
    +
  • enc(...)
  • +
+

+"enc" is the short form for enclosing. +

+

"enclosing" - Performs an enclosing check

+ +

Usage:

+
    +
  • enclosing(other [, options ]) (in conditions)
  • +
  • enclosing(layer, other [, options ])
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.enclosing" (see Layer#enclosing). +

+The version without the first layer is intended for use within DRC expressions +together with the Layer#drc method. In this case, this function needs to be +put into a condition to specify the check constraints. The other options +of Layer#enclosing (e.g. metrics, projection constraints, angle limits etc.) +apply to this version too. +

+The conditions may involve an upper and lower limit. The following examples +illustrate the use of this function with conditions: +

+

+out = in.drc(enclosing(other) < 0.2.um)
+out = in.drc(enclosing(other) <= 0.2.um)
+out = in.drc(enclosing(other) > 0.2.um)
+out = in.drc(enclosing(other) >= 0.2.um)
+out = in.drc(enclosing(other) == 0.2.um)
+out = in.drc(0.1.um <= enclosing(other) < 0.2.um)
+
+

+The result of the enclosing check are edge pairs forming the violation +markers. With a lower limit, these markers are formed by two, identical but opposite edges attached to +the primary shape. Without a lower limit, the first edge of the marker is attached to the +primary shape while the second edge is attached to the shape of the "other" layer. +

"error" - Prints an error

Usage:

@@ -398,6 +560,32 @@ Similar to
log, but the message is printed formatted as an er

See Source#extent for a description of that function.

+

"extent_refs" - Returns partial references to the boundings boxes of the polygons

+ +

Usage:

+
    +
  • extent_refs([ options ])
  • +
  • extent_refs(layer, [ options ])
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.extent_refs" (see Layer#extent_refs). Without a layer +argument, "extent_refs" represents the partial extents extractor on primary shapes within +DRC expressions (see Layer#drc and DRC#extent_refs for more details). +

+

"extents" - Returns the bounding box of each input object

+ +

Usage:

+
    +
  • extents([ enlargement ])
  • +
  • extents(layer, [ enlargement ])
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.extents" (see Layer#extents). Without a layer +argument, "extents" represents the extents generator on primary shapes within +DRC expressions (see Layer#drc and DRC#extents for more details). +

"extract_devices" - Extracts devices for a given device extractor and device layer selection

Usage:

@@ -417,6 +605,95 @@ See
Netter#extract_devices Disables tiling mode. Tiling mode can be enabled again with tiles later.

+

"foreign" - Represents all other polygons from primary except the current one

+ +

Usage:

+
    +
  • foreign
  • +
+

+The primary input of the universal DRC function is the layer the Layer#drc function +is called on. This operation represents all "other" primary polygons while +primary represents the current polygon. +

+This feature opens new options for processing layouts beyond the +abilities of the classical DRC concept. For classic DRC, intra-layer interactions +are always symmetric: a polygon cannot be considered separated from it's neighbors +on the same layer. +

+The following example computes every part of the input which is closer than +0.5 micrometers to other (disconnected) polygons on the same layer: +

+

+out = in.drc(primary & foreign.sized(0.5.um))
+
+

+

"holes" - Selects all holes from the input polygons

+ +

Usage:

+
    +
  • holes
  • +
  • holes(layer)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.holes" (see Layer#hulls). Without a layer +argument, "holes" represents a hole extractor for primary shapes in +DRC expressions (see Layer#drc and DRC#hulls for more details). +

+

"hulls" - Selects all hulls from the input polygons

+ +

Usage:

+
    +
  • hulls
  • +
  • hulls(layer)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.hulls" (see Layer#hulls). Without a layer +argument, "hulls" represents a hull contour extractor for primary shapes in +DRC expressions (see Layer#drc and DRC#hulls for more details). +

+

"if_all" - Evaluates to the primary shape when all condition expression results are non-empty

+ +

Usage:

+
    +
  • if_all(c1, ... cn)
  • +
+

+This function will evaluate the conditions c1 to cn and return the +current primary shape if all conditions render a non-empty result. +The following example selects all shapes which are rectangles and +whose area is larger than 0.5 square micrometers: +

+

+out = in.drc(if_all(area > 0.5, rectangle))
+
+

+The condition expressions may be of any type (edges, edge pairs and polygons). +

+

"if_any" - Evaluates to the primary shape when any condition expression results is non-empty

+ +

Usage:

+
    +
  • if_any(c1, ... cn)
  • +
+

+This function will evaluate the conditions c1 to cn and return the +current primary shape if at least one condition renders a non-empty result. +See if_all for an example how to use the if_... functions. +

+

"if_none" - Evaluates to the primary shape when all of the condition expression results are empty

+ +

Usage:

+
    +
  • if_none(c1, ... cn)
  • +
+

+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. +

"info" - Outputs as message to the logger window

Usage:

@@ -440,6 +717,33 @@ See
Source#input for a description polygons and labels. See polygons and labels for more specific versions of this method.

+

"inside" - Selects shapes entirely inside other shapes

+ +

Usage:

+
    +
  • inside(other)
  • +
  • inside(layer, other)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.inside" (see Layer#inside). +

+Without a layer argument, this method represents the selector of primary shapes +which are entirely inside shapes from the other layer. +Use this variant within DRC expressions (also see Layer#drc). +

+

"interacting" - Selects shapes interacting with other shapes

+ +

Usage:

+
    +
  • interacting(other) (in conditions)
  • +
  • interacting(layer, other [, options ])
  • +
+

+See covering for a description of the use cases for this function. +When using "interacting", shapes are selected when the interact (overlap, touch) +shapes from the other layer. +

"is_deep?" - Returns true, if in deep mode

Usage:

@@ -452,6 +756,15 @@ this method.
  • is_tiled?
+

"iso" - Synonym for "isolated"

+ +

Usage:

+
    +
  • iso(...)
  • +
+

+"iso" is the short form for isolated. +

"l2n_data" - Gets the internal LayoutToNetlist object for the default Netter

Usage:

@@ -589,6 +902,19 @@ Set the value to zero to disable splitting by vertex count.

See also max_area_ratio for the other option affecting polygon splitting.

+

"middle" - Returns the centers of polygon bounding boxes

+ +

Usage:

+
    +
  • middle([ options ])
  • +
  • middle(layer, [ options ])
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.middle" (see Layer#middle). Without a layer +argument, "middle" represents the bounding box center marker generator on primary shapes within +DRC expressions (see Layer#drc and DRC#middle for more details). +

"mos3" - Supplies the MOS3 transistor extractor class

Usage:

@@ -640,6 +966,30 @@ See
Netter for more details

Resets the tile borders - see tile_borders for a description of tile borders.

+

"notch" - Performs a notch (intra-polygon space) check

+ +

Usage:

+
    +
  • notch([ options ]) (in conditions)
  • +
  • notch(layer [, options ])
  • +
+

+Provides a intra-polygon space check for polygons from the primary layer. Like width this +function provides a single-layer check. See there for details how to use this function. +

+

"odd_polygons" - Selects all polygons which are non-orientable

+ +

Usage:

+
    +
  • odd_polygons
  • +
  • odd_polygons(layer)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.odd_polygons" (see Layer#odd_polygons). Without a layer +argument, "odd_polygons" represents an odd polygon filter for primary shapes in +DRC expressions (see Layer#drc and DRC#odd_polygons for more details). +

"output" - Outputs a layer to the report database or output layout

Usage:

@@ -660,6 +1010,44 @@ This method switches output to the specified cell, but does not change the target layout nor does it switch the output channel to layout if is report database.

+

"outside" - Selects shapes entirely outside other shapes

+ +

Usage:

+
    +
  • outside(other)
  • +
  • outside(layer, other)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.outside" (see Layer#outside). +

+Without a layer argument, this method represents the selector of primary shapes +which are entirely outside shapes from the other layer. +Use this variant within DRC expressions (also see Layer#drc). +

+

"overlap" - Performs an overlap check

+ +

Usage:

+
    +
  • overlap(other [, options ]) (in conditions)
  • +
  • overlap(layer, other [, options ])
  • +
+

+Provides an overlap check (primary layer vs. another layer). Like enclosing this +function provides a two-layer check. See there for details how to use this function. +

+

"overlapping" - Selects shapes overlapping with other shapes

+ +

Usage:

+
    +
  • overlapping(other) (in conditions)
  • +
  • overlapping(layer, other [, options ])
  • +
+

+See covering for a description of the use cases for this function. +When using "overlapping", shapes are selected when the overlap +shapes from the other layer. +

"p" - Creates a point object

Usage:

@@ -685,6 +1073,19 @@ x.insert(polygon([ p(0, 0), p(16.0, 0), p(8.0, 8.0) ])) This function creates a path object. The arguments are the same than for the DPath constructors.

+

"perimeter" - Selects the primary shape if the perimeter is meeting the condition

+ +

Usage:

+
    +
  • perimeter (in condition)
  • +
  • perimeter(layer)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.perimeter" (see Layer#perimeter). Without a layer +argument, "perimeter" represents a perimeter filter for primary shapes in +DRC expressions (see Layer#drc and DRC#perimeter for more details). +

"polygon" - Creates a polygon object

Usage:

@@ -716,6 +1117,42 @@ A similar method which creates a hierarchical layer in deep mode is

See Source#polygons for a description of that function.

+

"primary" - Represents the primary input of the universal DRC function

+ +

Usage:

+
    +
  • primary
  • +
+

+The primary input of the universal DRC function is the layer the Layer#drc function +is called on. +

+

"rectangles" - Selects all polygons which are rectangles

+ +

Usage:

+
    +
  • rectangles
  • +
  • rectangles(layer)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.rectangles" (see Layer#rectangles). Without a layer +argument, "rectangles" represents the rectangles filter for primary shapes in +DRC expressions (see Layer#drc and DRC#rectangles for more details). +

+

"rectilinear" - Selects all polygons which are rectilinear

+ +

Usage:

+
    +
  • rectilinear
  • +
  • rectilinear(layer)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.rectilinear" (see Layer#rectilinear). Without a layer +argument, "rectilinear" represents the rectilinear polygons filter for primary shapes in +DRC expressions (see Layer#drc and DRC#rectilinear for more details). +

"report" - Specifies a report database for output

Usage:

@@ -785,6 +1222,36 @@ The sheet_rho value is the sheet resistance in ohms/square. See DeviceExtractorResistorWithBulk for more details about this extractor.

+

"rounded_corners" - Applies corner rounding

+ +

Usage:

+
    +
  • rounded_corners(inner, outer, n)
  • +
  • rounded_corners(layer, inner, outer, n)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.rounded_corners" (see Layer#rounded_corners). Without a layer +argument, "rounded_corners" represents the corner rounding algorithm on primary shapes within +DRC expressions (see Layer#drc and DRC#rounded_corners for more details). +

+

"secondary" - Provides secondary input for the "drc" universal DRC function

+ +

Usage:

+
    +
  • secondary(layer)
  • +
+

+To supply additional input for the universal DRC expressions (see Layer#drc), use +"secondary" with a layer argument. This example provides a boolean AND +between l1 and l2: +

+

+l1 = layer(1, 0)
+l2 = layer(2, 0)
+out = l1.drc(primary & secondary(l2))
+
+

"select" - Specifies cell filters on the default source

Usage:

@@ -794,6 +1261,26 @@ about this extractor.

See Source#select for a description of that function.

+

"sep" - Synonym for "separation"

+ +

Usage:

+
    +
  • sep(...)
  • +
+

+"sep" is the short form for separation. +

+

"separation" - Performs a separation check

+ +

Usage:

+
    +
  • separation(other [, options ]) (in conditions)
  • +
  • separation(layer, other [, options ])
  • +
+

+Provides a separation check (primary layer vs. another layer). Like enclosing this +function provides a two-layer check. See there for details how to use this function. +

"silent" - Resets verbose mode

Usage:

@@ -803,6 +1290,34 @@ See
Source#select for a descripti

This function is equivalent to "verbose(false)" (see verbose)

+

"sized" - Returns the sized version of the input

+ +

Usage:

+
    +
  • sized(d [, mode])
  • +
  • sized(dx, dy [, mode]))
  • +
  • sized(layer, d [, mode])
  • +
  • sized(layer, dx, dy [, mode]))
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.sized" (see Layer#sized). Without a layer +argument, "sized" represents the polygon sizer on primary shapes within +DRC expressions (see Layer#drc and DRC#sized for more details). +

+

"smoothed" - Applies smoothing

+ +

Usage:

+
    +
  • smoothed(d)
  • +
  • smoothed(layer, d)
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.smoothed" (see Layer#smoothed). Without a layer +argument, "smoothed" represents the polygon smoother on primary shapes within +DRC expressions (see Layer#drc and DRC#smoothed for more details). +

"source" - Specifies a source layout

Usage:

@@ -815,7 +1330,7 @@ This function replaces the default source layout by the specified file. If this function is not used, the currently active layout is used as input.

-layout is a similar method which specifies a additional input layout. +layout is a similar method which specifies an additional input layout.

"what" specifies what input to use. "what" be either

@@ -840,6 +1355,17 @@ l2 = layout("second_layout.gds")

For further methods on the source object see Source.

+

"space" - Performs a space check

+ +

Usage:

+
    +
  • space([ options ]) (in conditions)
  • +
  • space(layer [, options ])
  • +
+

+Provides a space check on the primary layer. Like width this +function provides a single-layer check. See there for details how to use this function. +

"target" - Specify the target layout

Usage:

@@ -963,6 +1489,40 @@ In verbose mode, more output is generated in the log file

In verbose mode, more output is generated in the log file

+

"width" - Performs a width check

+ +

Usage:

+
    +
  • width([ options ]) (in conditions)
  • +
  • width(layer [, options ])
  • +
+

+This function can be used with a layer argument in which case it +is equivalent to "layer.width" (see Layer#width). +

+The version without a layer is intended for use within DRC expressions +together with the Layer#drc method. In this case, this function needs to be +put into a condition to specify the check constraints. The other options +of Layer#width (e.g. metrics, projection constraints, angle limits etc.) +apply to this version too. +

+The conditions may involve an upper and lower limit. The following examples +illustrate the use of this function with conditions: +

+

+out = in.drc(width < 0.2.um)
+out = in.drc(width <= 0.2.um)
+out = in.drc(width > 0.2.um)
+out = in.drc(width >= 0.2.um)
+out = in.drc(width == 0.2.um)
+out = in.drc(0.1.um <= width < 0.2.um)
+
+

+The result of the width check are edge pairs forming the violation +markers. With a lower limit, these markers are formed by two, identical but opposite edges attached to +the primary shape. Without a lower limit, both edges are attached to different sides of the primary +shape. +

"write_spice" - Defines SPICE output format (with options)

Usage:

diff --git a/src/lay/lay/doc/about/drc_ref_layer.xml b/src/lay/lay/doc/about/drc_ref_layer.xml index f596d3391..bb69973b0 100644 --- a/src/lay/lay/doc/about/drc_ref_layer.xml +++ b/src/lay/lay/doc/about/drc_ref_layer.xml @@ -7,9 +7,6 @@ DRC Reference: Layer Object -

-The layer object represents a collection of polygons, edges or edge pairs. -

"&" - Boolean AND operation

@@ -323,6 +320,73 @@ representing the underlying RBA object for the data. Access to these objects is provided to support low-level iteration and manipulation of the layer's data.

+

"drc" - Provides a generic DRC function for use with DRC expressions

+ +

Usage:

+
    +
  • layer.drc(expression)
  • +
+

+This method implement the universal DRC which offers enhanced abilities, +improved performance in some applications and better readability. +

+The key concept for this method are DRC expressions. DRC expressions +are formed by using predefined keywords like "width", operators like "&" +and method to build an abstract definition of the operations to perform +within the DRC. +

+When the DRC function is executed, it will basically visit all shapes +from the input layer (the one, the "drc" method is called on), collect +the neighbor shapes from all involved other inputs and run the requested +operations on each cluster. Currently, "drc" is only available for polygon +layers. +

+The nature of the "drc" operation is that of the loop over all (merged) input +polygons. Within the operation executed on each shape, it's possible to make +decisions such as "if the shape has an area larger than something, apply this +operation" etc. This can be achieved with conventional DRC functions too, +but involves potentially complex and heavy operations such as booleans, interact +etc. For this reason, the "drc" function may provide a performance benefit. +

+In addition, within the loop, a single shape from the input layer is presented to +execution engine which runs the operations. +This allows using operations such as "size" without having to consider +neigbor polygons growing into the area of the initial shape. In this sense, +the "drc" function allows seeing the layer as individual polygons rather than +a global "sea of polygons". This enables new applications which are otherwise +difficult to implement. +

+An important concept in the context of "drc" expressions is the "primary". +This expression represents a single primary shape. "Secondaries" are shapes +from other inputs. Primary shapes guide the operation - secondaries without +primaries are not seen. The "drc" operation will look for secondaries within +a certain distance which is determined from the operations within the +expression to execute. The secondaries collected in this step will not be +merged, so the secondary polygons may be partial. This is important when +using measurement operations like "area" on secondary polygons. +

+Here is an example for a generic DRC operation which performs a width +check for less than 0.5.um on the primary shapes. +

+

+out = in.drc(width < 0.5.um)
+
+

+Another example computes a boolean AND between two layers before selecting +the result polygons with an area larger than 1 square micrometer: +

+

+other = ... another layer ..
+out = in.drc((primary & other).area > 1.0)
+
+

+This example demonstrates how the "drc" operation can improve performance: as the +boolean operation is computed locally and the result is discarded when no longer required, +less shapes need to be stored hence reducing the memory overhead and CPU time required +to manage these shapes. +

+For more details about the expression see the DRC class documentation. +

"dup" - Duplicates a layer

Usage:

@@ -2482,7 +2546,12 @@ Shielding is enabled by default, but can be switched off with the "transparent"

When called on an edge layer, the method selects edges by their angle, measured against the horizontal axis in the mathematical sense. -The first version selects +

+For this measurement edges are considered without their direction and straight lines. +A horizontal edge has an angle of zero degree. A vertical one has +an angle of 90 degee. The angle range is from -90 (exclusive) to 90 degree (inclusive). +

+The first version of this method selects edges with a angle larger or equal to min and less than max (but not equal). The second version selects edges with exactly the given angle. The third version is identical to the first one. diff --git a/src/lay/lay/doc/about/index.xml b/src/lay/lay/doc/about/index.xml index 948703245..f5c93bbe2 100644 --- a/src/lay/lay/doc/about/index.xml +++ b/src/lay/lay/doc/about/index.xml @@ -30,13 +30,7 @@ - - - - - - diff --git a/src/lay/lay/layHelpResources.qrc b/src/lay/lay/layHelpResources.qrc index e840931ef..12e304bcb 100644 --- a/src/lay/lay/layHelpResources.qrc +++ b/src/lay/lay/layHelpResources.qrc @@ -38,6 +38,7 @@ doc/about/technology_manager.xml doc/about/custom_queries.xml doc/about/drc_ref.xml + doc/about/drc_ref_drc.xml doc/about/drc_ref_layer.xml doc/about/drc_ref_source.xml doc/about/drc_ref_global.xml