<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Verification — KLayout</title>
        <link>https://www.klayout.de/forum/</link>
        <pubDate>Sat, 05 Sep 2026 20:00:25 +0000</pubDate>
        <language>en</language>
            <description>Verification — KLayout</description>
    <atom:link href="https://www.klayout.de/forum/categories/verification/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>Checking Edge Separation</title>
        <link>https://www.klayout.de/forum/discussion/2875/checking-edge-separation</link>
        <pubDate>Tue, 09 Jun 2026 15:15:42 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>stockstephanie</dc:creator>
        <guid isPermaLink="false">2875@/forum/discussions</guid>
        <description><![CDATA[<p>Hi!<br />
I am trying to measure the enclosure distance of a well region of a gate (in the length direction specifically). I isolated my gate down to its sides and not its ends so that I can check its separation to the side of the well. However, I am getting only a separation check from the end points. What would be the correct way to go about checking parallel edge separation? Or even just an enclosure check on specific sides of a shape?<br />
Thanks!</p>

<pre><code>GATE_SIDES = GATE.edges.not(OXIDE.edges)
violation = NWELL.edges.separation(GATE_SIDES, 1.0.um, projection) 
</code></pre>
]]>
        </description>
    </item>
    <item>
        <title>DRC for via</title>
        <link>https://www.klayout.de/forum/discussion/2857/drc-for-via</link>
        <pubDate>Fri, 20 Mar 2026 00:27:38 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>alto</dc:creator>
        <guid isPermaLink="false">2857@/forum/discussions</guid>
        <description><![CDATA[<p>klayout 0.30.4</p>

<p>Implementing via check<br />
apparently klayout does not provide a check for via, in the sense the width is fix for instance 0.26um.</p>

<p>The obvious solution will be to check for size &gt; 0.26 and &lt; 0.26.</p>

<p>via1.drc(width &gt; 0.26).output("VIA1.W.1", "VIA1 width &gt; 0.26") (expected true if via width &gt; 0.26um) failed !<br />
via1.drc(width &lt; 0.26).output("VIA1.W.2", "VIA1 width &lt; 0.26") (expected true if via width &lt; 0.26um) works !<br />
or<br />
via1.drc(width != 0.26).output("VIA1.W.3", "VIA1 width != 0.26") (expected true if via width != 0.26um) failed !</p>

<p>projection, no help <br />
Does width work only for &lt; ?</p>

<p>if yes then there is some problem with these examples</p>

<p>errors = in.drc(width &lt; 0.2.um)<br />
errors = in.drc(width &lt;= 0.2.um)<br />
errors = in.drc(width &gt; 0.2.um)<br />
errors = in.drc(width &gt;= 0.2.um)<br />
errors = in.drc(width == 0.2.um)<br />
errors = in.drc(width != 0.2.um)<br />
errors = in.drc(0.1.um &lt;= width &lt; 0.2.um)</p>
]]>
        </description>
    </item>
    <item>
        <title>Drc spacing based on layer connectivity</title>
        <link>https://www.klayout.de/forum/discussion/2852/drc-spacing-based-on-layer-connectivity</link>
        <pubDate>Mon, 09 Mar 2026 20:25:57 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>alto</dc:creator>
        <guid isPermaLink="false">2852@/forum/discussions</guid>
        <description><![CDATA[<p>It is common to have rules that depend upon the layer connectivity. Very common is NWELL spacing based on same net or different net.<br />
Does Kayout support this check ?</p>
]]>
        </description>
    </item>
    <item>
        <title>DRC scripts, reports and parallelism</title>
        <link>https://www.klayout.de/forum/discussion/2839/drc-scripts-reports-and-parallelism</link>
        <pubDate>Mon, 19 Jan 2026 10:55:49 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>Scafir</dc:creator>
        <guid isPermaLink="false">2839@/forum/discussions</guid>
        <description><![CDATA[<p>Hi,</p>

<p>Hope you are doing well,</p>

<p>In the context of gf180, I've been experimenting with DRC, how to make it faster and improve quality of life from a GUI user point of view.<br />
My initial issue was the speed of the DRC deck. For a somewhat simple full chip design, deep DRC, I was getting run times of more than 20 minutes on my beefy computer when starting the DRC from the GUI.<br />
I knew that there should be some way to improve this, because CPU utilization was generally low, albeit with some large spikes. That gave me the feeling that the process was memory-bound instead of cpu bound.<br />
The gf180 pdk (same with IHP) also provides a python utility, where each file was run in its own klayout process. This considerably improves speed (~5x), but suffers from a few issues:<br />
1) Each run generates its own reports, checking for DRC clean is a nightmare<br />
2) General layers have to be recomputed each time. While this does not always result in longer run time depending on number of cores, it is a certain limitation. Moreover, the general layers are duplicated in ram for each process, causing a larger memory usage.</p>

<p>I've experimented a bit and implemented my own <a rel="nofollow" href="http://https://github.com/wafer-space/gf180mcu/pull/26" title="DRC approach">DRC approach</a> to try and solve both issues. It is implemented fully in ruby using forks, and has great performance (similar performance as the python script with untapped potential and less RAM usage).</p>

<p>Here are the currently issues preventing it from being merged to upstream PDK</p>

<h3>GUI Cancel</h3>

<p>Due to something in QT/graphics driver panicking when joining threads in GUI, I have to run the forking script in a klayout batch mode process. This means that (1) the project has to be saved to disk before running DRC, but more importantly that (2) there are currently no way of canceling a DRC run from the GUI.<br />
(2) is because it seems there are no cancel flags exposed from the C++ to ruby API. From my understanding, the cancel action causes the C++ side DRC calculation function to throw an exception, which is caught from ruby. In my case, I do not think I can use this approach in a clean manner.</p>

<h3>Report merging and report files</h3>

<p>My first issue with drc reports is that there is currently no way of obtaining one without creating a file. That means that in case of parallel DRC runs, I have to create one temporary file per run, which is not so clean. I implemented a basic functionality allowing to get reports as a string rather than a file <a rel="nofollow" href="http://https://github.com/Scafir/klayout/tree/rdb_string" title="here">here</a>, but I don't think it is very good. I then reverted to using files.</p>

<p>My second and bigger issue is that there is no way of merging report files together, so that it is presented cleanly in the GUI report view.  In the present case, we only need a simple approach, as we are guaranteed that the top cell of all report files is the same. I've implemented this outside klayout <a rel="nofollow" href="https://github.com/Scafir/gf180mcu/blob/c7974dc75c8c2f14526f64c81a5fe0a591cb8017/gf180mcuD/libs.tech/klayout/tech/drc/parallel_rule_checker.rb#L21">here</a>. Beware, that specific part is mainly AI (goal was proof of concept).</p>

