Skip to content

Commit

Permalink
Deploying to gh-pages from @ 9db4255 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
qpavsmi committed Apr 18, 2024
1 parent f126ddd commit 789a492
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
22 changes: 18 additions & 4 deletions _modules/kqcircuits/masks/mask_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -1220,12 +1220,13 @@ <h1>Source code for kqcircuits.masks.mask_layout</h1><div class="highlight"><pre
<span class="k">for</span> <span class="n">params</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">graphical_representation_inputs</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_add_chip_graphical_representation_layer</span><span class="p">(</span><span class="o">*</span><span class="n">params</span><span class="p">)</span></div>

<div class="viewcode-block" id="MaskLayout.insert_chip_copy_labels"><a class="viewcode-back" href="../../../api/kqcircuits.masks.mask_layout.html#kqcircuits.masks.mask_layout.MaskLayout.insert_chip_copy_labels">[docs]</a> <span class="k">def</span> <span class="nf">insert_chip_copy_labels</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">labels_cell</span><span class="p">,</span> <span class="n">layers</span><span class="p">):</span>
<div class="viewcode-block" id="MaskLayout.insert_chip_copy_labels"><a class="viewcode-back" href="../../../api/kqcircuits.masks.mask_layout.html#kqcircuits.masks.mask_layout.MaskLayout.insert_chip_copy_labels">[docs]</a> <span class="k">def</span> <span class="nf">insert_chip_copy_labels</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">labels_cell</span><span class="p">,</span> <span class="n">layers</span><span class="p">,</span> <span class="n">mask_name_for_chip</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Inserts chip copy labels to all chips in this mask layout and its submasks</span>

