palaniappan-r's picture
Add html datasources
703f5e6 verified
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- Meta -->
<meta name="Description" content="KLayout layout viewer and editor project page" />
<meta name="Keywords" content="KLayout OASIS GDS2 viewer editor layout semiconductor mask chip design" />
<meta name="abstract" content="KLayout is a free layout viewer and editor for several formats commonly used in the semiconductor industry to transfer layout data" />
<meta name="URL" content="https://www.klayout.de/" />
<meta name="Author" content="Matthias Koefferlein" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>KLayout Layout Viewer And Editor</title>
<!-- General -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.klayout.de/news.xml"/>
<link rel="stylesheet" type="text/css" href="https://www.klayout.de/format.css?v2.0"/>
<link rel="shortcut icon" href="https://www.klayout.de/favicon.ico"/>
<!-- Fonts -->
<link rel="stylesheet" type="text/css" href="https://www.klayout.de/fonts.css"/>
<!-- jQuery -->
<script src="https://www.klayout.de/jquery-3.4.1.min.js"></script>
<!-- bootstrap -->
<link href="https://www.klayout.de/bootstrap-4.3.1-dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://www.klayout.de/bootstrap-4.3.1-dist/js/bootstrap.min.js"></script>
</head>
<body>
<div class="klayout-header">
<div class="container mb-5">
<nav class="navbar navbar-dark navbar-expand-lg">
<a class="navbar-brand" href="https://www.klayout.de"><img src="https://www.klayout.de/klayout.png" srcset="https://www.klayout.de/klayout-x2.png 2x" alt="KLayout"></a>
<div class="collapse navbar-collapse" id="navbarToggleExternalContent">
<ul class="navbar-nav ml-auto mr-auto">
<li class="nav-item dropdown active mr-4">
<a class="nav-link dropdown-toggle klayout-menu" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
About
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="https://www.klayout.de/intro.html">KLayout Project</a>
<a class="dropdown-item" href="https://www.klayout.de/doc.html">Documentation</a>
<a class="dropdown-item" href="https://www.klayout.de/galleries.html">Galleries</a>
<a class="dropdown-item" href="https://www.klayout.de/credits.html">Credits</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="https://www.klayout.de/contact.html">Contact</a>
<a class="dropdown-item" href="https://www.klayout.de/impressum.html">Impressum / Imprint</a>
<a class="dropdown-item" href="https://www.klayout.de/privacy_policy.html">Datenschutz / Privacy Policy</a>
</div>
</li>
<li class="nav-item active mr-4">
<a class="nav-link klayout-menu" href="https://www.klayout.de/build.html">Get KLayout</a>
</li>
<li class="nav-item active mr-4">
<a class="nav-link klayout-menu" href="https://sami.klayout.org">Package Index</a>
</li>
<li class="nav-item active mr-5">
<a class="nav-link klayout-menu" href="https://www.klayout.de/forum">Forum</a>
</li>
<li class="nav-item active">
<span class="nav-link klayout-menu">
<a href="https://f-si.org"><img src="https://www.klayout.de/f-si_logo_32h_w.png" border="0" title="Free Silicon Foundation" alt="F-Si"/></a>
<a class="ml-4" href="https://github.com/KLayout"><img src="https://www.klayout.de/GitHub-Mark-32px-white.png" border="0" title="KLayout on GitHub" alt="GitHub"/></a>
</span>
</li>
</ul>
</div>
<!-- collapse button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</nav>
</div>
</div>
<div class="container">
<h1>DRC Function Internals</h1>
<ul>
<li><a href="#drc_function_details">DRC Function Details</a></li>
<li><a href="#edge_orientation">Edge Orientation and Edge-based Checks</a></li>
</ul>
<p>
This document describes some of the DRC functions in detail, specifically with respect to
deep mode and pre-merge behavior.
</p>
<a name="drc_function_details"/>
<h2>DRC Function Details</h2>
<p>
In the table below <b>A</b> is for the first operand in binary operators of <tt>self</tt> for methods.
<b>B</b> is for the second operand or the first method argument. For example:
</p>
<pre>
# A is self
result = A.interacting(B)
# A is first operand in binary operators
result = A - B
</pre>
<p>
Further columns include:
</p>
<ul>
<li><b>Type</b>: layers can be polygon, edge, edge pair or text layers. Depending on
the type, operations can behave differently.</li>
<li><b>Pre-merge</b>: some operations mandate pre-merging. Pre-merging means, that
clusters of shapes are combined into larger polygons and internal edges are removed.
After pre-merge, polygons to not touch or overlap. Pre-merged polygons are
placed in the hierarchy on the first level where these polygons are complete.
Pre-merging therefore often accounts for hierarchy degradation. Pre-merging
can add a considerable performance overhead.<br/>
For edge layers, pre-merging is also applied. In that case, collinear edges are
combined into single ones.<br/>
Pre-merging is not applied to layers that are merged already, specifically
layers that a the result of an operation that delivers merged layers. Pre-merging
is also referred to as "merged semantics" and can be suppressed by using "raw" mode
(merged semantics off).</li>
<li><b>Primary input</b>: the primary input of an operation determines the
hierarchy level on which the results are evaluated. Less shapes on the primary
layer mean less work for the CPU. It can be beneficial to use the more hierarchical
layer for the primary input as this means that evaluation will happen deeper
inside the hierarchy and therefore potentially with a better hierarchy utilization.</li>
<li><b>Range</b>: some operations have an interaction range - that is the distance
by which the function needs to search for neighbor shapes it has to include.
Longer interaction ranges mean more search effort and potentially higher complexity.
For a uniform shape density complexity increases with the square of the range.</li>
</ul>
<p>
Please see the comment column for further details.
</p>
<table>
<tr><th>Function</th><th>Type</th><th>Pre-merge</th><th>Result merged</th><th>Range</th><th>Primary input</th><th>Comment</th></tr>
<tr>
<td><tt>with_*</tt> and <tt>without_*</tt></td>
<td>polygon or edge</td>
<td>yes</td>
<td>yes</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Polygon predicates (<tt>rectangles</tt>, <tt>squares</tt>, <tt>rectilinear</tt> and related <tt>non_*</tt> methods)</td>
<td>polygon</td>
<td>yes</td>
<td>yes</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>holes</tt> and <tt>hulls</tt></td>
<td>polygon</td>
<td>yes</td>
<td>no</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>end_segments</tt>, <tt>start_segments</tt> and <tt>centers</tt></td>
<td>edge</td>
<td>yes</td>
<td>no</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>extended</tt>, <tt>extended_in</tt> and <tt>extended_out</tt></td>
<td>edge</td>
<td>yes</td>
<td>no</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>edges</tt></td>
<td>polygon</td>
<td>yes</td>
<td>yes</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>first_edges</tt> and <tt>second_edges</tt></td>
<td>edge pair</td>
<td>n/a</td>
<td>n/a</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>bbox</tt></td>
<td>any</td>
<td>no</td>
<td>no</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>area</tt>, <tt>perimeter</tt>, <tt>is_box?</tt> and <tt>length</tt></td>
<td>polygon</td>
<td>yes</td>
<td>n/a</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>flatten</tt></td>
<td>any</td>
<td>no</td>
<td>no</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>select</tt>, <tt>each</tt> and <tt>collect*</tt></td>
<td>polygon or edge</td>
<td>yes</td>
<td>yes</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>rounded_corners</tt></td>
<td>polygon</td>
<td>yes</td>
<td>yes</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>smoothed</tt></td>
<td>polygon</td>
<td>yes</td>
<td>yes</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>corners</tt></td>
<td>polygon</td>
<td>yes</td>
<td>yes</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>middle</tt></td>
<td>polygon</td>
<td>yes</td>
<td>yes</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>extent_refs</tt></td>
<td>polygon</td>
<td>yes</td>
<td>yes</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>ongrid</tt></td>
<td>polygon</td>
<td>yes</td>
<td>no</td>
<td></td>
<td></td>
<td>Reverts to flat mode for anisotropic grids.</td>
</tr>
<tr>
<td><tt>odd_polygons</tt></td>
<td>polygon</td>
<td>no</td>
<td>no</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>snap</tt> and <tt>snapped</tt></td>
<td>polygon</td>
<td>yes</td>
<td>no</td>
<td></td>
<td></td>
<td>Creates cell variants. Reverts to flat mode for anisotropic grids.</td>
</tr>
<tr>
<td><tt>and</tt> and <tt>not</tt> (<tt>&amp;</tt> and <tt>-</tt> operators)</td>
<td>polygon and edge</td>
<td>no</td>
<td>no</td>
<td>0</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>andnot</tt></td>
<td>polygon and edge</td>
<td>no</td>
<td>no</td>
<td>0</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>xor</tt> (<tt>^</tt> operator)</td>
<td>polygon and edge</td>
<td>no</td>
<td>no</td>
<td>0</td>
<td>both</td>
<td>Basically implemented as <tt>(A-B)+(B-A)</tt>.</td>
</tr>
<tr>
<td><tt>or</tt> (<tt>|</tt> operator)</td>
<td>polygon and edge</td>
<td>no</td>
<td>yes</td>
<td>0</td>
<td>both</td>
<td>Basically implemented as <tt>(A+B).merged</tt>.</td>
</tr>
<tr>
<td><tt>join</tt> (<tt>+</tt> operator)</td>
<td>polygon and edge</td>
<td>no</td>
<td>no</td>
<td>0</td>
<td>both</td>
<td>Cheap operation. Performs hierarchy mapping of B to A in case both inputs come from different hierarchies.</td>
</tr>
<tr>
<td><tt>covering</tt> and related (<tt>not_covering</tt>, <tt>split_covering</tt>, <tt>select_covering</tt>, <tt>select_not_covering</tt>)</td>
<td>polygon</td>
<td>yes (A, B if counting)</td>
<td>yes</td>
<td>0</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>overlapping</tt> and related (<tt>not_overlapping</tt>, <tt>split_overlapping</tt>, <tt>select_overlapping</tt>, <tt>select_not_overlapping</tt>)</td>
<td>polygon</td>
<td>yes (A, B if counting)</td>
<td>yes</td>
<td>0</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>interacting</tt> and related (<tt>not_interacting</tt>, <tt>split_interacting</tt>, <tt>select_interacting</tt>, <tt>select_not_interacting</tt>)</td>
<td>polygon and edge</td>
<td>yes (A, B if counting)</td>
<td>yes</td>
<td>0</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>pull_interacting</tt></td>
<td>polygon, edge and text</td>
<td>yes (B)</td>
<td>yes</td>
<td>0</td>
<td>A</td>
<td>Can be used to re-hierarchise <b>B</b> along hierarchy of <b>A</b> (put B into raw mode to disable merging).</td>
</tr>
<tr>
<td><tt>pull_overlapping</tt></td>
<td>polygon</td>
<td>yes (B)</td>
<td>yes</td>
<td>0</td>
<td>A</td>
<td>Can be used to re-hierarchise <b>B</b> along hierarchy of <b>A</b> (put B into raw mode to disable merging).</td>
</tr>
<tr>
<td><tt>pull_inside</tt></td>
<td>polygon</td>
<td>yes (A, B)</td>
<td>yes</td>
<td>0</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>inside</tt> and related (<tt>not_inside</tt>, <tt>split_inside</tt>, <tt>select_inside</tt>, <tt>select_not_inside</tt>)</td>
<td>polygon and edge</td>
<td>yes (A)</td>
<td>yes</td>
<td>0</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>in</tt> and related (<tt>not_in</tt>, <tt>in_and_out</tt>)</td>
<td>polygon and edge</td>
<td>yes (A, B)</td>
<td>yes</td>
<td>0</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>intersections</tt></td>
<td>edge</td>
<td>no</td>
<td>no</td>
<td>0</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>inside_part</tt>, <tt>outside_part</tt> and <tt>inside_outside_part</tt></td>
<td>edge (A), polygon (B)</td>
<td>no</td>
<td>no</td>
<td>0</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>width</tt></td>
<td>polygon</td>
<td>yes</td>
<td>n/a</td>
<td>0</td>
<td></td>
<td>Single polygon check, no neighbors needed.</td>
</tr>
<tr>
<td><tt>space</tt></td>
<td>polygon</td>
<td>no/yes</td>
<td>n/a</td>
<td>check value</td>
<td></td>
<td>Pre-merge is needed for: whole edges, rectangle filters, opposite filters and projection filters.</td>
</tr>
<tr>
<td><tt>notch</tt> and <tt>isolated</tt></td>
<td>polygon</td>
<td>yes</td>
<td>n/a</td>
<td>check value</td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>separation</tt>, <tt>overlap</tt>, <tt>enclosing</tt> and <tt>enclosed</tt></td>
<td>polygon</td>
<td>no/yes</td>
<td>n/a</td>
<td>check value</td>
<td>A</td>
<td>Pre-merge of <b>A</b> is needed for: whole edges, rectangle filters, opposite filters and projection filters.
Pre-merge of <b>B</b> is needed for: whole edges.</td>
</tr>
<tr>
<td><tt>width</tt> and <tt>space</tt></td>
<td>edge</td>
<td>yes</td>
<td>n/a</td>
<td>check value</td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>separation</tt>, <tt>overlap</tt>, <tt>enclosing</tt> and <tt>enclosed</tt></td>
<td>edge</td>
<td>yes (A)</td>
<td>n/a</td>
<td>check value</td>
<td>A</td>
<td></td>
</tr>
<tr>
<td><tt>with_density</tt> and <tt>without_density</tt></td>
<td>polygon</td>
<td>yes</td>
<td>n/a</td>
<td></td>
<td></td>
<td>Runs in tiled mode always.</td>
</tr>
<tr>
<td><tt>sized</tt> and <tt>size</tt></td>
<td>polygon</td>
<td>yes</td>
<td>no</td>
<td>sizing value</td>
<td></td>
<td>Cell variants are generated with anisotropic sizing.</td>
</tr>
<tr>
<td><tt>extents</tt></td>
<td>polygon or edge</td>
<td>yes</td>
<td>no</td>
<td>0</td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>scaled</tt> and <tt>scale</tt></td>
<td>any</td>
<td>no</td>
<td>no</td>
<td></td>
<td></td>
<td>Reverts to flat mode.</td>
</tr>
<tr>
<td><tt>rotated</tt> and <tt>rotate</tt></td>
<td>any</td>
<td>no</td>
<td>no</td>
<td></td>
<td></td>
<td>Reverts to flat mode.</td>
</tr>
<tr>
<td><tt>transformed</tt> and <tt>transform</tt></td>
<td>any</td>
<td>no</td>
<td>no</td>
<td></td>
<td></td>
<td>Reverts to flat mode.</td>
</tr>
<tr>
<td><tt>moved</tt> and <tt>move</tt></td>
<td>any</td>
<td>no</td>
<td>no</td>
<td></td>
<td></td>
<td>Cell variants are generated.</td>
</tr>
<tr>
<td><tt>merged</tt> and <tt>merge</tt></td>
<td>polygon or edge</td>
<td>yes</td>
<td>yes</td>
<td>0</td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>select_props</tt>, <tt>map_props</tt> and <tt>remove_props</tt></td>
<td>polygon</td>
<td>no</td>
<td>no</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>nets</tt></td>
<td>polygon</td>
<td>no</td>
<td>no</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><tt>fill</tt></td>
<td>polygon</td>
<td>yes</td>
<td>n/a</td>
<td></td>
<td></td>
<td>Reverts to flat mode.</td>
</tr>
<tr>
<td><tt>drc</tt></td>
<td>polygon</td>
<td>depending on operation</td>
<td>depending on operation</td>
<td>depending on operation</td>
<td>A</td>
<td></td>
</tr>
</table>
<a name="edge_orientation"/>
<h2>Edge Orientation and Edge-based Checks</h2>
<p>
By convention, edges are always oriented with "inside" being on the
"right" side of the edge:
</p>
<img border="0" src="images/edge_orient.svg"/>
<p>
DRC checks ("width", "space" etc.) are available both for polygon and edge layers.
Edges do not have a connection to a polygon and each edge is an individual objects,
so the relation to other edges is purely defined by the orientation of the edge.
The following pictures show these relations:
</p>
<img border="0" src="images/edge_relations.svg"/>
</div>
</body>
</html>