diff --git a/src/db/db/gsiDeclDbRegion.cc b/src/db/db/gsiDeclDbRegion.cc index 6170da161..b8c2813ea 100644 --- a/src/db/db/gsiDeclDbRegion.cc +++ b/src/db/db/gsiDeclDbRegion.cc @@ -984,7 +984,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "@brief Gets a flag indicating whether minimum coherence is selected\n" "See \\min_coherence= for a description of this attribute.\n" ) + - method_ext ("complex_op", &complex_op, gsi::arg ("node"), gsi::arg ("property_constraint", db::IgnoreProperties), + method_ext ("complex_op", &complex_op, gsi::arg ("node"), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Executes a complex operation (see \\CompoundRegionOperationNode for details)\n" "\n" "This method has been introduced in version 0.27." @@ -1616,7 +1616,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" ) + - method_ext ("andnot", &andnot, gsi::arg ("other"), gsi::arg ("property_constraint", db::IgnoreProperties), + method_ext ("andnot", &andnot, gsi::arg ("other"), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Returns the boolean AND and NOT between self and the other region\n" "\n" "@return A two-element array of regions with the first one being the AND result and the second one being the NOT result\n" @@ -1634,7 +1634,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "This method will compute the boolean AND (intersection) between two regions. " "The result is often but not necessarily always merged.\n" ) + - method ("and", &db::Region::bool_and, gsi::arg ("other"), gsi::arg ("property_constraint", db::IgnoreProperties), + method ("and", &db::Region::bool_and, gsi::arg ("other"), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Returns the boolean AND between self and the other region\n" "\n" "@return The result of the boolean AND operation\n" @@ -1654,7 +1654,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "This method will compute the boolean AND (intersection) between two regions. " "The result is often but not necessarily always merged.\n" ) + - method ("and_with", &db::Region::bool_and_with, gsi::arg ("other"), gsi::arg ("property_constraint", db::IgnoreProperties), + method ("and_with", &db::Region::bool_and_with, gsi::arg ("other"), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Performs the boolean AND between self and the other region\n" "\n" "@return The region after modification (self)\n" @@ -1674,7 +1674,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "This method will compute the boolean NOT (intersection) between two regions. " "The result is often but not necessarily always merged.\n" ) + - method ("not", &db::Region::bool_not, gsi::arg ("other"), gsi::arg ("property_constraint", db::IgnoreProperties), + method ("not", &db::Region::bool_not, gsi::arg ("other"), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Returns the boolean NOT between self and the other region\n" "\n" "@return The result of the boolean NOT operation\n" @@ -1694,7 +1694,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "This method will compute the boolean NOT (intersection) between two regions. " "The result is often but not necessarily always merged.\n" ) + - method ("not_with", &db::Region::bool_not_with, gsi::arg ("other"), gsi::arg ("property_constraint", db::IgnoreProperties), + method ("not_with", &db::Region::bool_not_with, gsi::arg ("other"), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Performs the boolean NOT between self and the other region\n" "\n" "@return The region after modification (self)\n" @@ -2515,7 +2515,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This variant was introduced in version 0.27.\n" ) + - method_ext ("width_check", &width2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties), + method_ext ("width_check", &width2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Performs a width check with options\n" "@param d The minimum width for which the polygons are checked\n" "@param whole_edges If true, deliver the whole edges\n" @@ -2525,7 +2525,8 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "@param max_projection The upper limit of the projected length of one edge onto another\n" "@param shielded Enables shielding\n" "@param negative If true, edges not violation the condition will be output as pseudo-edge pairs\n" - "@param property_constraint Only \\IgnoreProperties and \\NoPropertyConstraint are allowed - in the last case, properties are copied from the original shapes to the output" + "@param property_constraint Only \\IgnoreProperties and \\NoPropertyConstraint are allowed - in the last case, properties are copied from the original shapes to the output. " + "Other than 'width' allow more options here.\n" "\n" "This version is similar to the simple version with one parameter. In addition, it allows " "to specify many more options.\n" @@ -2557,7 +2558,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "The 'shielded' and 'negative' options have been introduced in version 0.27. " "'property_constraint' has been added in version 0.28.4." ) + - method_ext ("space_check", &space2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties), + method_ext ("space_check", &space2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Performs a space check with options\n" "@param d The minimum space for which the polygons are checked\n" "@param whole_edges If true, deliver the whole edges\n" @@ -2600,7 +2601,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27.\n" "'property_constraint' has been added in version 0.28.4." ) + - method_ext ("notch_check", ¬ch2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties), + method_ext ("notch_check", ¬ch2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Performs a space check between edges of the same polygon with options\n" "@param d The minimum space for which the polygons are checked\n" "@param whole_edges If true, deliver the whole edges\n" @@ -2643,7 +2644,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "The 'shielded' and 'negative' options have been introduced in version 0.27.\n" "'property_constraint' has been added in version 0.28.4." ) + - method_ext ("isolated_check", &isolated2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties), + method_ext ("isolated_check", &isolated2, gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Performs a space check between edges of different polygons with options\n" "@param d The minimum space for which the polygons are checked\n" "@param whole_edges If true, deliver the whole edges\n" @@ -2686,7 +2687,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27.\n" "'property_constraint' has been added in version 0.28.4." ) + - method_ext ("inside_check|enclosed_check", &inside2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties), + method_ext ("inside_check|enclosed_check", &inside2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Performs an inside check with options\n" "@param d The minimum distance for which the polygons are checked\n" "@param other The other region against which to check\n" @@ -2737,7 +2738,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "The 'enclosed_check' alias was introduced in version 0.27.5.\n" "'property_constraint' has been added in version 0.28.4." ) + - method_ext ("overlap_check", &overlap2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties), + method_ext ("overlap_check", &overlap2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Performs an overlap check with options\n" "@param d The minimum overlap for which the polygons are checked\n" "@param other The other region against which to check\n" @@ -2787,7 +2788,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1.\n" "'property_constraint' has been added in version 0.28.4." ) + - method_ext ("enclosing_check", &enclosing2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties), + method_ext ("enclosing_check", &enclosing2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Performs an enclosing check with options\n" "@param d The minimum enclosing distance for which the polygons are checked\n" "@param other The other region against which to check\n" @@ -2837,7 +2838,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1.\n" "'property_constraint' has been added in version 0.28.4." ) + - method_ext ("separation_check", &separation2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties), + method_ext ("separation_check", &separation2, gsi::arg ("other"), gsi::arg ("d"), gsi::arg ("whole_edges", false), gsi::arg ("metrics", db::metrics_type::Euclidian, "Euclidian"), gsi::arg ("ignore_angle", tl::Variant (), "default"), gsi::arg ("min_projection", tl::Variant (), "0"), gsi::arg ("max_projection", tl::Variant (), "max"), gsi::arg ("shielded", true), gsi::arg ("opposite_filter", db::NoOppositeFilter, "NoOppositeFilter"), gsi::arg ("rect_filter", db::NoRectFilter, "NoRectFilter"), gsi::arg ("negative", false), gsi::arg ("property_constraint", db::IgnoreProperties, "IgnoreProperties"), "@brief Performs a separation check with options\n" "@param d The minimum separation for which the polygons are checked\n" "@param other The other region against which to check\n" @@ -3067,15 +3068,22 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", ) + gsi::method_ext ("nets", &nets, gsi::arg ("extracted"), gsi::arg ("net_prop_name", tl::Variant (), "nil"), gsi::arg ("net_filter", (const std::vector *) (0), "nil"), "@brief Pulls the net shapes from a LayoutToNetlist database\n" - "This method will pull the net shapes from the LayoutToNetlist database, provided that this " - "region was an input to the netlist extraction.\n" + "This method will create a new layer with the net shapes from the LayoutToNetlist database, provided that this " + "region was an input to the netlist extraction on this database.\n" "\n" - "A (net name, net id) tuple will be attached as properties to the shapes if 'net_prop_name' is given and not nil. " - "This allows generating unique properties per shape flagging the net the shape is on. This feature is good for " + "A (circuit name, net name) tuple will be attached as properties to the shapes if 'net_prop_name' is given and not nil. " + "This allows generating unique properties per shape, flagging the net the shape is on. This feature is good for " "performing net-dependent booleans and DRC checks.\n" "\n" "A net filter can be provided with the 'net_filter' argument. If given, only nets from this " - "set are produced.\n" + "set are produced. Example:\n" + "\n" + "@code\n" + "connect(metal1, via1)\n" + "connect(via1, metal2)\n" + "\n" + "metal1_all_nets = metal1.nets\n" + "@/code\n" "\n" "This method was introduced in version 0.28.4" ) + @@ -3117,7 +3125,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "This class has been introduced in version 0.23.\n" ); -gsi::EnumIn decl_Region_Metrics ("db", "Metrics", +gsi::Enum decl_Metrics ("db", "Metrics", gsi::enum_const ("Euclidian", db::Euclidian, "@brief Specifies Euclidian metrics for the check functions\n" "This value can be used for the metrics parameter in the check functions, i.e. \\width_check. " @@ -3154,10 +3162,10 @@ gsi::EnumIn decl_Region_Metrics ("db", "Metrics", // Inject the Region::Metrics declarations into Region and Edges: // (Edges injection has to be done here because only here defs() is available) -gsi::ClassExt inject_Metrics_in_parent (decl_Region_Metrics.defs ()); -gsi::ClassExt inject_Metrics_in_Edges (decl_Region_Metrics.defs ()); +gsi::ClassExt inject_Metrics_in_Region (decl_Metrics.defs ()); +gsi::ClassExt inject_Metrics_in_Edges (decl_Metrics.defs ()); -gsi::EnumIn decl_Region_PropertyConstraint ("db", "PropertyConstraint", +gsi::Enum decl_PropertyConstraint ("db", "PropertyConstraint", gsi::enum_const ("IgnoreProperties", db::IgnoreProperties, "@brief Specifies to ignore properties\n" "When using this constraint - for example on a boolean operation - properties are ignored and are not generated in the output." @@ -3194,10 +3202,10 @@ gsi::EnumIn decl_Region_PropertyConstraint ( // Inject the Region::PropertyConstraint declarations into Region and Edges: // (Edges injection has to be done here because only here defs() is available) -gsi::ClassExt inject_PropertyConstraint_in_parent (decl_Region_PropertyConstraint.defs ()); -gsi::ClassExt inject_PropertyConstraint_in_Edges (decl_Region_PropertyConstraint.defs ()); +gsi::ClassExt inject_PropertyConstraint_in_Region (decl_PropertyConstraint.defs ()); +gsi::ClassExt inject_PropertyConstraint_in_Edges (decl_PropertyConstraint.defs ()); -gsi::EnumIn decl_Region_RectFilter ("db", "RectFilter", +gsi::EnumIn decl_RectFilter ("db", "RectFilter", gsi::enum_const ("NoRectFilter", db::RectFilter::NoRectFilter, "@brief Specifies no filtering" ) + @@ -3225,9 +3233,9 @@ gsi::EnumIn decl_Region_RectFilter ("db", "RectFilte ); // Inject the Region::RectFilter declarations into Region: -gsi::ClassExt inject_RectFilter_in_parent (decl_Region_RectFilter.defs ()); +gsi::ClassExt inject_RectFilter_in_Region (decl_RectFilter.defs ()); -gsi::EnumIn decl_Region_OppositeFilter ("db", "OppositeFilter", +gsi::EnumIn decl_OppositeFilter ("db", "OppositeFilter", gsi::enum_const ("NoOppositeFilter", db::OppositeFilter::NoOppositeFilter, "@brief No opposite filtering\n" ) + @@ -3243,6 +3251,6 @@ gsi::EnumIn decl_Region_OppositeFilter ("db", "O ); // Inject the Region::OppositeFilter declarations into Region: -gsi::ClassExt inject_OppositeFilter_in_parent (decl_Region_OppositeFilter.defs ()); +gsi::ClassExt inject_OppositeFilter_in_Region (decl_OppositeFilter.defs ()); } diff --git a/src/doc/doc/about/drc_ref_global.xml b/src/doc/doc/about/drc_ref_global.xml index 089c1eb5c..91fa1a06e 100644 --- a/src/doc/doc/about/drc_ref_global.xml +++ b/src/doc/doc/about/drc_ref_global.xml @@ -1413,6 +1413,72 @@ See Source#polygons for a descr The primary input of the universal DRC function is the layer the Layer#drc function is called on.

+

"props_copy" - Specifies "copy properties" on operations supporting user properties constraints

+ +

+This properties constraint does not constrain the operation, but instructs it to +attach the properties from the primary input to the output objects. +

+See also props_ne and props_eq. +

+

"props_eq" - Specifies "same properties" for operations supporting user properties constraints

+ +

+Some operations such as boolean AND support properties constraints. By giving +a "props_eq" constraint, the operation is performed only on shapes with the same +properties, where "properties" stands for the full set of key/value pairs. +

+Note that you have to enable properties explicitly or generate properties (e.g. +with the DRCLayer#nets method). +

+Example: +

+

+connect(metal1, via1)
+connect(via1, metal2)
+... further connect statements
+
+m1m2_overlap_connected = metal1.nets.and(metal2, props_eq) 
+
+

+"props_eq" can be combined with props_copy. In this case, properties +are transferred to the output shapes and can be used in further processing: +

+

+m1m2_overlap_connected = metal1.nets.and(metal2, props_eq + props_copy) 
+
+

+See also props_ne. +

+

"props_ne" - Specifies "different properties" for operations supporting user properties constraints

+ +

+Some operations such as boolean AND support properties constraints. By giving +a "props_ne" constraint, the operation is performed only on shapes with different +properties, where "properties" stands for the full set of key/value pairs. +

+Note that you have to enable properties explicitly or generate properties (e.g. +with the DRCLayer#nets method). +

+Example: +

+

+connect(metal1, via1)
+connect(via1, metal2)
+... further connect statements
+
+m1m2_overlap_not_connected = metal1.nets.and(metal2, props_ne)
+
+

+"props_ne" can be combined with props_copy. In this case, properties +are transferred to the output shapes and can be used in further processing: +

+

+m1m2_overlap_connected = metal1.nets.and(metal2, props_ne + props_copy) 
+
+

+See also props_eq. +

"rectangles" - Selects all polygons which are rectangles

Usage:

diff --git a/src/doc/doc/about/drc_ref_layer.xml b/src/doc/doc/about/drc_ref_layer.xml index a8e8061e9..4dbd218fa 100644 --- a/src/doc/doc/about/drc_ref_layer.xml +++ b/src/doc/doc/about/drc_ref_layer.xml @@ -61,11 +61,12 @@ is "
xor". See there for a description of the function.

Usage:

    -
  • layer.and(other)
  • +
  • layer.and(other [, prop_constraint ])

The method computes a boolean AND between self and other. -It is an alias for the "&" operator. +It is an alias for the "&" operator which lacks the ability +to specify a properties constraint.

This method is available for polygon and edge layers. If the first operand is an edge layer and the second is a polygon layer, the @@ -92,6 +93,14 @@ polygons will be written to the output (labels: red, input2: blue): +

+When a properties constraint is given, the operation is performed +only between shapes with the given relation. Together with the +ability to provide net-annotated shapes through the nets method, this +allows constraining the boolean operation to shapes from the same or +from different nets. +

+See prop_eq, prop_ne and prop_copy for details.

"andnot" - Computes Boolean AND and NOT results at the same time

@@ -343,7 +352,7 @@ of the layer's data.

Usage:

    -
  • layer.drc(expression)
  • +
  • layer.drc(expression [, prop_constraint ])

This method implements the universal DRC which offers enhanced abilities, @@ -710,6 +719,24 @@ Note that the first line prepares the operation, but does not execute the area c or the boolean operation. But when the "drc" function executes the loop over the primaries it will only compute the area once per primary as it is represented by the same Ruby object.

+

Properties constraints

+

+The method can be given a properties constraint so that it is only performed +between shapes with the same or different user properties. Note that properties +have to be enabled or generated (e.g. through the DRCLayer#nets method) before they can +be used. +

+Example: +

+

+connect(metal1, via1)
+... 
+
+space_not_connected = metal1.nets.drc(space < 0.4.um, props_ne)
+
+

+See props_eq, props_ne and props_copy for details. +

Outlook

DRC expressions are quite rich and powerful. They provide a more intuitive way of @@ -1639,6 +1666,32 @@ i.e. before computing the length, the edges are merged unless raw mode is chosen (see raw). Hence in clean mode (see clean), overlapping edges are not counted twice.

+

"map_props" - Selects properties with certain keys and allows key mapping

+ +

Usage:

+
    +
  • layer.map_props({ key => key_new, .. })
  • +
+

+Similar to select_props, this method will map or filter properties and +and take the values from certain keys. In addition, this method allows +mapping keys to new keys. Specify a hash argument with old to new keys. +

+Property values with keys not listed in the hash are removed. +

+Note that this method returns a new layer with the new properties. The +original layer will not be touched. +

+For example to map key 2 to 1 (integer name keys) and ignore other keys, +use: +

+

+layer1 = input(1, 0, enable_properties)
+layer1_mapped = layer1.map_props({ 2 => 1 })
+
+

+See also select_props and remove_props. +

"merge" - Merges the layer (modifies the layer)

Usage:

@@ -1740,6 +1793,53 @@ The following images shows the effect of the "moved" method:

+

"nets" - Pulls net shapes from selected or all nets, optionally annotating nets with properties

+ +

Usage:

+
    +
  • layer.nets
  • +
  • layer.nets(net_filter)
  • +
  • layer.nets(circuit_filter, net_filter)
  • +
  • layer.nets(netter, ...)
  • +
  • layer.nets(prop(key), ...)
  • +
  • layer.nets(prop(key), ...)
  • +
+

+This method needs a layer that has been used in a connect statement. +It will take the shapes corresponding to this layer for all or selected nets +and attach the net identity in form of a user property. +

+This way, the resulting shapes can be used in property-constrained boolean operations +or DRC checks to implement operations in connected or non-connected mode. +

+A glob-style name pattern can be supplied to filter nets. Nets are always +complete - subnets from subcircuits are not selected. The net name is taken from +the net's home circuit (to topmost location where all net connections are formed). +You can specify a circuit filter to select nets from certain circuits only or +give a Circuit object explicitly. +

+

+connect(metal1, via1)
+connect(via1, metal2)
+
+metal1_all_nets = metal1.nets
+metal1_vdd      = metal1.nets("VDD")
+metal1_vdd      = metal1.nets("TOPLEVEL", "VDD")
+
+

+By default, the property key used for the net identity is numerical 0 (integer). You +can change the key by giving a property key with the "prop" qualifier. Using "nil" for the key +will disable properties: +

+

+metal1_vdd = metal1.nets("VDD", prop(1))
+# disables properties:
+metal1_vdd = metal1.nets("VDD", prop(nil))
+
+

+If a custom netter object has been used for the construction of the +connectivity, pass it to the "nets" method among the other arguments. +

"non_rectangles" - Selects all polygons from the input which are not rectangles

Usage:

@@ -1785,7 +1885,7 @@ This feature has been introduced in version 0.23.2.

Usage:

    -
  • layer.not(other)
  • +
  • layer.not(other [, prop_constraint ])

The method computes a boolean NOT between self and other. @@ -1816,6 +1916,14 @@ written to the output (labels: red, input2: blue): +

+When a properties constraint is given, the operation is performed +only between shapes with the given relation. Together with the +ability to provide net-annotated shapes through the nets method, this +allows constraining the boolean operation to shapes from the same or +from different nets. +

+See prop_eq, prop_ne and prop_copy for details.

"not_covering" - Selects shapes or regions of self which do not cover (enclose) one or more shapes from the other region

@@ -2390,6 +2498,19 @@ This method is available for polygon layers. By default "merged" semantics appli i.e. all polygons are merged before rectilinear polygons are selected (see
clean and raw). non_rectilinear will select all non-rectangles.

+

"remove_props" - Returns a new layer with all properties removed

+ +

Usage:

+
    +
  • layer.remove_props
  • +
+

+This method will drop all user properties from the layer. +Note that a new layer without properties is returned. The +original layer stays untouched. +

+See also select_props and map_props. +

"rotate" - Rotates a layer (modifies the layer)

Usage:

@@ -2672,6 +2793,42 @@ is
overlapping.

This method is available for polygons only.

+

"select_props" - Enables or selects properties from a property-annotated layer

+ +

Usage:

+
    +
  • layer.select_props(keys)
  • +
+

+This method will select specific property keys +from layers. It returns a new layer with the new properties. The +original layer is not modified. +

+You can specify the user property keys (names) to use. As user properties +in general are a set of key/value pairs and may carry multiple values +under different keys, this feature can be handy to filter out a specific +aspect. To get only the values from key 1 (integer), use: +

+

+layer1 = input(1, 0, enable_properties)
+layer1_filtered = layer1.select_props(1)
+
+

+To get the combined key 1 and 2 properties, use: +

+

+layer1 = input(1, 0, enable_properties)
+layer1_filtered = layer1.select_props(1, 2)
+
+

+Without any arguments, this method will remove all properties. +Note that you can directly filter or map properties on input +which is more efficient than first loading all and then selecting some +properties. See DRCSource#input for details. +

+map_props is a way to change property keys and remove_props +will entirely remove all user properties. +

"sep" - An alias for "separation"

Usage:

@@ -3230,6 +3387,8 @@ but is more intuitive, as "projecting" is written with a condition, like Double-bounded ranges are also available, like: "0.5 <= projecting < 2.0".
  • transparent : performs the check without shielding (polygon layers only)
  • shielded : performs the check with shielding (polygon layers only)
  • +
  • props_eq , props_ne , props_copy : (only props_copy applies to width check) - +see "Properties constraints" below.
  • Note that without the angle_limit, acute corners will always be reported, since two @@ -3292,6 +3451,44 @@ you try to check the distance between features of B vs. A, you cannot use shield because B features which are identical to A features will shield those entirely.

    Shielding is enabled by default, but can be switched off with the "transparent" option. +

    +

    Properties constraints (available on intra-polygon checks such as space, sep etc.)

    +

    +This feature is listed here, because this documentation is generic and used for other checks +as well. props_eq and props_ne are not available on 'width' or 'notch' as these apply to intra-polygon checks - when +pairs of different polygons are involved - something that 'width' or 'notch' does need. +

    +With properties constraints, the check is performed between shapes with the same +or different properties. "properties" refers to the full set of key/value pairs +attached to a shape. +

    +Property constraints are specified by adding props_eq or props_ne to the arguments. +If these literals are present, only shapes with same of different properties are +involved in the check. In connection with the net annotation feature this allows +checking space between connected or disconnected shapes for example: +

    +

    +connect(metal1, via1)
    +... 
    +
    +# attaches net identity as properties
    +metal1_nets = metal1.nets
    +
    +space_not_connected = metal1_nets.space(0.4.um, props_ne)
    +space_connected     = metal1_nets.space(0.4.um, props_eq)
    +
    +

    +props_copy is a special properties constraint that does not alter the behaviour of +the checks, but copies the primary shape's properties to the output markers. +This constraint is applicable to width and notch checks too. The effect is that +the original polygon's properties are copied to the error markers. +props_copy can be combined with props_eq and props_ne to copy the original +shape's properties to the output too: +

    +

    +space_not_connected = metal1_nets.space(0.4.um, props_ne + props_copy)
    +space_connected     = metal1_nets.space(0.4.um, props_eq + props_copy)
    +

    "with_angle" - Selects edges by their angle

    diff --git a/src/doc/doc/about/drc_ref_source.xml b/src/doc/doc/about/drc_ref_source.xml index b7947707b..74d119bcb 100644 --- a/src/doc/doc/about/drc_ref_source.xml +++ b/src/doc/doc/about/drc_ref_source.xml @@ -171,6 +171,7 @@ source.global_transform(shift(0, 100.um), rotate(90.0))
  • source.input(layer, datatype)
  • source.input(layer_into)
  • source.input(filter, ...)
  • +
  • source.input(props_spec, ...)
  • Creates a layer with the shapes from the given layer of the source. @@ -209,6 +210,21 @@ is required.

    "input" without any arguments will create a new, empty original layer.

    +If you want to use user properties - for example with properties constraints in DRC checks - +you need to enable properties on input: +

    +

    +input1_with_props = input(1, 0, enable_props)
    +
    +

    +You can also filter or map property keys, similar to the functions available on +layers (DRCLayer#map_props, DRCLayer#select_props). For example to select +property values with key 17 (numerical) only, use: +

    +

    +input1_with_props = input(1, 0, select_props(17))
    +
    +

    Use the global version of "input" without a source object to address the default source.

    "labels" - Gets the labels (texts) from an input layer

    diff --git a/src/doc/doc/manual/drc_runsets.xml b/src/doc/doc/manual/drc_runsets.xml index a8db5cb35..971bf9b79 100644 --- a/src/doc/doc/manual/drc_runsets.xml +++ b/src/doc/doc/manual/drc_runsets.xml @@ -6,6 +6,10 @@ DRC Runsets + + + + @@ -1137,5 +1141,205 @@ puts poly.is_deep? # -> false case this will lead to flattening of the layout and loss of hierarchy.

    +

    DRC and user properties

    + +

    + The DRC feature has some support for user properties. User properties are sets of + key/value pairs attached to shapes. This is a standard feature of KLayout and GDS/OASIS. + The GDS format supports numerical (positive integer) keys and string values while OASIS + supports more types of keys and values - specifically string keys. +

    + +

    + For DRC, the property set attached to a shape is regarded as a whole. + The DRC can act on these properties in specific ways: +

    + +
      +
    • Ignore properties: this is the default mode
    • +
    • Use properties: configure operations such as checks and some boolean operations to + only consider shapes with the same or different properties
    • +
    • Map/filter: change property keys/sets or remove them
    • +
    • Transfer properties: through operations, e.g. "size" or "with_..." selectors
    • +
    + +

    + Specifically, DRC functions can also generate properties. Currently there is + only the "nets" method which attaches net identity information to shapes + involved in a "connect" statement. + This feature opens a path to implementing "connected" or "unconnected" mode + boolean operations and DRC checks. +

    + +

    + As of this writing, user property support is somewhat experimental. + User properties support has a huge potential, so there is more to come. +

    + +

    + Currently, the following operations can be conditioned to act on shapes with same + or different properties: +

    + +
      +
    • Polygon boolean operations: "and", "not" and "andnot"
    • +
    • Polygon-mode DRC checks such as "separation", "space", "isolated" etc.
    • +
    + +

    + A variety of operations can transfer properties, i.e. edge-pair-to-polygon, edge-pair-to-edges, + polygon-to-edges, edge-to-polygon, some filters, the "size" function. It is planned + to enable most features to transfer properties where applicable. +

    + +

    + Property generation is supported currently by: +

    + +
      +
    • Reading properties from input layouts
    • +
    • Using the "nets" feature to generate net identity properties.
    • +
    + +

    + Property manipulation is supported in a very basic way: properties can be removed + entirely from a layer or certain property keys can be selected and optionally + mapped to a different key. + Property values cannot be manipulated currently. +

    + +

    + In general, once a layer has properties, shapes with different properties are + regarded as non-interacting. When shapes are merged, only groups of shapes + with the same properties are merged into bigger chunks. This applies to polygons + and edges. This can have the strange consequence that after merge, still + polygons may overlap. Note that this only applies to the case with properties. + The normal behavior is not changed. +

    + +

    Reading user properties

    + +

    + By default, user properties are not read into the shape containers. + You need to enable them explicitly: +

    + +
    l1 = input(1, 0, enable_props)
    + +

    + At this point you can select certain keys from the set of properties. For example + to select only values with key 17 and 18 (numerical), use: +

    + +
    l1 = input(1, 0, select_props(17, 18))
    + +

    + You can also select and map keys to other keys, like this: +

    + +
    l1 = input(1, 0, map_props({ 17 => 1, 18 => 18 }))
    + +

    + This will map values with key 17 to 1 and read those from 18 while + maintaining the key. Values with other keys are ignored. + See input function documentation + for more details. +

    + +

    Manipulating properties

    + +

    + Once you have a layer with properties, you can remove them: +

    + +
    layer_without_properties = layer.remove_props
    + +

    + You can also apply select_props or map_props to filter values + with certain keys or map keys: +

    + +
    reduced_layer = layer.select_props(17, 18)
    +reduced_layer = layer.map_props({ 17 => 1, 18 => 18 })
    + +

    Generating properties as net identities

    + +

    + The most important application is to use the nets method to + generate net identity properties: +

    + +
    connect(metal1, via1)
    +connect(via1, metal2)
    +
    +metal1_nets = metal1.nets
    + +

    + By default, a unique net identifier (a tuple of circuit and net name) is generated + on property key 0. You can specify the key as well: +

    + +
    metal1_nets = metal1.nets(prop(17))
    + +

    + The "nets" function has a number of options, specifically you can filter certain + nets (by name or circuit + name). This makes the "nets" function useful for other + purposes too. If you do not need properties then, specify "nil" as the property key: +

    + +
    metal1_vdd_net = metal1.nets(prop(nil), "VDD")
    + +

    Using properties in checks and boolean operations

    + +

    + The main purpose of properties is to use them in operations. + To confine a boolean operation to shapes with different properties, + use the props_ne keyword. To confine a boolean operation to shapes + with the same properties, use props_eq: +

    + +
    connect(metal1, via1)
    +connect(via1, metal2)
    +
    +metal1_nets = metal1.nets
    +metal2_nets = metal2.nets
    +
    +metal1_over_metal2_connected = metal1_nets.and(metal2_nets, props_eq)
    +metal1_over_metal2_unconnected = metal1_nets.and(metal2_nets, props_ne)
    + +

    + You can also instruct this operation to emit the original properties + on the output with props_copy: +

    + +
    result_with_props = metal1_nets.and(metal2_nets, props_eq + props_copy)
    + +

    + Similarly, properties can participate in checks: +

    + +
    connect(metal1, via1)
    +connect(via1, metal2)
    +
    +metal1_nets = metal1.nets
    +metal2_nets = metal2.nets
    +
    +metal1_space_connected = metal1_nets.space(0.4.um, props_eq)
    +metal1_space_unconnected = metal1_nets.space(1.um, props_ne)
    + +

    + "props_eq", "props_ne" and "props_copy" are also available on the + generic DRC function (drc), which opens new options, e.g. + detecting potential short locations ("critical area") between unconnected nets: +

    + +
    connect(metal1, via1)
    +connect(via1, metal2)
    +
    +metal1_nets = metal1.nets
    +metal2_nets = metal2.nets
    +
    +critical_area = l1_nets.drc(primary.sized(0.2.um) & foreign.sized(0.2.um), props_ne)
    + 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 073719900..624f0d506 100644 --- a/src/drc/drc/built-in-macros/_drc_cop_integration.rb +++ b/src/drc/drc/built-in-macros/_drc_cop_integration.rb @@ -382,7 +382,7 @@ module DRC # # The method can be given a properties constraint so that it is only performed # between shapes with the same or different user properties. Note that properties - # have to be enabled or generated (e.g. through the \nets method) before they can + # have to be enabled or generated (e.g. through the \DRCLayer#nets method) before they can # be used. # # Example: @@ -392,9 +392,9 @@ module DRC # ... # # space_not_connected = metal1.nets.drc(space < 0.4.um, props_ne) - # @code + # @/code # - # See \global#prop_eq, \global#prop_ne and \global#prop_copy for details. + # See \global#props_eq, \global#props_ne and \global#props_copy for details. # # @h3 Outlook @/h3 # diff --git a/src/drc/drc/built-in-macros/_drc_layer.rb b/src/drc/drc/built-in-macros/_drc_layer.rb index 0747afedf..dd6297364 100644 --- a/src/drc/drc/built-in-macros/_drc_layer.rb +++ b/src/drc/drc/built-in-macros/_drc_layer.rb @@ -3690,7 +3690,7 @@ CODE # @li @b transparent @/b: performs the check without shielding (polygon layers only) @/li # @li @b shielded @/b: performs the check with shielding (polygon layers only) @/li # @li @b props_eq @/b, @b props_ne @/b, @b props_copy @/b: (only props_copy applies to width check) - - # see "Properties constraints" below. + # see "Properties constraints" below. @/li # @/ul # # Note that without the angle_limit, acute corners will always be reported, since two @@ -3778,7 +3778,7 @@ CODE # # space_not_connected = metal1_nets.space(0.4.um, props_ne) # space_connected = metal1_nets.space(0.4.um, props_eq) - # @code + # @/code # # \props_copy is a special properties constraint that does not alter the behaviour of # the checks, but copies the primary shape's properties to the output markers. @@ -3790,7 +3790,7 @@ CODE # @code # space_not_connected = metal1_nets.space(0.4.um, props_ne + props_copy) # space_connected = metal1_nets.space(0.4.um, props_eq + props_copy) - # @code + # @/code # # %DRC% @@ -4882,7 +4882,7 @@ CODE end # %DRC% - # @name net + # @name nets # @brief Pulls net shapes from selected or all nets, optionally annotating nets with properties # @synopsis layer.nets # @synopsis layer.nets(net_filter)