Skip to content

Commit

Permalink
Merge pull request #1648 from KLayout/wip2
Browse files Browse the repository at this point in the history
Wip2
  • Loading branch information
klayoutmatthias authored Mar 23, 2024
2 parents b962514 + d906f87 commit f2d88e4
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/doc/doc/about/drc_ref.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "klayout_doc.dtd">

<!-- generated by /home/matthias/klayout/0.28/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- generated by /home/matthias/klayout/master/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- DO NOT EDIT! -->

<doc>
Expand Down
14 changes: 8 additions & 6 deletions src/doc/doc/about/drc_ref_drc.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "klayout_doc.dtd">

<!-- generated by /home/matthias/klayout/0.28/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- generated by /home/matthias/klayout/master/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- DO NOT EDIT! -->

<doc>
Expand Down Expand Up @@ -358,7 +358,7 @@ The plain function is equivalent to "primary.bbox_width".
This method acts on edge expressions and delivers a specific part of each edge.
See <a href="/about/drc_ref_layer.xml#centers">layer#centers</a> for details about this functionality.
</p>
<a name="corners"/><h2>"corners" - Applies smoothing</h2>
<a name="corners"/><h2>"corners" - Selects corners of polygons</h2>
<keyword name="corners"/>
<p>Usage:</p>
<ul>
Expand All @@ -369,8 +369,10 @@ See <a href="/about/drc_ref_layer.xml#centers">layer#centers</a> for details abo
<p>
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.
a corner is positive for a turn to the left if walking a polygon clockwise
and negative for the turn to the right. Hence positive angles indicate concave
(inner) corners, negative ones indicate convex (outer) corners.
Angles take values between -180 and 180 degree.
</p><p>
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
Expand All @@ -386,8 +388,8 @@ out = in.drc(primary.corners) # equivalent
The following example selects all inner corners:
</p><p>
<pre>
out = in.drc(corners &lt; 0)
out = in.drc(primary.corners &lt; 0) # equivalent
out = in.drc(corners &gt; 0)
out = in.drc(primary.corners &gt; 0) # equivalent
</pre>
</p><p>
The "corners" method is available as a plain function or as a method on <a href="/about/drc_ref_drc.xml">DRC</a> expressions.
Expand Down
7 changes: 1 addition & 6 deletions src/doc/doc/about/drc_ref_global.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "klayout_doc.dtd">

<!-- generated by /home/matthias/klayout/0.28/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- generated by /home/matthias/klayout/master/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- DO NOT EDIT! -->

<doc>
<title>DRC Reference: Global Functions</title>
<keyword name="global"/>
<p>
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.
</p>
<h2-index/>
<a name="angle"/><h2>"angle" - In universal DRC context: selects edges based on their orientation</h2>
<keyword name="angle"/>
Expand Down
7 changes: 2 additions & 5 deletions src/doc/doc/about/drc_ref_layer.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "klayout_doc.dtd">

<!-- generated by /home/matthias/klayout/0.28/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- generated by /home/matthias/klayout/master/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- DO NOT EDIT! -->

<doc>
<title>DRC Reference: Layer Object</title>
<keyword name="Layer"/>
<p>
The layer object represents a collection of polygons, edges or edge pairs.
</p>
<h2-index/>
<a name="&amp;"/><h2>"&amp;" - Boolean AND operation</h2>
<keyword name="&amp;"/>
Expand Down Expand Up @@ -268,7 +265,7 @@ deliver objects that can be converted into polygons. Such objects are of class <
This method produces markers on the corners of the polygons. An angle criterion can be given which
selects corners based on the angle of the connecting edges. Positive angles indicate a left turn
while negative angles indicate a right turn. Since polygons are oriented clockwise, positive angles
indicate concave corners while negative ones indicate convex corners.
indicate concave (inner) corners while negative ones indicate convex (outer) corners
</p><p>
The markers generated can be point-like edges or small 2x2 DBU boxes. The latter is the default.
</p><p>
Expand Down
2 changes: 1 addition & 1 deletion src/doc/doc/about/drc_ref_netter.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "klayout_doc.dtd">

<!-- generated by /home/matthias/klayout/0.28/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- generated by /home/matthias/klayout/master/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- DO NOT EDIT! -->