<h3>Conclusion</h3>

<p>Do you think that this approach to DRC is sane?<br />
How would you see the cancel functionality implemented? Is there some way I did not think of, or new functionality is need on the klayout side?<br />
Same thing with the report file merging. If you guide me a bit (where to implement this function), I could try to make an MR.</p>

<p>Thanks!</p>
]]>
        </description>
    </item>
    <item>
        <title>Using an exclusion layer in DRC</title>
        <link>https://www.klayout.de/forum/discussion/2848/using-an-exclusion-layer-in-drc</link>
        <pubDate>Thu, 26 Feb 2026 00:57:07 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>remco</dc:creator>
        <guid isPermaLink="false">2848@/forum/discussions</guid>
        <description><![CDATA[<p>Dear support,</p>

<p>I'm using KLayout (version 0.30.1 on Linux) for the DRC.<br />
In photonics, some layers can have complex structures (many curves), and running a DRC on these structures can take many hours (&gt;24 hours), and it is not uncommon that KLayout crashes in the end (because out of memory (&gt;96 GB)).<br />
Therefor, we want to exclude certain areas in a layer from the DRC.<br />
(Even for simple structures, this is necessary because for finding overlaps of polygons within a single layer, it is sometimes allowed to have overlaps at specific locations. In photonics, 2 waveguides in the same layer may sometimes cross each other. So, we want to exclude these areas also from the DRC.)</p>

<p>So, I create a new layer, and place some polygons (the exclusion areas) in it. And I do the DRC check on</p>

<p>layer.not(exclusion_layer)</p>

<p>But this doesn't work, because after the boolean NOT operation, the layer is in 'clean' state, and this causes problems finding the overlaps.</p>

<p>Let me explain this with an example.</p>

<p>The left red cross in the layout are 2 straights (a horizontal and a vertical) in the same layer (layer 1).<br />
I find the overlap with:</p>

<p>layer1 = input(1)<br />
layer1.merged(2).output("Overlap layer1")</p>

<p>This gives the expected overlap.</p>

<p>The right purple 'double' cross in the layout are 2 horizontal straights, and these straights overlap with a vertical straight. These 3 straights are in layer 2. When I run the same check again (without using an exclusion layer), I get 2 overlaps (as expected) Call this the 'top-overlap' and the 'bottom-overlap'.</p>

<p>layer2 = input(2)<br />
layer2.merged(2).output("Overlap layer2")</p>

<p>Now add the exclusion layer (layer 24, green).</p>

<p>exclusion_layer = input(24)</p>

<p>When I run the last overlap test again, I want to find the 'top-overlap', but not the 'bottom-overlap', because the exclusion layer has created a 'hole' at that spot.</p>

<p>layerEx = layer2.not(exclusion_layer)<br />
layerEx.merged(2).output("Overlap layer2 with exclusion layer")</p>

<p>But this doesn't work. The 'bottom-overlap' is gone (good!), but the 'top-overlap' is also gone (bad!).<br />
I discovered that the boolean NOT operation creates a layer in the CLEAN state (the merging has already been<br />
done by the NOT operation). (Calling merged(2) on an already merged layer is pointless.)</p>

<p>layer2.not(exclusion_layer).is_merged?  returns true.</p>

<p>I tried the following, but that didn't work:</p>

<p>layerExRawRaw = input(2).raw.not(input(24).raw)<br />
layerExRawRaw.merged(2).output("Overlap layer2 (RawRaw) with exclusion layer")</p>

<p>How do I use an exclusion layer that only creates 'holes' in another layer, while leaving the rest of that layer unchanged (the layer remains in raw-state)?</p>

<p>(We also need this exclusion layer for other checks than the overlap check.)</p>

<p>Thanks,  Remco</p>

<p>Remark: I also have the GDS file and the DRC file, but this forum blocks uploading these files. The "Attach file" only allows uploading images, which is the same as the "Attach image" button. Looks like a bug?</p>

<p><img src="https://www.klayout.de/forum/uploads/editor/9h/6u3so77lvgpn.png" alt="" title="" /></p>
]]>
        </description>
    </item>
    <item>
        <title>Confusion about mouse_button_pressed_event vs mouse_button_released_event vs mouse_moved_event</title>
        <link>https://www.klayout.de/forum/discussion/2841/confusion-about-mouse-button-pressed-event-vs-mouse-button-released-event-vs-mouse-moved-event</link>
        <pubDate>Tue, 27 Jan 2026 20:49:39 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>taylorn</dc:creator>
        <guid isPermaLink="false">2841@/forum/discussions</guid>
        <description><![CDATA[<p>Hello,</p>

<p>I'm attempting to create a plugin (in Klayout 0.30.5) that loads a second layout if some conditions are triggered, and want to be able to use the plugin there.  I'm having a bit of trouble understanding the structure of plugins and when the mouse_button_pressed_event etc. are actually called.</p>

<p>Here's the relevant skeleton of my code:</p>

<pre><code># $description: test
# $show-in-menu
# $menu-path: tools_menu&gt;end("Test").end

import pya as kl

class PluginTestFactory(kl.PluginFactory):
    def __init__(self):
        self.add_submenu("menu_name", "inset_pos", "title")
        self.register(29318, "plugin_name", "test_plugin")
    def create_plugin(self, manager, dispatcher, view):
        return PluginTest(view)
class PluginTest(kl.Plugin):
    def __init__(self,view):
            self.curr_annot = kl.Annotation()
            self.curr_annot.p1 = kl.DPoint(0,0)
            self.curr_annot.p2 = kl.DPoint(0,0)
            self.curr_annot.fmt = ""
            self.curr_annot.fmt_x = ""
            self.curr_annot.fmt_y = ""
            self.curr_annot.outline = self.curr_annot.OutlineBox
            self.curr_annot.style = self.curr_annot.StyleLine
            view.insert_annotation(self.curr_annot)
    def mouse_button_pressed_event(self, p, buttons, prio):
        print("hello")
    def mouse_button_released_event(self, p, buttons, prio):
        self.match()
    def mouse_moved_event(self, p, buttons, prio):
        self.curr_annot.p2 = p

    def match(self):
        big_menu = kl.QDialog()
        big_menu.layout = kl.QGridLayout()
        containing_layout = kl.QWidget()
        self.layoutwidg = kl.LayoutViewWidget(containing_layout)
        cv = self.layoutwidg.view().create_layout(True)
        viewing_layout = self.layoutwidg.view().cellview(cv).layout()
        big_menu.layout.addWidget(self.layoutwidg,0,0,1,1)
        big_menu.show()

if __name__ == "__main__":
    PluginTestFactory()
</code></pre>

<p>When I click on the Tools&gt;test menu button, a "test_plugin" button appears on the toolbar.  The annotation appears and follows my mouse around before pressing the test_plugin button; I expected the annotation to appear, but the fact that it follows my mouse around implies that the <code>mouse_moved_event</code> is being called implicitly.</p>

<p>When I click the button in the toolbar, the "Basic Editing" pane pops up (why does that happen, by the way? It's annoying.), but no other effects occur; clicking and dragging and releasing does nothing.  But when I open the debugger, I can put a breakpoint on the <code>mouse_button_pressed_event</code> and the <code>mouse_button_released_event</code> lines and it stops at both of them.  If I step past the <code>self.match()</code> call, nothing else happens.</p>

<p>But if I step into the <code>self.match()</code> call and let it run, it opens up the QDialog I asked for.  Within this QDialog, it appears that the mouse_button_pressed_event is completely inactive, whereas the <code>mouse_button_released_event</code> and <code>mouse_moved_event</code> calls are still active (in the sense that it stops at a breakpoint in the <code>mouse_button_released_event</code> function).</p>

<p>This is all very confusing to me, and I would like to understand what's going on.  Is there some sort of infinite recursion being headed off by avoiding the <code>self.match()</code> call when the debugger breakpoint is absent, and is that why it isn't run?</p>

<p>The simplest question that would move me forward is: How do I force the <code>mouse_button_pressed_event</code> to be recognized in the layout in this pop-up window?</p>

<p>Thanks so much!</p>

<p>Noah</p>
]]>
        </description>
    </item>
    <item>
        <title>LVS RuntimeError: &quot;Terminal still connected after removing device&quot;</title>
        <link>https://www.klayout.de/forum/discussion/2840/lvs-runtimeerror-terminal-still-connected-after-removing-device</link>
        <pubDate>Tue, 27 Jan 2026 13:37:30 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>engrvip</dc:creator>
        <guid isPermaLink="false">2840@/forum/discussions</guid>
        <description><![CDATA[<p>I am running LVS in KLayout (version 0.30.5) on layout with IHPpdk.  During the LVS run, I encounter the following error:</p>

<pre><code>RuntimeError: Internal error: Terminal still connected after removing device in device combination: name=4, circuit=LNA_LAY_MAIN, terminal=mim_sub in Netlist::simplify in Executable::execute
.../ihp-sg13g2/libs.tech/klayout/tech/macros/.../lvs/sg13g2.lvs:388:in `simplify'
.../ihp-sg13g2/libs.tech/klayout/tech/macros/.../lvs/sg13g2.lvs:388:in `execute'
/built-in-macros/lvs_interpreters.lym:31:in `instance_eval'
/built-in-macros/lvs_interpreters.lym:31:in `execute'
</code></pre>

<p>I don’t fully understand what this error means. Could someone explain what could cause this “terminal still connected after removing device” error?<br />
Any suggestions on how to debug or fix this ?</p>
]]>
        </description>
    </item>
    <item>
        <title>DRC: get centerline of selected edges</title>
        <link>https://www.klayout.de/forum/discussion/2835/drc-get-centerline-of-selected-edges</link>
        <pubDate>Tue, 23 Dec 2025 09:34:08 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>andyL</dc:creator>
        <guid isPermaLink="false">2835@/forum/discussions</guid>
        <description><![CDATA[<p>I'm able to select Horizontal edges nicly :<br />
TRpairs = TR.drc(width &lt; 6.um).edges.with_angle(90)<br />
I now need to get the centerline between these edges. <br />
I tried a way by using ten centers of the first/second edges but not succeed yet. <br />
Is there a smarter solution to calculate the centerline ?</p>
]]>
        </description>
    </item>
    <item>
        <title>Antenna check using 'evaluate_nets'</title>
        <link>https://www.klayout.de/forum/discussion/2832/antenna-check-using-evaluate-nets</link>
        <pubDate>Tue, 16 Dec 2025 11:54:52 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>mole99</dc:creator>
        <guid isPermaLink="false">2832@/forum/discussions</guid>
        <description><![CDATA[<p>Hello,</p>

<p>We are currently using the <code>evaluate_nets</code> function to implement the antenna checks for gf180mcu.</p>

<p>Here is the current implementation:</p>

<pre><code># ANTENNADIFFSIDEAREARATIO-like antenna check
def antenna_check_gf180mcu(gate, antenna_layer, thickness, limit, n_diode, p_diode, nwell, mf)
  expression = "var garea = area; var darea = area(n_diode) + area(p_diode) + area(nwell); var per = perimeter(antenna_layer) * thickness; "\
    "var ar = per / (garea + mf * darea); skip(ar &lt; limit); "\
    "put('GATE_AREA', garea); put('DIODES_AREA', darea); put('ANT_PERIMETER', per); put('RATIO', ar);"
  variables = { "thickness" =&gt; thickness, "mf" =&gt; mf, "limit" =&gt; limit}
  return evaluate_nets(gate, { "antenna_layer" =&gt; antenna_layer, "n_diode" =&gt; n_diode, "p_diode" =&gt; p_diode, "nwell" =&gt; nwell }, expression, variables)
end
</code></pre>

<p>I have two questions:</p>

<ul>
<li>Is there a way to pass a list of layers?</li>
<li>Is there a way to only issue one antenna violation for all gates on a net?</li>
</ul>

<hr />

<p>For the first question, I tried to adapt the antenna check as follows:</p>

<pre><code># ANTENNADIFFSIDEAREARATIO-like antenna check
def antenna_check_gf180mcu(gate, antenna_layer, thickness, limit, diodes, mf)
  expression = "var garea = area; var darea = 0; diodes.each { |diode| darea += area(diode) }; var per = perimeter(antenna_layer) * thickness; "\
    "var ar = per / (garea + mf * darea); skip(ar &lt; limit); "\
    "put('GATE_AREA', garea); put('DIODES_AREA', darea); put('ANT_PERIMETER', per); put('RATIO', ar);"
  variables = { "thickness" =&gt; thickness, "mf" =&gt; mf, "limit" =&gt; limit}
  return evaluate_nets(gate, { "antenna_layer" =&gt; antenna_layer, "diodes" =&gt; diodes }, expression, variables)
end
</code></pre>

<p>And tried to use it like so:</p>

<pre><code>antenna_check_gf180mcu(thin_gate, metal1, 0.54, 400, [n_diode, p_diode, nwell],  2)
</code></pre>

<p>Unfortunately, I get this error:</p>

<pre><code>ERROR: RuntimeError: 'evaluate_nets': Second argument must be a hash of names and polygon in Executable::execute
</code></pre>

<p>Is there another way of passing a variable number of layers?</p>

<hr />

<p>As for the second question, an antenna violation currently produces two items in the database (gate of nmos and gate of pmos). Is there a way to merge them?</p>

<p><img src="https://www.klayout.de/forum/uploads/editor/20/hvl2r7q5t1v1.png" alt="" title="" /></p>

<p><img src="https://www.klayout.de/forum/uploads/editor/wx/gcgejvl6k50a.png" alt="" title="" /></p>

<p>Thanks!</p>

<p>Leo</p>
]]>
        </description>
    </item>
    <item>
        <title>Extracting device coordinates and obtaining unreduced netlists for Matching/LDE Analysis</title>
        <link>https://www.klayout.de/forum/discussion/2822/extracting-device-coordinates-and-obtaining-unreduced-netlists-for-matching-lde-analysis</link>
        <pubDate>Wed, 26 Nov 2025 10:29:53 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>bunosingye</dc:creator>
        <guid isPermaLink="false">2822@/forum/discussions</guid>
        <description><![CDATA[<p>Hi Matthias and everyone,</p>

<p>I am working on a project involving <strong>Layout Dependent Effect (LDE) and Matching Analysis</strong>. To do this, I need to extract the exact physical location of every single device instance and map these coordinates to the extracted SPICE netlist.</p>

<p><img src="https://www.klayout.de/forum/uploads/editor/mf/ccxiybg70wzg.png" alt="" title="" /></p>

<p>I have performed an LVS run on a Sky130 design (see the attached image of the PMOS layout).</p>

<p><strong>1. Observations regarding Coordinates:</strong><br />
In the <code>results/lvs/pmos_sky130_lvs.lvsdb</code>, I see structure definitions with coordinates (likely in DBU):</p>

<pre><code> D(D$sky130_fd_pr__pfet_01v8 sky130_fd_pr__pfet_01v8
  T(S R(l7 (-110 -300) (95 600)))
  ...
 )
</code></pre>

<p>And in the extracted netlist <code>.cir</code>, I see comments with coordinates in microns:</p>

<pre><code>* device instance $1 r0 *1 2.065,7.57 sky130_fd_pr__pfet_01v8
M$1 VCC VCC VCC VCC ...
</code></pre>

<p><strong>2. The Problem: Device Merging / Reduction</strong><br />
I noticed that the LVS process seems to <strong>merge/combine</strong> extracted devices.<br />
As shown in the attached layout image, I have a multi-finger structure (or multiple separate devices). However, the generated LVS database and the extracted netlist seem to aggregate these into fewer device entries (e.g., <code>M$1</code>, <code>M$2</code>) with combined parameters (total W, combined Areas/Perimeters).</p>

<p>For my analysis, <strong>I need a 1-to-1 mapping</strong>. I need the extracted netlist to represent every single physical transistor finger (or at least every contiguous active area) as a separate subcircuit instance, without merging parallel devices.</p>

<p><strong>My Questions:</strong></p>

<ol>
<li><strong>Disabling Reduction:</strong> Is there a switch or a specific command in the Sky130 LVS runset (or generally in KLayout LVS scripts) to <strong>disable device combination/parallel merging</strong>? I want the "raw" extracted netlist where one layout geometry equals one netlist instance.</li>
<li><strong>API for Coordinates:</strong> Instead of parsing the raw <code>.lvsdb</code> text file, is there a recommended <strong>Python/Ruby API</strong> to access the extracted device list and their specific coordinates (DTrans/Point)?</li>
</ol>

<p>I want to write a script that iterates through the LVS results and prints something like:<br />
<code>Device M$1 (Finger 1): x=..., y=..., W=..., L=...</code><br />
<code>Device M$2 (Finger 2): x=..., y=..., W=..., L=...</code></p>

<p>Any guidance on how to configure the LVS to stop merging devices and how to query their locations via API would be extremely helpful.</p>

<p>Thank you!</p>
]]>
        </description>
    </item>
    <item>
        <title>DRC runs much slower in deep mode compared to default (flat) mode</title>
        <link>https://www.klayout.de/forum/discussion/2814/drc-runs-much-slower-in-deep-mode-compared-to-default-flat-mode</link>
        <pubDate>Tue, 11 Nov 2025 16:01:23 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>Dylan_Lai</dc:creator>
        <guid isPermaLink="false">2814@/forum/discussions</guid>
        <description><![CDATA[<p>Hi,</p>

<p>I'm currently encountering a performance issue when running DRC.<br />
Here’s the structure of my test layout and what I’ve observed:<br />
<img src="https://klayout.de/forum/uploads/editor/e6/v6ljosgesplu.png" alt="" title="" /></p>

<p>I have one rule that checks area, and it runs much slower in deep mode.<br />
In my test, the deep mode runtime is about 375 seconds, while the default (flat) mode only takes 22 seconds — roughly 10× faster.</p>

<p>I saw a talk mentioning that deep mode should actually be faster in some cases (if I understood correctly).<br />
<a href="https://peertube.f-si.org/videos/watch/37358e7b-34f5-40c9-8fe9-f13a1825559a" rel="nofollow">https://peertube.f-si.org/videos/watch/37358e7b-34f5-40c9-8fe9-f13a1825559a</a></p>

<p>I also tried different ways of writing the rule, such as using .drc(area) vs .with_area(), but there was no noticeable speed difference (unlike .drc(width) vs .width() which can differ).</p>

<p>Is there anything I can do to optimize or speed up my DRC in deep mode?</p>

<p>Thank you!</p>
]]>
        </description>
    </item>
    <item>
        <title>LVS using L2N files</title>
        <link>https://www.klayout.de/forum/discussion/2784/lvs-using-l2n-files</link>
        <pubDate>Wed, 17 Sep 2025 01:20:14 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>Tushar_Mayank</dc:creator>
        <guid isPermaLink="false">2784@/forum/discussions</guid>
        <description><![CDATA[<p>Hi all,<br />
I want to compare L2N files from two layouts to identify the missing nets. Can anyone guide me on what my approach should be?</p>
]]>
        </description>
    </item>
    <item>
        <title>maximum number of threads in DRC and LVS scripts</title>
        <link>https://www.klayout.de/forum/discussion/2769/maximum-number-of-threads-in-drc-and-lvs-scripts</link>
        <pubDate>Wed, 20 Aug 2025 11:16:00 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>laurent_c</dc:creator>
        <guid isPermaLink="false">2769@/forum/discussions</guid>
        <description><![CDATA[<p>In DRC and LVS scripts, if we want to use the maximum number of threads available, is the following command the right one to use ?</p>

<p>Laurent</p>

<pre><code>threads(threads)
</code></pre>
]]>
        </description>
    </item>
    <item>
        <title>generate dummies for the chip finishing</title>
        <link>https://www.klayout.de/forum/discussion/2768/generate-dummies-for-the-chip-finishing</link>
        <pubDate>Fri, 15 Aug 2025 17:57:28 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>laurent_c</dc:creator>
        <guid isPermaLink="false">2768@/forum/discussions</guid>
        <description><![CDATA[<p>Here is a DRC script to generate dummies for the chip finishing.</p>

<p>Although dummies are often a box, I have included an example with a polygon (a cross shape).<br />
I have imagined all those dummies and theyr do not target a specific process and they will probably not fit with your target dummies density.</p>

<p>For further options, you can have a look at : <a rel="nofollow" href="https://www.klayout.de/doc-qt5/about/drc_ref_layer.html#k_37">https://www.klayout.de/doc-qt5/about/drc_ref_layer.html#k_37</a><br />
  or  <a rel="nofollow" href="https://www.klayout.de/forum/discussion/550/using-the-fill-tool">https://www.klayout.de/forum/discussion/550/using-the-fill-tool</a></p>

<p>Anyhow, it will generate the dummies cells directly on the toplevel cell. <br />
Does anyone could help to improve my script to generate all those dummies in a separate cell called "DUMMIES_TOP" ? It would help a lot.</p>

<p>Thanks, BRgds,<br />
Laurent</p>

<pre><code>########################
# DUMMIES generation
########################

tstart = Time.now

if $in_gds
  if $topcell
    source($in_gds,$topcell)
  else
    source($in_gds)
  end
end

if $report_file
  report($report_file)
else
  report("DUMMIES generation runset", File.join(File.dirname(RBA::CellView::active.filename), "dumm.lydrc"))
end

require "logger"
log_file(File.join(File.dirname(RBA::CellView::active.filename), "log_DUMM.txt"))

# options
########################


# KLAYOUT setup
########################
# Use a tile size of 1mm
tiles(1000.um)
# Use a tile border of 10 micron:
#tile_borders(10.um)
no_borders

# hierarchical
deep

# Use 8 CPU cores
threads(8)
verbose(true)

# layers definitions
########################
info("Layers definitions")
NWELL = input(1,0)
ACTIVE = input(2,0)
POLY = input(3,0)
METAL1 = input(10,0)
METAL1_dmyblk  = input(10,2)
METAL2 = input(20,0)
METAL2_dmyblk  = input(20,2)
METAL3 = input(30,0)
METAL3_dmyblk  = input(30,2)
METAL4 = input(40,0)
METAL4_dmyblk  = input(40,2)

EXTENT_ALL = source.extent
EXCL_DIFPL = (NWELL + ACTIVE + POLY).sized(2.0)

ACT_fill = fill_pattern("DUMM_ACT")
hull =  [ RBA::DPoint::new(1, 0), RBA::DPoint::new(1, 1), RBA::DPoint::new(0, 1), RBA::DPoint::new(0, 2),
          RBA::DPoint::new(1, 2), RBA::DPoint::new(1, 3), RBA::DPoint::new(2, 3),  RBA::DPoint::new(2, 2),
          RBA::DPoint::new(3, 2), RBA::DPoint::new(3, 1), RBA::DPoint::new(2, 1),  RBA::DPoint::new(2, 0)]
ACT_fill.shape(2, 1, polygon(hull))
ACT_fill.origin(-1, -1)
(EXTENT_ALL - EXCL_DIFPL).fill(ACT_fill, hstep(4.0), vstep(4.0))

POLY_fill = fill_pattern("DUMM_POLY")
POLY_fill.shape(3, 1, box(0, 0, 3, 3))
POLY_fill.origin(-3, -3)
(EXTENT_ALL - EXCL_DIFPL).fill(POLY_fill, hstep(4.0), vstep(4.0))

M1_fill = fill_pattern("DUMM_METAL1")
M1_fill.shape(10, 1, box(0, 0, 3, 1))
M1_fill.origin(-1.0, -1.0)
(EXTENT_ALL - (METAL1.sized(3.0)) - METAL1_dmyblk).fill(M1_fill, hstep(4.0), vstep(2.0))

M2_fill = fill_pattern("DUMM_METAL2")
M2_fill.shape(20, 1, box(0, 0, 1, 3))
M2_fill.origin(-1.0, -1.0)
(EXTENT_ALL - (METAL2.sized(3.0)) - METAL2_dmyblk).fill(M2_fill, hstep(2.0), vstep(4.0))

M3_fill = fill_pattern("DUMM_METAL3")
M3_fill.shape(30, 1, box(0, 0, 3, 1))
M3_fill.origin(-1.0, -1.0)
(EXTENT_ALL - (METAL3.sized(3.0)) - METAL3_dmyblk).fill(M3_fill, hstep(4.0), vstep(2.0))

M4_fill = fill_pattern("DUMM_METAL4")
M4_fill.shape(40, 1, box(0, 0, 1, 3))
M4_fill.origin(-1.0, -1.0)
(EXTENT_ALL - (METAL4.sized(3.0)) - METAL4_dmyblk).fill(M4_fill, hstep(2.0), vstep(4.0))


time = Time.now
hours = ((time - tstart)/3600).to_i
minutes = ((time - tstart)/60 - hours * 60).to_i
seconds = ((time - tstart) - (minutes * 60 + hours * 3600)).to_i
info("DRC finished at : #{time.hour}:#{time.min}:#{time.sec}  -  DRC duration =  #{hours} hrs. #{minutes} min. #{seconds} sec.\n")
$stdout.write "DUMMIES generation finished at : #{time.hour}:#{time.min}:#{time.sec}  -  DRC duration =  #{hours} hrs. #{minutes} min. #{seconds} sec.\n"
</code></pre>
]]>
        </description>
    </item>
    <item>
        <title>Looping, but only call layer.output once? Removing &quot;redudancy&quot; in DRC report</title>
        <link>https://www.klayout.de/forum/discussion/2730/looping-but-only-call-layer-output-once-removing-redudancy-in-drc-report</link>
        <pubDate>Sat, 24 May 2025 11:47:35 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>arikb</dc:creator>
        <guid isPermaLink="false">2730@/forum/discussions</guid>
        <description><![CDATA[<p><img src="https://www.klayout.de/forum/uploads/editor/rr/6z36guddid4r.png" alt="" title="" /><br />
Hello, when I am nestled in a loop, iterating over each shape, checking my design rule, I realize that when calling layer.output it outputs a specific error on all my shapes. I dont see a way getting around looping since my design rule is a bit tedious to enforce using common functions in the drc framework, and therefore I have resorted to conventional looping, but I am stuck with the following "problem". The DRC report is extensive, showing many of the same violations several times. In fact, for each iteration, I am able to get as many errors as there are components to verifiy. I believe this is due to layer.output() checking globally (n checks all at once), while my loop is local (1 check, n times). Any advice on how to get around this? <img src="https://www.klayout.de/forum/uploads/editor/d3/mfznv133qzmn.png" alt="" title="" /><br />
<img src="https://www.klayout.de/forum/uploads/editor/pz/fmx7bkrigf7r.png" alt="" title="" /></p>
]]>
        </description>
    </item>
    <item>
        <title>DRC scripting and height (width) check?</title>
        <link>https://www.klayout.de/forum/discussion/2725/drc-scripting-and-height-width-check</link>
        <pubDate>Wed, 21 May 2025 20:28:37 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>arikb</dc:creator>
        <guid isPermaLink="false">2725@/forum/discussions</guid>
        <description><![CDATA[<p>I'd like to know if its possible to not only check for the width constraint, but also a height constraint. I thought there must be some function called height, but there doesnt seem to be, so perhaps its possible to use width for height purposes too?</p>

<p>Cheers</p>
]]>
        </description>
    </item>
    <item>
        <title>DRC question on overlap</title>
        <link>https://www.klayout.de/forum/discussion/2724/drc-question-on-overlap</link>
        <pubDate>Wed, 21 May 2025 20:15:20 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>arikb</dc:creator>
        <guid isPermaLink="false">2724@/forum/discussions</guid>
        <description><![CDATA[<p>Is it possible to specificy an additional constraint in the overlap check between layers? I'd like to verifiy if there is not only an overlap, but also that one layer in fact is ABOVE the other and vice versa.</p>
]]>
        </description>
    </item>
    <item>
        <title>DRC - elementwise length comparison between several distinct pieces</title>
        <link>https://www.klayout.de/forum/discussion/2726/drc-elementwise-length-comparison-between-several-distinct-pieces</link>
        <pubDate>Wed, 21 May 2025 20:42:40 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>arikb</dc:creator>
        <guid isPermaLink="false">2726@/forum/discussions</guid>
        <description><![CDATA[<p>In a DRC scripting context: If I have succesfully seperated a layer into two distinct pieces (an upper and lower piece), and have done so for all of boxes/polygons of that type, how can I output the pairwise combinations where the length of the upper is smaller than the lower?</p>
]]>
        </description>
    </item>
    <item>
        <title>Running LVS on an inverter in IHP</title>
        <link>https://www.klayout.de/forum/discussion/2698/running-lvs-on-an-inverter-in-ihp</link>
        <pubDate>Sun, 20 Apr 2025 20:34:16 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>diarmuid</dc:creator>
        <guid isPermaLink="false">2698@/forum/discussions</guid>
        <description><![CDATA[<p>Hello, I am having difficulty running LVS on an inverter in IHP process.</p>

<p>I have created an inverter.spice and inverter.gds and run the following command in the correct location of the $PDK_ROOT:</p>

<p>python3 run_lvs.py --layout=/home/slice/xschem/tb_inverter/LVS/inverter.gds --netlist=/home/slice/xschem/tb_inverter/LVS/inverter.spice --run_dir=/home/slice/xschem/tb_inverter/LVS --topcell=inverter --top_lvl_pins</p>

<p>Run however errors out complaining it has not found a cell name "inverter" for the layout.</p>

<p>Attached shows the error message and the contents of the extracted.cir.</p>

<p>Only new to this tool so quite confused about this error. <br />
Any help most appreciated!</p>

<p>Thanks,</p>

<p>Diarmuid</p>
]]>
        </description>
    </item>
    <item>
        <title>Ruby DRC tutorial</title>
        <link>https://www.klayout.de/forum/discussion/2702/ruby-drc-tutorial</link>
        <pubDate>Wed, 23 Apr 2025 06:27:32 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>BigPanda</dc:creator>
        <guid isPermaLink="false">2702@/forum/discussions</guid>
        <description><![CDATA[<p>Is that possible for me to share Ruby DRC code in this forum? I feel DRC parts need more attention.</p>
]]>
        </description>
    </item>
    <item>
        <title>Extract different devices with a single extractor</title>
        <link>https://www.klayout.de/forum/discussion/2666/extract-different-devices-with-a-single-extractor</link>
        <pubDate>Wed, 29 Jan 2025 10:25:34 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>mole99</dc:creator>
        <guid isPermaLink="false">2666@/forum/discussions</guid>
        <description><![CDATA[<p>Hello!<br />
I have a rather interesting situation:</p>

<p>sky130 has different simulation models for the standard nmos depending on the width of the transistor.<br />
For a W &gt;= 0.42 this is sky130_fd_pr__nfet_01v8 and for a W &lt; 0.42 it's sky130_fd_pr__special_nfet_01v8.<br />
Currently LVS is set up to simply extract all standard nmos using DeviceExtractorMOS4Transistor as sky130_fd_pr__nfet_01v8.</p>

<p>This means that LVS fails if a sky130_fd_pr__special_nfet_01v8 is used (such as in digital standard cells).</p>

<p>I see three solutions to this problem:</p>

<ol>
<li>Convert back and forth</li>
</ol>

<p>After reading in the netlist, simply convert all sky130_fd_pr__special_nfet_01v8 to sky130_fd_pr__nfet_01v8.<br />
Before writing the extracted netlist, convert all sky130_fd_pr__nfet_01v8 with W &lt; 0.42 to sky130_fd_pr__special_nfet_01v8.<br />
(I would like to be able to simulate the extracted netlist, thus the conversion back.)</p>

<ol start="2">
<li>Extract the correct device type depending on W</li>
</ol>

<p>Basically, reimplement DeviceExtractorMOS4Transistor in Ruby and create a sky130_fd_pr__special_nfet_01v8 device if W &lt; 0.42, else sky130_fd_pr__nfet_01v8.</p>

<ol start="3">
<li>Create two new device extractors</li>
</ol>

<p>SpecialDeviceExtractorMOS4Transistor -&gt; only creates a sky130_fd_pr__special_nfet_01v8 device if W &lt; 0.42<br />
NonSpecialDeviceExtractorMOS4Transistor -&gt; only creates a sky130_fd_pr__nfet_01v8 device if W &gt;= 0.42</p>

<hr />

<p>Option 1 seems to me to be the less clean solution. But option 2 and 3 require to basically reimplement the "extract_devices" function of the DeviceExtractorMOS4Transistor in Ruby. Perhaps there is a simpler/different way of doing this?</p>

<p>Looking forward to any thoughts on this <img src="https://www.klayout.de/forum/resources/emoji/smile.png" title=":)" alt=":)" height="20" /></p>
]]>
        </description>
    </item>
    <item>
        <title>Possible regression in DRC: with_density influences join operation</title>
        <link>https://www.klayout.de/forum/discussion/2678/possible-regression-in-drc-with-density-influences-join-operation</link>
        <pubDate>Wed, 26 Feb 2025 13:12:10 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>akrinke</dc:creator>
        <guid isPermaLink="false">2678@/forum/discussions</guid>
        <description><![CDATA[<p>The following DRC script changes its behavior in hierarchical layouts after version 0.29.7:</p>

<pre><code>report("drc")

deep

Activ = source.polygons("1/0")
Cont = source.polygons("6/0")

# commenting the following line produces the expected result
Activ.with_density(0.0 .. 0.35, tile_size(20.0.um))

Cont.output("Cont")
Activ.output("Activ")
Cont.join(Activ).output("Cont.join(Activ)")
</code></pre>

<p>In 0.29.7, the two hierarchical layers are properly joined. In later versions (I've checked 0.29.9 and 0.29.11), the join is missing shapes in lower hierarchy levels. Disabling the density check produces the correct/expected result! Interestingly, even <code>Activ.dup.with_density(...)</code> changes the behavior of the join operation!</p>

<p>I have compiled all versions from source on Arch Linux. Can anyone reproduce this issue? If required, I can also create a simple example layout.</p>
]]>
        </description>
    </item>
    <item>
        <title>Select layer connected to other layer</title>
        <link>https://www.klayout.de/forum/discussion/2672/select-layer-connected-to-other-layer</link>
        <pubDate>Mon, 10 Feb 2025 11:41:53 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>kareemfarid</dc:creator>
        <guid isPermaLink="false">2672@/forum/discussions</guid>
        <description><![CDATA[<p>Suppose that I have a set of connect statements, for example:</p>

<pre><code>    connect(m1, via)
    connect(via, m2)
    connect(m2, via2)
    connect(via2, m3)
    connect(m3, via3)
    connect(via3, m4)
    connect(m4, via4)
    connect(via4, m5)
</code></pre>

<p>How to select <code>m1</code> shapes that are connected to <code>m5</code>?</p>
]]>
        </description>
    </item>
    <item>
        <title>DRC abutting edges.</title>
        <link>https://www.klayout.de/forum/discussion/2669/drc-abutting-edges</link>
        <pubDate>Tue, 04 Feb 2025 10:45:23 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>kareemfarid</dc:creator>
        <guid isPermaLink="false">2669@/forum/discussions</guid>
        <description><![CDATA[<p>Hello,</p>

<p>Let's say that we have two layers A and B. I would like to detect shapes of layer B that are between two layer A shapes - assuming that we are only dealing with rectangular shapes.</p>

<p>This is the shape I would like to be detected. <br />
<img src="https://www.klayout.de/forum/uploads/editor/6x/bl08hwehbwp2.png" alt="" title="" /></p>

<p>I was considering using interacting (using min and max) and outside/inside (to exclude overlapping shapes)  operations but I am not entirely sure how to avoid detecting this scenario <br />
<img src="https://www.klayout.de/forum/uploads/editor/dg/bvvs0gxv8dnq.png" alt="" title="" /></p>

<p>Thank you</p>
]]>
        </description>
    </item>
    <item>
        <title>DRC fill option</title>
        <link>https://www.klayout.de/forum/discussion/2667/drc-fill-option</link>
        <pubDate>Wed, 29 Jan 2025 15:14:18 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>tomas2004</dc:creator>
        <guid isPermaLink="false">2667@/forum/discussions</guid>
        <description><![CDATA[<p>Hello Matthias et al.,</p>

<p>I'm playing around with the DRC fill tool and got some questions (version 0.28.17):</p>

<p>1) I would like to fill a layer called "layer_to_fill" (green in the screenshots below) with a tile "tile_M1" (blue in the screenshots below):</p>

<p>tile_M1 = fill_pattern("TILE_M1").shape(20170, 0, box(-0.244, -0.240, 0.244, 0.240))<br />
layer_to_fill.fill(tile_M1)</p>

<p>This works great:</p>

<p><img src="https://www.klayout.de/forum/uploads/editor/w4/7s2xohemfj12.png" alt="" title="" /></p>

<p>If I redo this with an offset, I see that the tiles are shifted as expected, but there are now also tiles going outside the "layer_to_fill" shapes (ellipse)...<br />
 I would not expect this to happen or am I missing something???</p>

<p>tile_M1 = fill_pattern("TILE_M1").shape(20170, 0, box(-0.244, -0.240, 0.244, 0.240))<br />
tile_M1.origin(-0.3, -0.3)<br />
layer_to_fill.fill(tile_M1)</p>

<p><img src="https://www.klayout.de/forum/uploads/editor/y2/pwznbejzym31.png" alt="" title="" /></p>

<p><img src="https://www.klayout.de/forum/uploads/editor/t2/gm1ky4fgldad.png" alt="" title="" /></p>

<p>2) Is there a way to refer to an existing cell of the layout, instead of using the fill_pattern method and add shapes one by one via code???</p>

<p>Cheers,</p>

<p>Tomas</p>
]]>
        </description>
    </item>
    <item>
        <title>Can not get rounded end by using pya.Path() command.</title>
        <link>https://www.klayout.de/forum/discussion/2644/can-not-get-rounded-end-by-using-pya-path-command</link>
        <pubDate>Wed, 25 Dec 2024 02:48:21 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>BigPanda</dc:creator>
        <guid isPermaLink="false">2644@/forum/discussions</guid>
        <description><![CDATA[<p>I used code like below.</p>

<pre><code>obj = pya.Path(points, width, bgn_ext, end_ext, r)
print(obj) # (0,0;1,0;1,1;2,1) w=1 bx=1 ex=1 r=true
</code></pre>

<p>From the print result I get right result. But when I export it into KLayout. The end is still rectangular rather than round. Is this a bug?</p>
]]>
        </description>
    </item>
    <item>
        <title>checking exact enclosing</title>
        <link>https://www.klayout.de/forum/discussion/1764/checking-exact-enclosing</link>
        <pubDate>Mon, 08 Mar 2021 07:42:46 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>akita11</dc:creator>
        <guid isPermaLink="false">1764@/forum/discussions</guid>
        <description><![CDATA[<p>I'm trying to check "exact" enclosing of layer1 in layer2. This is often the case in PAD layout rule.<br />
We can check minimum enclosing by "layer2.enclosing(layer1, value)".<br />
Is there any way to check the exact enclosing values?</p>
]]>
        </description>
    </item>
    <item>
        <title>Blackboxing extraction</title>
        <link>https://www.klayout.de/forum/discussion/2606/blackboxing-extraction</link>
        <pubDate>Tue, 15 Oct 2024 18:41:16 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>tnt</dc:creator>
        <guid isPermaLink="false">2606@/forum/discussions</guid>
        <description><![CDATA[<p>Hi,</p>

<p>I'm trying to run LVS on a "top level" assembly (on the iHP PDK).</p>

<p>This cell is really only assembling other subcells, there are no active devices at all.<br />
Those subcells have passed their own LVS and can be considered good, so really all I want to do is check that the metal/via make the connection they should between the subcells. Those connections can be varied ( so multiple pins of multiple cells connected to the same net ).<br />
Those subcells also have multiple "power pins" exposed and it must be checked that all of them are connected properly.</p>

<p>I was however not able to achieve any of that after trying various approaches.</p>

<p>The very first issue is that I couldn't find any way to black box the extraction itself so that it doesn't extract the "insides" of the subcells.<br />
There is a <code>blank_circuit</code> ( and <code>netlist</code> and <code>schematic</code> variants of it which I found out are apparently case sensitive ... ) but AFAICT this acts only <em>after</em> extraction.  And that's just no good because the extraction step itself doesn't complete (or at least not in any reasonable time, I have a run that's still running after 12 hours at time of writing this ... ).</p>

<p>I tried instead feeding a GDS where I had manually stripped the subcells to only the pins but I couldn't get that to work either.</p>

<p>So is what I want to do possible with KLayout or should I just give up on it ?<br />
And if it is, then what's the approach I should be doing ?</p>

<p>Cheers,</p>

<p>Sylvain</p>
]]>
        </description>
    </item>
    <item>
        <title>Min. Max. Length check  in Klayout DRC</title>
        <link>https://www.klayout.de/forum/discussion/2621/min-max-length-check-in-klayout-drc</link>
        <pubDate>Wed, 13 Nov 2024 04:22:08 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>haru_f</dc:creator>
        <guid isPermaLink="false">2621@/forum/discussions</guid>
        <description><![CDATA[<p>Hi all,</p>

<p>There are design rules for creating slits in wide metal wire.<br />
While I can easily code the width check, I’m not sure how to <br />
code the length check. <br />
Metal (actual) = Metal (data) – Slit (data) <br />
Slit data design rules. <br />
 (Where Length　&gt; Width)<br />
rule1:  Width　&gt;= a  um　           （Min. W) - width check<br />
rule2:  Length  &gt;= b  um　           （Min.  L)   - how to check?<br />
rule3:  c um &gt;= Length &gt;= b um    (Max. L)      - how to check?  (optional)<br />
<img src="https://www.klayout.de/forum/uploads/editor/rb/dkl43p98z5zs.jpg" alt="" title="" /></p>

<p>Could anyone advise on which commands or functions?<br />
Thanks,</p>
]]>
        </description>
    </item>
    <item>
        <title>Rename devices with labels in Device Extraction</title>
        <link>https://www.klayout.de/forum/discussion/2616/rename-devices-with-labels-in-device-extraction</link>
        <pubDate>Fri, 01 Nov 2024 18:50:59 +0000</pubDate>
        <category>Verification</category>
        <dc:creator>blueman_44</dc:creator>
        <guid isPermaLink="false">2616@/forum/discussions</guid>
        <description><![CDATA[<p>Is there a way to rename devices during device extraction with a given set of labels? <br />
Example Spice output:</p>

<pre><code>* Created by KLayout

.SUBCKT TOP
D$1 1 1 diode_dev A=152519.75592P P=1563.728U
D$2 2 2 diode_dev A=155127.109292P P=1576.494U
D$3 3 3 diode_dev A=151327.92696P P=1557.344U
.ENDS TOP
</code></pre>

<p>To this output:</p>

<pre><code>* Created by KLayout

.SUBCKT TOP
DDev_A 1 1 diode_dev A=152519.75592P P=1563.728U
DDev_B 2 2 diode_dev A=155127.109292P P=1576.494U
DDev_C 3 3 diode_dev A=151327.92696P P=1557.344U
.ENDS TOP
</code></pre>

<p>Where Dev_A, Dev_B, Dev_C are labels on each respective diode.</p>

<p>I initially thought of creating a custom device extractor that takes in an extra terminal for labels, but from what I've seen no text data gets passed.<br />
Here is an example of the extractor: (Example copied from here: <a href="https://www.klayout.de/forum/discussion/2178/problems-encountered-when-changing-the-terminal-declaration-in-the-device-class" rel="nofollow">https://www.klayout.de/forum/discussion/2178/problems-encountered-when-changing-the-terminal-declaration-in-the-device-class</a>)</p>

<pre><code>class DiodeExtractor &lt; RBA::GenericDeviceExtractor

  def initialize(name)
    self.name = name
  end

  def setup
    define_layer("P", "Anode")
    define_layer("N", "Cathode ")
    register_device_class(RBA::DeviceClassDiode::new)
  end

  def get_connectivity(layout, layers)
    conn = RBA::Connectivity::new
    conn.connect(layers[0], layers[1])   # collect touching contacts
    conn.connect(layers[1], layers[1])   # combine resistor shapes into one area
    conn
  end

  def extract_devices(layer_geometry)    #layer_geometry are Region Datatypes, no text?
    anode = layer_geometry[0]
    cathode  = layer_geometry[1]
    diode_regions= (anode &amp; cathode).merged
    a = diode_regions.area*dbu*dbu
    p = diode_regions.perimeter*dbu
    device = create_device
    #device.name = "Fred_The_Lonely_Diode"    #If text can be passed then this is where the device would be renamed.
    device.set_parameter(RBA::DeviceClassDiode::PARAM_A, a)
    device.set_parameter(RBA::DeviceClassDiode::PARAM_P, p) 
    define_terminal(device, RBA::DeviceClassDiode::TERMINAL_A, 0, anode[0]);
    define_terminal(device, RBA::DeviceClassDiode::TERMINAL_C, 1, cathode[0]);
  end

end
</code></pre>
]]>
        </description>
    </item>
   </channel>
</rss>