<span class="sd"> Args:</span>
<span class="sd"> labels_cell: Cell to which the labels are inserted</span>
<span class="sd"> layers: list of layer names (without face_ids) where the labels are produced</span>
<span class="sd"> mask_name_for_chip: mask name to place on each chip, or None (default) to not add mask names to the chip.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="c1"># find labels_cell for this mask and each submask</span>
Expand Down Expand Up @@ -1288,7 +1289,8 @@ <h1>Source code for kqcircuits.masks.mask_layout</h1><div class="highlight"><pre
<span class="c1"># update position label into chips_dict</span>
<span class="n">chips_dict</span><span class="p">[(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)]</span> <span class="o">=</span> <span class="p">(</span><span class="n">chip_name</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">bbox</span><span class="p">,</span> <span class="n">dtrans</span><span class="p">,</span> <span class="n">position_label</span><span class="p">,</span> <span class="n">mask_layout</span><span class="p">)</span>
<span class="n">used_position_labels</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">position_label</span><span class="p">)</span>
<span class="n">bbox_x1</span> <span class="o">=</span> <span class="n">bbox</span><span class="o">.</span><span class="n">left</span> <span class="k">if</span> <span class="p">(</span><span class="nb">bool</span><span class="p">(</span><span class="n">dtrans</span><span class="o">.</span><span class="n">is_mirror</span><span class="p">())</span> <span class="o">^</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mirror_labels</span><span class="p">))</span> <span class="k">else</span> <span class="n">bbox</span><span class="o">.</span><span class="n">right</span>
<span class="n">total_mirror_label</span> <span class="o">=</span> <span class="nb">bool</span><span class="p">(</span><span class="n">dtrans</span><span class="o">.</span><span class="n">is_mirror</span><span class="p">())</span> <span class="o">^</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mirror_labels</span><span class="p">)</span>
<span class="n">bbox_x1</span><span class="p">,</span> <span class="n">bbox_x2</span> <span class="o">=</span> <span class="p">(</span><span class="n">bbox</span><span class="o">.</span><span class="n">left</span><span class="p">,</span> <span class="n">bbox</span><span class="o">.</span><span class="n">right</span><span class="p">)</span> <span class="k">if</span> <span class="n">total_mirror_label</span> <span class="k">else</span> <span class="p">(</span><span class="n">bbox</span><span class="o">.</span><span class="n">right</span><span class="p">,</span> <span class="n">bbox</span><span class="o">.</span><span class="n">left</span><span class="p">)</span>
<span class="n">produce_label</span><span class="p">(</span>
<span class="n">labels_cell_2</span><span class="p">,</span>
<span class="n">position_label</span><span class="p">,</span>
Expand All @@ -1300,9 +1302,21 @@ <h1>Source code for kqcircuits.masks.mask_layout</h1><div class="highlight"><pre
<span class="n">mask_layout</span><span class="o">.</span><span class="n">face</span><span class="p">()[</span><span class="s2">&quot;ground_grid_avoidance&quot;</span><span class="p">],</span>
<span class="n">mirror</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mirror_labels</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">bbox_x2</span> <span class="o">=</span> <span class="n">bbox</span><span class="o">.</span><span class="n">right</span> <span class="k">if</span> <span class="n">dtrans</span><span class="o">.</span><span class="n">is_mirror</span><span class="p">()</span> <span class="k">else</span> <span class="n">bbox</span><span class="o">.</span><span class="n">left</span>
<span class="k">if</span> <span class="n">mask_name_for_chip</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">produce_label</span><span class="p">(</span>
<span class="n">labels_cell_2</span><span class="p">,</span>
<span class="n">mask_name_for_chip</span><span class="p">,</span>
<span class="n">dtrans</span> <span class="o">*</span> <span class="p">(</span><span class="n">pya</span><span class="o">.</span><span class="n">DPoint</span><span class="p">(</span><span class="n">bbox_x2</span><span class="p">,</span> <span class="n">bbox</span><span class="o">.</span><span class="n">top</span><span class="p">)),</span>
<span class="n">LabelOrigin</span><span class="o">.</span><span class="n">TOPLEFT</span><span class="p">,</span>
<span class="n">mask_layout</span><span class="o">.</span><span class="n">dice_width</span><span class="p">,</span>
<span class="n">mask_layout</span><span class="o">.</span><span class="n">text_margin</span><span class="p">,</span>
<span class="p">[</span><span class="n">mask_layout</span><span class="o">.</span><span class="n">face</span><span class="p">()[</span><span class="n">layer</span><span class="p">]</span> <span class="k">for</span> <span class="n">layer</span> <span class="ow">in</span> <span class="n">layers</span><span class="p">],</span>
<span class="n">mask_layout</span><span class="o">.</span><span class="n">face</span><span class="p">()[</span><span class="s2">&quot;ground_grid_avoidance&quot;</span><span class="p">],</span>
<span class="n">mirror</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mirror_labels</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">bbox_xr</span> <span class="o">=</span> <span class="n">bbox</span><span class="o">.</span><span class="n">right</span> <span class="k">if</span> <span class="n">dtrans</span><span class="o">.</span><span class="n">is_mirror</span><span class="p">()</span> <span class="k">else</span> <span class="n">bbox</span><span class="o">.</span><span class="n">left</span>
<span class="bp">self</span><span class="o">.</span><span class="n">graphical_representation_inputs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
<span class="p">(</span><span class="n">chip_name</span><span class="p">,</span> <span class="n">dtrans</span> <span class="o">*</span> <span class="p">(</span><span class="n">pya</span><span class="o">.</span><span class="n">DPoint</span><span class="p">(</span><span class="n">bbox_x2</span><span class="p">,</span> <span class="n">bbox</span><span class="o">.</span><span class="n">bottom</span><span class="p">)),</span> <span class="n">position_label</span><span class="p">,</span> <span class="n">bbox</span><span class="o">.</span><span class="n">width</span><span class="p">(),</span> <span class="n">labels_cell_2</span><span class="p">)</span>
<span class="p">(</span><span class="n">chip_name</span><span class="p">,</span> <span class="n">dtrans</span> <span class="o">*</span> <span class="p">(</span><span class="n">pya</span><span class="o">.</span><span class="n">DPoint</span><span class="p">(</span><span class="n">bbox_xr</span><span class="p">,</span> <span class="n">bbox</span><span class="o">.</span><span class="n">bottom</span><span class="p">)),</span> <span class="n">position_label</span><span class="p">,</span> <span class="n">bbox</span><span class="o">.</span><span class="n">width</span><span class="p">(),</span> <span class="n">labels_cell_2</span><span class="p">)</span>
<span class="p">)</span>

<span class="n">chip_box</span> <span class="o">=</span> <span class="n">pya</span><span class="o">.</span><span class="n">DBox</span><span class="p">(</span><span class="n">dtrans</span> <span class="o">*</span> <span class="n">bbox</span><span class="p">)</span>
Expand Down
7 changes: 6 additions & 1 deletion _modules/kqcircuits/masks/mask_set.html
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ <h1>Source code for kqcircuits.masks.mask_set</h1><div class="highlight"><pre>
<span class="n">export_drc</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">mask_export_layers</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">export_path</span><span class="o">=</span><span class="n">TMP_PATH</span><span class="p">,</span>
<span class="n">add_mask_name_to_chips</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="p">):</span>

<span class="bp">self</span><span class="o">.</span><span class="n">_time</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;INIT&quot;</span><span class="p">:</span> <span class="n">perf_counter</span><span class="p">(),</span> <span class="s2">&quot;ADD_CHIPS&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="s2">&quot;BUILD&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="s2">&quot;EXPORT&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="s2">&quot;END&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">}</span>
Expand All @@ -982,6 +983,7 @@ <h1>Source code for kqcircuits.masks.mask_set</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">mask_layouts</span> <span class="o">=</span> <span class="p">[]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">mask_export_layers</span> <span class="o">=</span> <span class="n">mask_export_layers</span> <span class="k">if</span> <span class="n">mask_export_layers</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="p">[]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">used_chips</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_mask_name_to_chips</span> <span class="o">=</span> <span class="n">add_mask_name_to_chips</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_extra_params</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_mask_set_dir</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="n">export_path</span><span class="p">)</span> <span class="o">/</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s2">_v</span><span class="si">{</span><span class="n">version</span><span class="si">}</span><span class="s2">&quot;</span>