<doc>
Expand Down
2 changes: 1 addition & 1 deletion src/doc/doc/about/drc_ref_source.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "klayout_doc.dtd">

<!-- generated by /home/matthias/klayout/0.28/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- generated by /home/matthias/klayout/master/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- DO NOT EDIT! -->

<doc>
Expand Down
2 changes: 1 addition & 1 deletion src/doc/doc/about/lvs_ref.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "klayout_doc.dtd">

<!-- generated by /home/matthias/klayout/0.28/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- generated by /home/matthias/klayout/master/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- DO NOT EDIT! -->

<doc>
Expand Down
2 changes: 1 addition & 1 deletion src/doc/doc/about/lvs_ref_global.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "klayout_doc.dtd">

<!-- generated by /home/matthias/klayout/0.28/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- generated by /home/matthias/klayout/master/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- DO NOT EDIT! -->

<doc>
Expand Down
2 changes: 1 addition & 1 deletion src/doc/doc/about/lvs_ref_netter.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "klayout_doc.dtd">

<!-- generated by /home/matthias/klayout/0.28/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- generated by /home/matthias/klayout/master/scripts/drc_lvs_doc/extract_doc.rb -->
<!-- DO NOT EDIT! -->

<doc>
Expand Down
12 changes: 7 additions & 5 deletions src/drc/drc/built-in-macros/_drc_complex_ops.rb
Original file line number Diff line number Diff line change
Expand Up @@ -756,15 +756,17 @@ def smoothed(d, keep_hv = false)

# %DRC%
# @name corners
# @brief Applies smoothing
# @brief Selects corners of polygons
# @synopsis expression.corners
# @synopsis expression.corners(as_dots)
# @synopsis 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.
# a corner is positive for a turn to the left if walking a polygon clockwise
# and negative for the turn to the right. Hence positive angles indicate concave
# (inner) corners, negative ones indicate convex (outer) corners.
# 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
Expand All @@ -780,8 +782,8 @@ def smoothed(d, keep_hv = false)
# The following example selects all inner corners:
#
# @code
# out = in.drc(corners < 0)
# out = in.drc(primary.corners < 0) # equivalent
# out = in.drc(corners > 0)
# out = in.drc(primary.corners > 0) # equivalent
# @/code
#
# The "corners" method is available as a plain function or as a method on \DRC# expressions.
Expand Down
2 changes: 1 addition & 1 deletion src/drc/drc/built-in-macros/_drc_layer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ def _texts_impl(invert, *args)
# This method produces markers on the corners of the polygons. An angle criterion can be given which
# selects corners based on the angle of the connecting edges. Positive angles indicate a left turn
# while negative angles indicate a right turn. Since polygons are oriented clockwise, positive angles
# indicate concave corners while negative ones indicate convex corners.
# indicate concave (inner) corners while negative ones indicate convex (outer) corners
#
# The markers generated can be point-like edges or small 2x2 DBU boxes. The latter is the default.
#
Expand Down
25 changes: 13 additions & 12 deletions src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ LEFDEFReaderState::read_single_map_file (const std::string &path, std::map<std::
size_t max_purpose_str = 15;

if (! ex.try_read_word (w1) || ! ex.try_read_word (w2, "._$,/:") || ! try_read_layers (ex, layers) || ! try_read_layers (ex, datatypes)) {
tl::warn << tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d not understood - skipped")), path, ts.line_number ());
common_reader_warn (tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d not understood - skipped")), path, ts.line_number ()));
continue;
}

Expand All @@ -1143,7 +1143,7 @@ LEFDEFReaderState::read_single_map_file (const std::string &path, std::map<std::
name = "REGIONS_NONE";
lp = RegionsNone;
} else if (w2 != "ALL") {
tl::warn << tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d - ignoring unknowns REGION purpose %s (use FENCE, GUIDE or ALL)")), path, ts.line_number (), w2);
common_reader_warn (tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d - ignoring unknowns REGION purpose %s (use FENCE, GUIDE or ALL)")), path, ts.line_number (), w2));
}

for (std::vector<int>::const_iterator l = layers.begin (); l != layers.end (); ++l) {
Expand Down Expand Up @@ -1176,7 +1176,7 @@ LEFDEFReaderState::read_single_map_file (const std::string &path, std::map<std::

if (*p == "DIEAREA" || *p == "ALL" || *p == "COMP") {

tl::warn << tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: NAME record ignored for entity: %s")), path, ts.line_number (), *p);
common_reader_warn (tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: NAME record ignored for entity: %s")), path, ts.line_number (), *p));

} else {

Expand All @@ -1193,7 +1193,7 @@ LEFDEFReaderState::read_single_map_file (const std::string &path, std::map<std::
if (label_purpose == Pins || label_purpose == LEFPins) {
layer_defs.push_back (std::make_pair (lp.front (), label_purpose == Pins ? Label : LEFLabel));
} else {
tl::warn << tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: NAME record ignored for purpose: %s")), path, ts.line_number (), purpose_to_name (label_purpose));
common_reader_warn (tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: NAME record ignored for purpose: %s")), path, ts.line_number (), purpose_to_name (label_purpose)));
}

} else {
Expand Down Expand Up @@ -1226,7 +1226,7 @@ LEFDEFReaderState::read_single_map_file (const std::string &path, std::map<std::
} else if (w1 == "COMP") {

// ignore "COMP (ALL) ..."
tl::warn << tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: COMP entry ignored")), path, ts.line_number ());
common_reader_warn (tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: COMP entry ignored")), path, ts.line_number ()));

} else {

Expand Down Expand Up @@ -1261,7 +1261,7 @@ LEFDEFReaderState::read_single_map_file (const std::string &path, std::map<std::
if (ex.test (":VOLTAGE:")) {
double f = 0.0;
ex.read (f);
tl::warn << tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: NET voltage constraint ignored for layer %s")), path, ts.line_number (), w1);
common_reader_warn (tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: NET voltage constraint ignored for layer %s")), path, ts.line_number (), w1));
}

} else if (i->second == ViaGeometry) {
Expand All @@ -1284,7 +1284,7 @@ LEFDEFReaderState::read_single_map_file (const std::string &path, std::map<std::

if (i == purpose_translation.end ()) {

tl::warn << tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: purpose %s ignored for layer %s")), path, ts.line_number (), ps, w1);
common_reader_warn (tl::sprintf (tl::to_string (tr ("Reading layer map file %s, line %d: purpose %s ignored for layer %s")), path, ts.line_number (), ps, w1));

} else if (i->second == All) {

Expand Down Expand Up @@ -1364,21 +1364,22 @@ LEFDEFReaderState::open_layer (db::Layout &layout, const std::string &n, LayerPu
m_layers.insert (std::make_pair (std::make_pair (n, LayerDetailsKey (purpose, mask)), ll));

if (ll.empty () && ! has_fallback (purpose)) {
std::string msg;
if (n.empty ()) {
tl::warn << tl::to_string (tr ("No mapping for purpose")) << " '" << purpose_to_name (purpose) << "'" << tl::noendl;
msg = tl::to_string (tr ("No mapping for purpose")) + " '" + purpose_to_name (purpose) + "'";
} else {
tl::warn << tl::to_string (tr ("No mapping for layer")) << " '" << n << "', purpose '" << purpose_to_name (purpose) << "'" << tl::noendl;
msg = tl::to_string (tr ("No mapping for layer")) + " '" + n + "', purpose '" + purpose_to_name (purpose) + "'";
}
if (mask > 0) {
tl::warn << tl::to_string (tr (" Mask ")) << mask << tl::noendl;
msg += tl::to_string (tr (" Mask ")) + tl::to_string (mask);
}
// not printing via size - too confusing?
#if 0
if (via_size != db::DVector ()) {
tl::warn << tl::to_string (tr (" Via size ")) << via_size.to_string () << tl::noendl;
msg += tl::to_string (tr (" Via size ")) + via_size.to_string ();
}
#endif
tl::warn << tl::to_string (tr (" - layer is ignored"));
common_reader_warn (msg + tl::to_string (tr (" - layer is ignored")));
}

return ll;
Expand Down

0 comments on commit f2d88e4

Please sign in to comment.