Expand Down Expand Up @@ -1214,12 +1216,15 @@ <h1>Source code for kqcircuits.masks.mask_set</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">mask_layouts</span> <span class="o">=</span> <span class="n">submask_layouts</span> <span class="o">+</span> <span class="p">[</span><span class="n">ml</span> <span class="k">for</span> <span class="n">ml</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mask_layouts</span> <span class="k">if</span> <span class="n">ml</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">mask_layouts_to_remove</span><span class="p">]</span>

<span class="c1"># add chip copy labels for every mask layout</span>
<span class="n">mask_name_for_chip</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">add_mask_name_to_chips</span> <span class="k">else</span> <span class="kc">None</span>
<span class="k">for</span> <span class="n">mask_layout</span> <span class="ow">in</span> <span class="n">tqdm</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mask_layouts</span><span class="p">,</span> <span class="n">desc</span><span class="o">=</span><span class="s2">&quot;Adding chip copy labels&quot;</span><span class="p">,</span> <span class="n">bar_format</span><span class="o">=</span><span class="n">default_bar_format</span><span class="p">):</span>

<span class="n">labels_cell</span> <span class="o">=</span> <span class="n">mask_layout</span><span class="o">.</span><span class="n">layout</span><span class="o">.</span><span class="n">create_cell</span><span class="p">(</span><span class="s2">&quot;ChipLabels&quot;</span><span class="p">)</span>
<span class="n">mask_layout</span><span class="o">.</span><span class="n">top_cell</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="n">pya</span><span class="o">.</span><span class="n">DCellInstArray</span><span class="p">(</span><span class="n">labels_cell</span><span class="o">.</span><span class="n">cell_index</span><span class="p">(),</span> <span class="n">pya</span><span class="o">.</span><span class="n">DTrans</span><span class="p">(</span><span class="n">pya</span><span class="o">.</span><span class="n">DVector</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">))))</span>
<span class="k">if</span> <span class="n">mask_layout</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">submask_layouts</span><span class="p">:</span>
<span class="n">chips_dict</span> <span class="o">=</span> <span class="n">mask_layout</span><span class="o">.</span><span class="n">insert_chip_copy_labels</span><span class="p">(</span><span class="n">labels_cell</span><span class="p">,</span> <span class="n">chip_copy_label_layers</span><span class="p">)</span>
<span class="n">chips_dict</span> <span class="o">=</span> <span class="n">mask_layout</span><span class="o">.</span><span class="n">insert_chip_copy_labels</span><span class="p">(</span>
<span class="n">labels_cell</span><span class="p">,</span> <span class="n">chip_copy_label_layers</span><span class="p">,</span> <span class="n">mask_name_for_chip</span>
<span class="p">)</span>
<span class="n">mask_layout</span><span class="o">.</span><span class="n">overwrite_chips_by_position_label</span><span class="p">(</span><span class="n">chips_dict</span><span class="p">)</span>
<span class="c1"># remove &quot;$1&quot; or similar unnecessary postfix from cell name</span>
<span class="n">mask_layout</span><span class="o">.</span><span class="n">top_cell</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">mask_layout</span><span class="o">.</span><span class="n">name</span><span class="si">}</span><span class="s2">&quot;</span>
Expand Down
3 changes: 2 additions & 1 deletion api/kqcircuits.masks.mask_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -1194,13 +1194,14 @@

<dl class="py method">
<dt class="sig sig-object py" id="kqcircuits.masks.mask_layout.MaskLayout.insert_chip_copy_labels">
<span class="sig-name descname"><span class="pre">insert_chip_copy_labels</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">labels_cell</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layers</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/kqcircuits/masks/mask_layout.html#MaskLayout.insert_chip_copy_labels"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#kqcircuits.masks.mask_layout.MaskLayout.insert_chip_copy_labels" title="Permalink to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">insert_chip_copy_labels</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">labels_cell</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">layers</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mask_name_for_chip</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/kqcircuits/masks/mask_layout.html#MaskLayout.insert_chip_copy_labels"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#kqcircuits.masks.mask_layout.MaskLayout.insert_chip_copy_labels" title="Permalink to this definition"></a></dt>
<dd><p>Inserts chip copy labels to all chips in this mask layout and its submasks</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>labels_cell</strong> – Cell to which the labels are inserted</p></li>
<li><p><strong>layers</strong> – list of layer names (without face_ids) where the labels are produced</p></li>
<li><p><strong>mask_name_for_chip</strong> – mask name to place on each chip, or None (default) to not add mask names to the chip.</p></li>
</ul>
</dd>
</dl>
Expand Down
Loading

0 comments on commit 789a492

Please sign in to comment.