|
|
|
@ -160,8 +160,47 @@ do not feel limited by it. You can use <span class="sc">Hurricane</span> objects
|
|
|
|
|
of <span class="sc">Python</span> objects or use <span class="sc">Python</span> containers to store them.
|
|
|
|
|
The only limitation is that you may not use <span class="sc">Hurricane</span> classes as base
|
|
|
|
|
classes in <span class="sc">Python</span>.</p>
|
|
|
|
|
<p>All <span class="sc">Hurricane</span> objects implements the <span class="sc">Python</span> <tt class="docutils literal">__str__()</tt> function,
|
|
|
|
|
they print the result of the C++ method <tt class="docutils literal">::getString()</tt>.</p>
|
|
|
|
|
<p>All the example scripts given in this tutorial con be found under:</p>
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
<CORIOLIS_INSTALL>/share/doc/coriolis2/examples/scripts/
|
|
|
|
|
</pre>
|
|
|
|
|
<p>Provided scripts:</p>
|
|
|
|
|
<table class="table">
|
|
|
|
|
<colgroup>
|
|
|
|
|
<col width="27%" />
|
|
|
|
|
<col width="73%" />
|
|
|
|
|
</colgroup>
|
|
|
|
|
<thead valign="bottom">
|
|
|
|
|
<tr><th class="head"><strong>Script</strong></th>
|
|
|
|
|
<th class="head"><strong>Feature</strong></th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody valign="top">
|
|
|
|
|
<tr><td><span class="cb">coriolisLogo.py</span></td>
|
|
|
|
|
<td>Draw a layout of the <span class="sc">Coriolis</span> logo</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr><td><span class="cb">diagonals.py</span></td>
|
|
|
|
|
<td>Test the <span class="cb">Hurricane::Diagonal</span> class</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr><td><span class="cb">polygons.py</span></td>
|
|
|
|
|
<td>Test the <span class="cb">Hurricane::Polygon</span> class</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr><td><span class="cb">rectilinear.py</span></td>
|
|
|
|
|
<td>Test the <span class="cb">Hurricane::rectilinear</span> class</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr><td><span class="cb">invertor.py</span></td>
|
|
|
|
|
<td>Procedural build of the layout of an invertor standard cell</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr><td><span class="cb">fulladder.py</span></td>
|
|
|
|
|
<td>Procedural build of a small netlist along with it's manual
|
|
|
|
|
placement and the routing of one net (<span class="cb">"a"</span>)</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr><td><span class="cb">toolengines.py</span></td>
|
|
|
|
|
<td>Build the netlist (only) of the full adder then call the
|
|
|
|
|
place and route engines</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<div class="section" id="terminology">
|
|
|
|
|
<h3>1.1 Terminology</h3>
|
|
|
|
|
<p>In the <span class="sc">Hurricane</span> database, the <em>logical</em> (netlist) and <em>physical</em> (layout)
|
|
|
|
@ -216,37 +255,71 @@ It has not been exported to the <span class="sc">Python</span> interface, you on
|
|
|
|
|
to use <tt class="docutils literal">string</tt>.</li>
|
|
|
|
|
<li>Coordinates are expressed in <tt class="docutils literal">DbU</tt> which are <tt class="docutils literal">long</tt> with a special
|
|
|
|
|
semantic (see ??).</li>
|
|
|
|
|
<li>All <span class="sc">Hurricane</span> objects implements the <span class="sc">Python</span> <tt class="docutils literal">__str__()</tt> function,
|
|
|
|
|
they print the result of the C++ method <tt class="docutils literal">::getString()</tt>.</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p>In <tt class="docutils literal">hurricane/Session.h</tt> header we have:</p>
|
|
|
|
|
<p>In <tt class="docutils literal">hurricane/Net.h</tt> header we have:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="k">namespace</span> <span class="n">Hurricane</span> <span class="p">{</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">class</span> <span class="nc">UpdateSession</span> <span class="p">{</span>
|
|
|
|
|
<span class="k">class</span> <span class="nc">Net</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Entity</span> <span class="p">{</span>
|
|
|
|
|
<span class="k">public</span><span class="o">:</span>
|
|
|
|
|
<span class="k">static</span> <span class="kt">void</span> <span class="n">open</span> <span class="p">();</span>
|
|
|
|
|
<span class="k">static</span> <span class="kt">void</span> <span class="n">close</span> <span class="p">();</span>
|
|
|
|
|
<span class="k">class</span> <span class="nc">Direction</span> <span class="p">{</span>
|
|
|
|
|
<span class="k">public</span><span class="o">:</span> <span class="k">enum</span> <span class="nc">Code</span> <span class="p">{</span> <span class="n">DirIn</span> <span class="o">=</span> <span class="mh">0x0001</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DirOut</span> <span class="o">=</span> <span class="mh">0x0002</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DirUndefined</span> <span class="o">=</span> <span class="mh">0x0000</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">ConnTristate</span> <span class="o">=</span> <span class="mh">0x0100</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">ConnWiredOr</span> <span class="o">=</span> <span class="mh">0x0200</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">UNDEFINED</span> <span class="o">=</span> <span class="n">DirUndefined</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">IN</span> <span class="o">=</span> <span class="n">DirIn</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">OUT</span> <span class="o">=</span> <span class="n">DirOut</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">INOUT</span> <span class="o">=</span> <span class="n">DirIn</span> <span class="o">|</span> <span class="n">DirOut</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">TRISTATE</span> <span class="o">=</span> <span class="n">DirOut</span> <span class="o">|</span> <span class="n">ConnTristate</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">TRANSCV</span> <span class="o">=</span> <span class="n">DirIn</span> <span class="o">|</span> <span class="n">DirOut</span> <span class="o">|</span> <span class="n">ConnTristate</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">WOR_OUT</span> <span class="o">=</span> <span class="n">DirOut</span> <span class="o">|</span> <span class="n">ConnWiredOr</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">WOR_INOUT</span> <span class="o">=</span> <span class="n">DirIn</span> <span class="o">|</span> <span class="n">DirOut</span> <span class="o">|</span> <span class="n">ConnWiredOr</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DirMask</span> <span class="o">=</span> <span class="n">DirIn</span> <span class="o">|</span> <span class="n">DirOut</span> <span class="o">|</span> <span class="n">DirUndefined</span>
|
|
|
|
|
<span class="p">};</span>
|
|
|
|
|
<span class="c1">// [The rest of Class Direction]</span>
|
|
|
|
|
<span class="p">};</span>
|
|
|
|
|
<span class="k">public</span><span class="o">:</span>
|
|
|
|
|
<span class="k">static</span> <span class="n">Net</span><span class="o">*</span> <span class="n">create</span> <span class="p">(</span> <span class="n">Cell</span><span class="o">*</span> <span class="p">,</span> <span class="k">const</span> <span class="n">Name</span><span class="o">&</span> <span class="p">);</span>
|
|
|
|
|
<span class="kt">bool</span> <span class="nf">isGlobal</span> <span class="p">();</span>
|
|
|
|
|
<span class="kt">bool</span> <span class="nf">isExternal</span> <span class="p">();</span>
|
|
|
|
|
<span class="k">const</span> <span class="n">Direction</span><span class="o">&</span> <span class="n">getDirection</span> <span class="p">();</span>
|
|
|
|
|
<span class="kt">void</span> <span class="nf">setName</span> <span class="p">(</span> <span class="n">Name</span> <span class="p">);</span>
|
|
|
|
|
<span class="kt">void</span> <span class="nf">setGlobal</span> <span class="p">(</span> <span class="kt">bool</span> <span class="p">);</span>
|
|
|
|
|
<span class="kt">void</span> <span class="nf">setExternal</span> <span class="p">(</span> <span class="kt">bool</span> <span class="p">);</span>
|
|
|
|
|
<span class="kt">void</span> <span class="nf">setDirection</span> <span class="p">(</span> <span class="k">const</span> <span class="n">Direction</span><span class="o">&</span> <span class="p">);</span>
|
|
|
|
|
<span class="c1">// [The rest of Class Net]</span>
|
|
|
|
|
<span class="p">};</span>
|
|
|
|
|
|
|
|
|
|
<span class="p">}</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>So we can use it the following way in C++:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf">"hurricane/Session.h"</span><span class="cp"></span>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf">"hurricane/Net.h"</span><span class="cp"></span>
|
|
|
|
|
|
|
|
|
|
<span class="k">using</span> <span class="k">namespace</span> <span class="n">Hurricane</span><span class="p">;</span>
|
|
|
|
|
|
|
|
|
|
<span class="kt">void</span> <span class="nf">doSomething</span> <span class="p">()</span>
|
|
|
|
|
<span class="kt">void</span> <span class="nf">addNetToCell</span> <span class="p">(</span> <span class="n">Cell</span><span class="o">*</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">{</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">::</span><span class="n">open</span><span class="p">();</span>
|
|
|
|
|
<span class="c1">// Something...</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">::</span><span class="n">close</span><span class="p">();</span>
|
|
|
|
|
<span class="n">Net</span><span class="o">*</span> <span class="n">net</span> <span class="o">=</span> <span class="n">Net</span><span class="o">::</span><span class="n">create</span><span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="s">"new_net"</span> <span class="p">);</span>
|
|
|
|
|
<span class="n">net</span><span class="o">-></span><span class="n">setGlobal</span> <span class="p">(</span> <span class="nb">false</span> <span class="p">);</span>
|
|
|
|
|
<span class="n">net</span><span class="o">-></span><span class="n">setExternal</span> <span class="p">(</span> <span class="nb">true</span> <span class="p">);</span>
|
|
|
|
|
<span class="n">net</span><span class="o">-></span><span class="n">setDirection</span><span class="p">(</span> <span class="n">Net</span><span class="p">.</span><span class="n">Direction</span><span class="p">.</span><span class="n">IN</span> <span class="p">);</span>
|
|
|
|
|
<span class="n">cout</span> <span class="o"><<</span> <span class="s">"Created "</span> <span class="o"><<</span> <span class="n">net</span> <span class="o"><<</span> <span class="n">endl</span><span class="p">;</span>
|
|
|
|
|
<span class="k">return</span> <span class="n">net</span><span class="p">;</span>
|
|
|
|
|
<span class="p">}</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>The equivalent <span class="sc">Python</span> code will be:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="o">*</span>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="n">Net</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">doSomething</span> <span class="p">():</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
<span class="c1"># Something...</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
<span class="k">def</span> <span class="nf">addNetToCell</span> <span class="p">(</span> <span class="n">cell</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">net</span> <span class="o">=</span> <span class="n">Net</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="s2">"new_net"</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">net</span><span class="o">.</span><span class="n">setGlobal</span> <span class="p">(</span> <span class="kc">False</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">net</span><span class="o">.</span><span class="n">setExternal</span><span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">net</span><span class="o">.</span><span class="n">setDirection</span><span class="p">(</span> <span class="n">Net</span><span class="o">.</span><span class="n">Direction</span><span class="o">.</span><span class="n">IN</span> <span class="p">)</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s2">"Created"</span><span class="p">,</span> <span class="n">net</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">return</span> <span class="n">net</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="various-kinds-of-constructors">
|
|
|
|
@ -267,7 +340,9 @@ and destroyed with their <span class="cb">destroy()</span> method.</p>
|
|
|
|
|
<li><p class="first">Objects that are <em>standalone</em>, like <a class="reference external" href="../../hurricane/classHurricane_1_1Point.html">Point</a> or <a class="reference external" href="../../hurricane/classHurricane_1_1Box.html">Box</a>, uses the usual construction
|
|
|
|
|
methods. They also use the <span class="sc">Python</span> garbage collector mechanism and do not need
|
|
|
|
|
to be explicitly deleted.</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">myfunc</span><span class="p">():</span>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="n">DbU</span><span class="p">,</span> <span class="n">Box</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">myfunc</span><span class="p">():</span>
|
|
|
|
|
<span class="n">bb</span> <span class="o">=</span> <span class="n">Box</span><span class="p">(</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span><span class="mf">15.0</span><span class="p">)</span>
|
|
|
|
@ -276,6 +351,126 @@ to be explicitly deleted.</p>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</li>
|
|
|
|
|
</ol>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="collections-and-iterators">
|
|
|
|
|
<h3>1.4 Collections and Iterators</h3>
|
|
|
|
|
<p>Hurricane <a class="reference external" href="../../hurricane/classHurricane_1_1Collection.html">Collection</a> behave like containers under <span class="sc">Python</span> and provide
|
|
|
|
|
support for the <span class="cb">iterator</span> protocol.</p>
|
|
|
|
|
<blockquote>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="n">Net</span><span class="p">,</span> <span class="n">Horizontal</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">delAllHorizontals</span> <span class="p">(</span> <span class="n">net</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">horizontals</span> <span class="o">=</span> <span class="p">[]</span>
|
|
|
|
|
<span class="k">for</span> <span class="n">component</span> <span class="ow">in</span> <span class="n">net</span><span class="o">.</span><span class="n">getComponents</span><span class="p">():</span>
|
|
|
|
|
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">component</span><span class="p">,</span><span class="n">Horizontal</span><span class="p">):</span>
|
|
|
|
|
<span class="n">horizontals</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> <span class="n">component</span> <span class="p">)</span>
|
|
|
|
|
<span class="c1"># Now we can remove the Horizontals.</span>
|
|
|
|
|
<span class="k">for</span> <span class="n">horizontal</span> <span class="ow">in</span> <span class="n">horizontals</span><span class="p">:</span>
|
|
|
|
|
<span class="n">horizontal</span><span class="o">.</span><span class="n">destroy</span><span class="p">()</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</blockquote>
|
|
|
|
|
<div class="admonition note">
|
|
|
|
|
<p class="first admonition-title">Note</p>
|
|
|
|
|
<p class="last"><strong>Never remove an element from a Collection_ while iterating over it</strong>.
|
|
|
|
|
You must save the to be removed elements in an auxiliary container
|
|
|
|
|
then remove them, like shown in the example above</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="dynamically-decorating-data-base-objects">
|
|
|
|
|
<h3>1.5 Dynamically decorating data-base objects</h3>
|
|
|
|
|
<p>When writing algorithms directly in Python, it may come in handy to be
|
|
|
|
|
able to add attributes over the Hurricane data-base objects. As C++
|
|
|
|
|
objects exposed to the Python realm cannot natively do so (it would
|
|
|
|
|
means to be able to modify a C++ aobject attributes <em>at runtime</em>),
|
|
|
|
|
we add a special Property tasked with handling the extra Python
|
|
|
|
|
attributes. The syntax has been made as simple as possible.</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="n">PythonAttributes</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">class</span> <span class="nc">MyAttribute</span> <span class="p">(</span> <span class="nb">object</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="fm">__init__</span> <span class="p">(</span> <span class="bp">self</span> <span class="p">):</span>
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">MyAttribute</span><span class="o">.</span><span class="n">count</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'</span><span class="si">{}</span><span class="s1"> has been created'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">MyAttribute</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="mi">1</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="fm">__del__</span> <span class="p">(</span> <span class="bp">self</span> <span class="p">):</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'</span><span class="si">{}</span><span class="s1"> has been deleted'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="fm">__str__</span> <span class="p">(</span> <span class="bp">self</span> <span class="p">):</span>
|
|
|
|
|
<span class="k">return</span> <span class="s1">'<MyAttribute </span><span class="si">{}</span><span class="s1">>'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">demoAttributes</span> <span class="p">(</span> <span class="n">cell</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">PythonAttributes</span><span class="o">.</span><span class="n">enable</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span> <span class="o">=</span> <span class="n">MyAttribute</span><span class="p">()</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">myAttribute1</span> <span class="o">=</span> <span class="n">MyAttribute</span><span class="p">()</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'cell.myAttribute0 ='</span><span class="p">,</span> <span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">del</span> <span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span>
|
|
|
|
|
<span class="n">PythonAttributes</span><span class="o">.</span><span class="n">disable</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>Detailing the life cycle of Python attributes on a <a class="reference external" href="../../hurricane/classHurricane_1_1DBo.html">DBo</a>:</p>
|
|
|
|
|
<ol class="arabic">
|
|
|
|
|
<li><p class="first">Enabling the addition of Python attribute on a <a class="reference external" href="../../hurricane/classHurricane_1_1DBo.html">DBo</a>:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">PythonAttributes</span><span class="o">.</span><span class="n">enable</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</li>
|
|
|
|
|
<li><p class="first">Adding/removing properties on the <a class="reference external" href="../../hurricane/classHurricane_1_1DBo.html">DBo</a>:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span> <span class="o">=</span> <span class="n">MyAttribute</span><span class="p">()</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">myAttribute1</span> <span class="o">=</span> <span class="n">MyAttribute</span><span class="p">()</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'cell.myAttribute0 ='</span><span class="p">,</span> <span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">del</span> <span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</li>
|
|
|
|
|
<li><p class="first">And finally disabling the use of Python attributes on the DBo.
|
|
|
|
|
Any still attached Python attributes will be released.</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">PythonAttributes</span><span class="o">.</span><span class="n">disable</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<div class="admonition note">
|
|
|
|
|
<p class="first admonition-title">Note</p>
|
|
|
|
|
<p class="last">When the attributes of a <a class="reference external" href="../../hurricane/classHurricane_1_1DBo.html">DBo</a> are released it does not automatically
|
|
|
|
|
imply that they are removed. Their reference count is decreased, and
|
|
|
|
|
if they are only referenced here, they will be deleted. But if other
|
|
|
|
|
variables still holds reference onto them, they will stay allocateds.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
<li><p class="first">There is no need to keep track of all the <a class="reference external" href="../../hurricane/classHurricane_1_1DBo.html">DBo</a> that have Python
|
|
|
|
|
attributes to disable them. One can directly call:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">PythonAttributes</span><span class="o">.</span><span class="n">disableAll</span><span class="p">()</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</li>
|
|
|
|
|
</ol>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="adapting-c-overlay">
|
|
|
|
|
<h3>1.6 Adapting C++ : Overlay</h3>
|
|
|
|
|
<p>Sometimes, the use of a wrapped C++ feature would be counter intuitive regarding
|
|
|
|
|
the <span class="sc">Python</span> feature. For those cases the <span class="cb">overlay</span> module provide an
|
|
|
|
|
adaptation of the C++ API for a more <em>Python-like</em> code. A typical example is
|
|
|
|
|
with the <a class="reference external" href="../../hurricane/classHurricane_1_1UpdateSession.html">UpdateSession</a> mechanism.</p>
|
|
|
|
|
<p>Using directly the C++ wrapper, we would write a code like this:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="n">UpdateSession</span><span class="p">,</span> <span class="n">Net</span><span class="p">,</span> <span class="n">Vertical</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">helpers</span> <span class="kn">import</span> <span class="n">l</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">editCell</span> <span class="p">(</span> <span class="n">cell</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
<span class="n">net</span> <span class="o">=</span> <span class="n">Net</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="s2">"nwell"</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">net</span><span class="p">,</span> <span class="n">nwell</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">7.5</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">15.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">27.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">51.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="c1"># Continued cell's layout building.</span>
|
|
|
|
|
<span class="c1"># ...</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>But, using the <span class="cb">overlay</span> we got the more <em>pythonic</em> code:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="n">Net</span><span class="p">,</span> <span class="n">Vertical</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">helpers</span> <span class="kn">import</span> <span class="n">l</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">helpers.overlay</span> <span class="kn">import</span> <span class="n">UpdateSession</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">editCell</span> <span class="p">(</span> <span class="n">cell</span> <span class="p">):</span>
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">net</span> <span class="o">=</span> <span class="n">Net</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="s2">"nwell"</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">net</span><span class="p">,</span> <span class="n">nwell</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">7.5</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">15.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">27.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">51.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="c1"># Continued cell's layout building.</span>
|
|
|
|
|
<span class="c1"># ...</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<!-- -*- Mode: rst -*- -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -308,53 +503,66 @@ infinite loop if it's called again in, say <span class="cb">~/.bashrc</span>.</p
|
|
|
|
|
<div class="section" id="user-s-configurations-file">
|
|
|
|
|
<h3>2.2 User's Configurations File</h3>
|
|
|
|
|
<p>You may create, in the directory you are lanching <span class="sc">Coriolis</span> tools, a special
|
|
|
|
|
sub-directory <tt class="docutils literal">.coriolis2/</tt> that can contain two configuration files:</p>
|
|
|
|
|
sub-directory <tt class="docutils literal">coriolis2/</tt> that can contain the configuration files:</p>
|
|
|
|
|
<ul class="simple">
|
|
|
|
|
<li><tt class="docutils literal">techno.py</tt> tells which technology to use.</li>
|
|
|
|
|
<li><tt class="docutils literal">__init__.py</tt> to tell <span class="sc">Python</span> this directory is a module.</li>
|
|
|
|
|
<li><tt class="docutils literal">settings.py</tt> can override almost any default configuration setting.</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p>Those two files are <em>optional</em>, if they do not exist the default settings
|
|
|
|
|
will be used and the technology is <tt class="docutils literal">symbolic/cmos</tt> (i.e. purely symbolic).</p>
|
|
|
|
|
<div class="admonition note">
|
|
|
|
|
<p class="first admonition-title">Note</p>
|
|
|
|
|
<p class="last">Those two files will by processed by the <span class="sc">Python</span> interpreter,
|
|
|
|
|
so they can contain any code in addition to the mandatory
|
|
|
|
|
variables.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="the-techno-py-file">
|
|
|
|
|
<h4>2.2.1 The <span class="cb">techno.py</span> File</h4>
|
|
|
|
|
<p>Must provide one variable named <span class="cb">technology</span> which values the path towards
|
|
|
|
|
the technology file. The available technologies are installed under
|
|
|
|
|
<tt class="docutils literal"><span class="pre"><CORIOLIS_INSTALL>/etc/coriolis2</span></tt>. For example, to use the 45nm FreeDPK
|
|
|
|
|
which is in:</p>
|
|
|
|
|
<pre class="literal-block">
|
|
|
|
|
<CORIOLIS_INSTALL>/etc/coriolis2/45/freepdk_45/
|
|
|
|
|
</pre>
|
|
|
|
|
<p>The <tt class="docutils literal">techno.py</tt> file must contain:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">technology</span> <span class="o">=</span> <span class="s1">'45/freepdk_45'</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="the-settings-py-file">
|
|
|
|
|
<h4>2.2.2 The <span class="cb">settings.py</span> File</h4>
|
|
|
|
|
<p>The entries of the <tt class="docutils literal">parametersTable</tt> and their definitions are detailed
|
|
|
|
|
<h3>2.3 The <span class="cb">settings.py</span> File</h3>
|
|
|
|
|
<p>The attributes name and definitions of <span class="cb">cfg</span> are detailed
|
|
|
|
|
in <a class="reference external" href="../UsersGuide/ViewerTools.html">CGT - The Graphical Interface</a>.</p>
|
|
|
|
|
<p><strong>Selecting the Technology</strong></p>
|
|
|
|
|
<p>The important line here is:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">symbolic.cmos</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>This import loads and setup the technology used througout this run of
|
|
|
|
|
<span class="sc">Coriolis</span>. One and only one technology can be loaded in a <span class="sc">Coriolis</span> run.</p>
|
|
|
|
|
<p>Example of file:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">defaultStyle</span> <span class="o">=</span> <span class="s1">'Alliance.Classic [black]'</span>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="c1"># -*- Mode:Python -*-</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">parametersTable</span> <span class="o">=</span> \
|
|
|
|
|
<span class="p">(</span> <span class="p">(</span><span class="s1">'misc.catchCore'</span> <span class="p">,</span> <span class="n">TypeBool</span> <span class="p">,</span> <span class="kc">False</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="p">(</span><span class="s1">'misc.info'</span> <span class="p">,</span> <span class="n">TypeBool</span> <span class="p">,</span> <span class="kc">False</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="p">(</span><span class="s1">'misc.paranoid'</span> <span class="p">,</span> <span class="n">TypeBool</span> <span class="p">,</span> <span class="kc">False</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="p">(</span><span class="s1">'misc.bug'</span> <span class="p">,</span> <span class="n">TypeBool</span> <span class="p">,</span> <span class="kc">False</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="p">(</span><span class="s1">'misc.logMode'</span> <span class="p">,</span> <span class="n">TypeBool</span> <span class="p">,</span> <span class="kc">False</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="p">(</span><span class="s1">'misc.verboseLevel1'</span> <span class="p">,</span> <span class="n">TypeBool</span> <span class="p">,</span> <span class="kc">False</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="p">(</span><span class="s1">'misc.verboseLevel2'</span> <span class="p">,</span> <span class="n">TypeBool</span> <span class="p">,</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">)</span>
|
|
|
|
|
<span class="kn">import</span> <span class="nn">os</span>
|
|
|
|
|
<span class="kn">import</span> <span class="nn">Cfg</span>
|
|
|
|
|
<span class="kn">import</span> <span class="nn">Viewer</span>
|
|
|
|
|
<span class="kn">import</span> <span class="nn">CRL</span>
|
|
|
|
|
<span class="kn">import</span> <span class="nn">symbolic.cmos</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">helpers</span> <span class="kn">import</span> <span class="n">overlay</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="s1">'CELLS_TOP'</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">:</span>
|
|
|
|
|
<span class="n">cellsTop</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s1">'CELLS_TOP'</span><span class="p">]</span>
|
|
|
|
|
<span class="k">else</span><span class="p">:</span>
|
|
|
|
|
<span class="n">cellsTop</span> <span class="o">=</span> <span class="s1">'../../../cells'</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">with</span> <span class="n">overlay</span><span class="o">.</span><span class="n">CfgCache</span><span class="p">(</span><span class="n">priority</span><span class="o">=</span><span class="n">Cfg</span><span class="o">.</span><span class="n">Parameter</span><span class="o">.</span><span class="n">Priority</span><span class="o">.</span><span class="n">UserFile</span><span class="p">)</span> <span class="k">as</span> <span class="n">cfg</span><span class="p">:</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">misc</span><span class="o">.</span><span class="n">catchCore</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">misc</span><span class="o">.</span><span class="n">info</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">misc</span><span class="o">.</span><span class="n">paranoid</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">misc</span><span class="o">.</span><span class="n">bug</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">misc</span><span class="o">.</span><span class="n">logMode</span> <span class="o">=</span> <span class="kc">True</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">misc</span><span class="o">.</span><span class="n">verboseLevel1</span> <span class="o">=</span> <span class="kc">True</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">misc</span><span class="o">.</span><span class="n">verboseLevel2</span> <span class="o">=</span> <span class="kc">True</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">misc</span><span class="o">.</span><span class="n">minTraceLevel</span> <span class="o">=</span> <span class="mi">1900</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">misc</span><span class="o">.</span><span class="n">maxTraceLevel</span> <span class="o">=</span> <span class="mi">3000</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">katana</span><span class="o">.</span><span class="n">eventsLimit</span> <span class="o">=</span> <span class="mi">1000000</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">katana</span><span class="o">.</span><span class="n">termSatReservedLocal</span> <span class="o">=</span> <span class="mi">6</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">katana</span><span class="o">.</span><span class="n">termSatThreshold</span> <span class="o">=</span> <span class="mi">9</span>
|
|
|
|
|
<span class="n">Viewer</span><span class="o">.</span><span class="n">Graphics</span><span class="o">.</span><span class="n">setStyle</span><span class="p">(</span> <span class="s1">'Alliance.Classic [black]'</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">af</span> <span class="o">=</span> <span class="n">CRL</span><span class="o">.</span><span class="n">AllianceFramework</span><span class="o">.</span><span class="n">get</span><span class="p">()</span>
|
|
|
|
|
<span class="n">env</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">getEnvironment</span><span class="p">()</span>
|
|
|
|
|
<span class="n">env</span><span class="o">.</span><span class="n">setCLOCK</span><span class="p">(</span> <span class="s1">'^ck$|m_clock|^clk$'</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">env</span><span class="o">.</span><span class="n">addSYSTEM_LIBRARY</span><span class="p">(</span> <span class="n">library</span><span class="o">=</span><span class="n">cellsTop</span><span class="o">+</span><span class="s1">'/nsxlib'</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">CRL</span><span class="o">.</span><span class="n">Environment</span><span class="o">.</span><span class="n">Prepend</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">env</span><span class="o">.</span><span class="n">addSYSTEM_LIBRARY</span><span class="p">(</span> <span class="n">library</span><span class="o">=</span><span class="n">cellsTop</span><span class="o">+</span><span class="s1">'/niolib'</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">CRL</span><span class="o">.</span><span class="n">Environment</span><span class="o">.</span><span class="n">Prepend</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<!-- -*- Mode: rst -*- -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="making-a-standard-cell-layout">
|
|
|
|
|
<h2><a class="toc-backref" href="#id12">3. Making a Standard Cell -- Layout</a></h2>
|
|
|
|
|
<p>In this part, we will show how to create and save a terminal <a class="reference external" href="../../hurricane/classHurricane_1_1Cell.html">Cell</a>,
|
|
|
|
@ -396,15 +604,12 @@ and, as stated above, inside a <a class="reference external" href="../../hurrica
|
|
|
|
|
environment is provided by the <span class="sc">crl</span> module.</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="o">*</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">CRL</span> <span class="kn">import</span> <span class="o">*</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">helpers.overlay</span> <span class="kn">import</span> <span class="n">UpdateSession</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">af</span> <span class="o">=</span> <span class="n">AllianceFramework</span><span class="o">.</span><span class="n">get</span><span class="p">()</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">cell</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">createCell</span><span class="p">(</span> <span class="s1">'my_inv'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="c1"># Build then save the Cell.</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">cell</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">createCell</span><span class="p">(</span> <span class="s1">'my_inv'</span> <span class="p">)</span>
|
|
|
|
|
<span class="c1"># Build then save the Cell.</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>This is the simplest call to <tt class="docutils literal">createCell()</tt>, and in that case, the newly
|
|
|
|
|
created <a class="reference external" href="../../hurricane/classHurricane_1_1Cell.html">Cell</a> will be saved in the <em>working library</em> (usually, the current
|
|
|
|
@ -428,23 +633,35 @@ two conversion functions are provided:</p>
|
|
|
|
|
</ul>
|
|
|
|
|
<p>In the weakly typed <span class="sc">Python</span> world, <span class="cb">lbd</span> is <em>float</em> while <span class="cb">unit</span>
|
|
|
|
|
is <em>integer</em>.</p>
|
|
|
|
|
<p>In order to reduce the number of characters one has to code, the <span class="cb">helpers</span>
|
|
|
|
|
module provides three very short function to perform conversion <em>towards</em>
|
|
|
|
|
<a class="reference external" href="../../hurricane/classHurricane_1_1DbU.html">DbU</a> :</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">l</span> <span class="p">(</span> <span class="n">value</span> <span class="p">):</span>
|
|
|
|
|
<span class="sd">"""Convert a lambda into a DbU."""</span>
|
|
|
|
|
<span class="k">return</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="n">value</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">u</span> <span class="p">(</span> <span class="n">value</span> <span class="p">):</span>
|
|
|
|
|
<span class="sd">"""Convert a length in micrometer into a DbU."""</span>
|
|
|
|
|
<span class="k">return</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromPhysical</span><span class="p">(</span> <span class="n">value</span><span class="p">,</span> <span class="n">Hurricane</span><span class="o">.</span><span class="n">DbU</span><span class="o">.</span><span class="n">UnitPowerMicro</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">n</span> <span class="p">(</span> <span class="n">value</span> <span class="p">):</span>
|
|
|
|
|
<span class="sd">"""Convert a length in nanometer into a DbU."""</span>
|
|
|
|
|
<span class="k">return</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromPhysical</span><span class="p">(</span> <span class="n">value</span><span class="p">,</span> <span class="n">Hurricane</span><span class="o">.</span><span class="n">DbU</span><span class="o">.</span><span class="n">UnitPowerNano</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="setting-up-the-abutment-box">
|
|
|
|
|
<h3>3.5 Setting up the Abutment Box</h3>
|
|
|
|
|
<p>To setup the abutment box, we use a <a class="reference external" href="../../hurricane/classHurricane_1_1Box.html">Box</a> which defines a box from
|
|
|
|
|
the coordinates of the lower left corner <tt class="docutils literal">(x1,y1)</tt> and upper left
|
|
|
|
|
corner <tt class="docutils literal">(x2,y2)</tt>.</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="n">Box</span><span class="p">(</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span> <span class="c1"># x1</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span> <span class="c1"># y1</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span><span class="mf">15.0</span><span class="p">)</span> <span class="c1"># x2</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span><span class="mf">50.0</span><span class="p">)</span> <span class="p">)</span> <span class="c1"># y2</span>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="n">Box</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span> <span class="c1"># x1</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span> <span class="c1"># y1</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">15.0</span><span class="p">)</span> <span class="c1"># x2</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">50.0</span><span class="p">)</span> <span class="p">)</span> <span class="c1"># y2</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">setAbutmentBox</span><span class="p">(</span> <span class="n">b</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>Or more simply:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">cell</span><span class="o">.</span><span class="n">setAbutmentBox</span><span class="p">(</span> <span class="n">Box</span><span class="p">(</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span><span class="mf">15.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span><span class="mf">50.0</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">cell</span><span class="o">.</span><span class="n">setAbutmentBox</span><span class="p">(</span> <span class="n">Box</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">15.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">50.0</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="adding-nets-and-components">
|
|
|
|
@ -503,10 +720,10 @@ external net, see <a class="reference external" href="./Netlist.html#id1">6.2 Cr
|
|
|
|
|
of <tt class="docutils literal">METAL1</tt>.</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">segment</span> <span class="o">=</span> <span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">i</span> <span class="c1"># The owner Net.</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">layer</span> <span class="c1"># The layer.</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">5.0</span> <span class="p">)</span> <span class="c1"># The X coordinate.</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">2.0</span> <span class="p">)</span> <span class="c1"># The width.</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">10.0</span> <span class="p">)</span> <span class="c1"># The Y source coordinate.</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">40.0</span> <span class="p">)</span> <span class="p">)</span> <span class="c1"># The Y target coordinate.</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">5.0</span> <span class="p">)</span> <span class="c1"># The X coordinate.</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">2.0</span> <span class="p">)</span> <span class="c1"># The width.</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">10.0</span> <span class="p">)</span> <span class="c1"># The Y source coordinate.</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">40.0</span> <span class="p">)</span> <span class="p">)</span> <span class="c1"># The Y target coordinate.</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>With this overload of the <tt class="docutils literal">Vertical.create()</tt> function the segment is created at an
|
|
|
|
|
absolute position. There is a second overload for creating a relatively placed
|
|
|
|
@ -559,33 +776,31 @@ explanation of that part of the code, refer to <a class="reference external" hre
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/python</span>
|
|
|
|
|
|
|
|
|
|
<span class="kn">import</span> <span class="nn">sys</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="o">*</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">CRL</span> <span class="kn">import</span> <span class="o">*</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">toDbU</span> <span class="p">(</span> <span class="n">l</span> <span class="p">):</span> <span class="k">return</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span><span class="n">l</span><span class="p">)</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="n">DataBase</span><span class="p">,</span> <span class="n">NetExternalComponents</span><span class="p">,</span> <span class="n">Net</span><span class="p">,</span> \
|
|
|
|
|
<span class="n">DbU</span><span class="p">,</span> <span class="n">Point</span><span class="p">,</span> <span class="n">Box</span><span class="p">,</span> <span class="n">Horizontal</span><span class="p">,</span> <span class="n">Vertical</span><span class="p">,</span> <span class="n">Contact</span><span class="p">,</span> <span class="n">RoutingPad</span><span class="p">,</span> \
|
|
|
|
|
<span class="n">Breakpoint</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">CRL</span> <span class="kn">import</span> <span class="n">AllianceFramework</span><span class="p">,</span> <span class="n">Catalog</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">helpers</span> <span class="kn">import</span> <span class="n">l</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">helpers.overlay</span> <span class="kn">import</span> <span class="n">UpdateSession</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">doBreak</span> <span class="p">(</span> <span class="n">level</span><span class="p">,</span> <span class="n">message</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
<span class="sd">"""Put a breakpoint into the script."""</span>
|
|
|
|
|
<span class="n">Breakpoint</span><span class="o">.</span><span class="n">stop</span><span class="p">(</span> <span class="n">level</span><span class="p">,</span> <span class="n">message</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">buildInvertor</span> <span class="p">(</span> <span class="n">editor</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
<span class="sd">"""Build step by step an invertor standard cell."""</span>
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">cell</span> <span class="o">=</span> <span class="n">AllianceFramework</span><span class="o">.</span><span class="n">get</span><span class="p">()</span><span class="o">.</span><span class="n">createCell</span><span class="p">(</span> <span class="s1">'invertor'</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">setTerminal</span><span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">setAbutmentBox</span><span class="p">(</span> <span class="n">Box</span><span class="p">(</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">15.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">50.0</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">setTerminalNetlist</span><span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">setAbutmentBox</span><span class="p">(</span> <span class="n">Box</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">15.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">50.0</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">editor</span><span class="p">:</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
<span class="n">editor</span><span class="o">.</span><span class="n">setCell</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">editor</span><span class="o">.</span><span class="n">fit</span><span class="p">()</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">technology</span> <span class="o">=</span> <span class="n">DataBase</span><span class="o">.</span><span class="n">getDB</span><span class="p">()</span><span class="o">.</span><span class="n">getTechnology</span><span class="p">()</span>
|
|
|
|
|
<span class="n">metal1</span> <span class="o">=</span> <span class="n">technology</span><span class="o">.</span><span class="n">getLayer</span><span class="p">(</span> <span class="s2">"METAL1"</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">poly</span> <span class="o">=</span> <span class="n">technology</span><span class="o">.</span><span class="n">getLayer</span><span class="p">(</span> <span class="s2">"POLY"</span> <span class="p">)</span>
|
|
|
|
@ -600,61 +815,61 @@ explanation of that part of the code, refer to <a class="reference external" hre
|
|
|
|
|
<span class="n">ntie</span> <span class="o">=</span> <span class="n">technology</span><span class="o">.</span><span class="n">getLayer</span><span class="p">(</span> <span class="s2">"NTIE"</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">net</span> <span class="o">=</span> <span class="n">Net</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="s2">"nwell"</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">net</span><span class="p">,</span> <span class="n">nwell</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">7.5</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">15.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">27.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">51.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">net</span><span class="p">,</span> <span class="n">nwell</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">7.5</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">15.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">27.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">51.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">vdd</span> <span class="o">=</span> <span class="n">Net</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="s2">"vdd"</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">vdd</span><span class="o">.</span><span class="n">setExternal</span><span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">vdd</span><span class="o">.</span><span class="n">setGlobal</span> <span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">h</span> <span class="o">=</span> <span class="n">Horizontal</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">vdd</span><span class="p">,</span> <span class="n">metal1</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">47.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">6.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">15.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">h</span> <span class="o">=</span> <span class="n">Horizontal</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">vdd</span><span class="p">,</span> <span class="n">metal1</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">47.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">6.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">15.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">NetExternalComponents</span><span class="o">.</span><span class="n">setExternal</span><span class="p">(</span> <span class="n">h</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">vdd</span><span class="p">,</span> <span class="n">contdifn</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">47.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">vdd</span><span class="p">,</span> <span class="n">contdifp</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">4.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">45.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">vdd</span><span class="p">,</span> <span class="n">pdif</span> <span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">3.5</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">4.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">28.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">46.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">vdd</span><span class="p">,</span> <span class="n">ntie</span> <span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">3.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">43.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">48.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">vdd</span><span class="p">,</span> <span class="n">contdifn</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">47.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">vdd</span><span class="p">,</span> <span class="n">contdifp</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">4.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">45.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">vdd</span><span class="p">,</span> <span class="n">pdif</span> <span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">3.5</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">4.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">28.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">46.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">vdd</span><span class="p">,</span> <span class="n">ntie</span> <span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">3.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">43.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">48.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">doBreak</span><span class="p">(</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'Done building vdd.'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">vss</span> <span class="o">=</span> <span class="n">Net</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="s2">"vss"</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">vss</span><span class="o">.</span><span class="n">setExternal</span><span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">vss</span><span class="o">.</span><span class="n">setGlobal</span> <span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">h</span> <span class="o">=</span> <span class="n">Horizontal</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">vss</span><span class="p">,</span> <span class="n">metal1</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">3.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">6.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">15.0</span><span class="p">))</span>
|
|
|
|
|
<span class="n">h</span> <span class="o">=</span> <span class="n">Horizontal</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">vss</span><span class="p">,</span> <span class="n">metal1</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">3.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">6.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">15.0</span><span class="p">))</span>
|
|
|
|
|
<span class="n">NetExternalComponents</span><span class="o">.</span><span class="n">setExternal</span><span class="p">(</span> <span class="n">h</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">vss</span><span class="p">,</span> <span class="n">ndif</span> <span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">3.5</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">4.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">4.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">12.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">vss</span><span class="p">,</span> <span class="n">contdifn</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">4.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">5.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">1.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">vss</span><span class="p">,</span> <span class="n">ndif</span> <span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">3.5</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">4.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">4.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">12.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">vss</span><span class="p">,</span> <span class="n">contdifn</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">4.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">5.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">1.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">doBreak</span><span class="p">(</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'Done building vss.'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">i</span> <span class="o">=</span> <span class="n">Net</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="s2">"i"</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">i</span><span class="o">.</span><span class="n">setExternal</span><span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">v</span> <span class="o">=</span> <span class="n">Vertical</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">metal1</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">5.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">2.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">40.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">v</span> <span class="o">=</span> <span class="n">Vertical</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">metal1</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">5.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">2.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">40.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">NetExternalComponents</span><span class="o">.</span><span class="n">setExternal</span><span class="p">(</span> <span class="n">v</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">ptrans</span> <span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">7.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">26.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">39.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">ntrans</span> <span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">7.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">6.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">14.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">poly</span> <span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">7.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">14.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">26.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Horizontal</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">poly</span> <span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">20.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">3.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">4.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">7.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">contpoly</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">5.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">20.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">ptrans</span> <span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">7.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">26.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">39.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">ntrans</span> <span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">7.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">6.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">14.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">poly</span> <span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">7.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">14.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">26.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Horizontal</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">poly</span> <span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">20.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">3.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">4.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">7.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">i</span><span class="p">,</span> <span class="n">contpoly</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">5.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">20.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">doBreak</span><span class="p">(</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'Done building i.'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">nq</span> <span class="o">=</span> <span class="n">Net</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="s2">"nq"</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">nq</span><span class="o">.</span><span class="n">setExternal</span><span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">v</span> <span class="o">=</span> <span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">metal1</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">2.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">40.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">v</span> <span class="o">=</span> <span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">metal1</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">2.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">40.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">NetExternalComponents</span><span class="o">.</span><span class="n">setExternal</span><span class="p">(</span> <span class="n">v</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">pdif</span> <span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">3.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">28.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">37.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">ndif</span> <span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">3.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">8.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">12.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">contdifp</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">35.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">contdifp</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">30.5</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">contdifn</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">pdif</span> <span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">3.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">28.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">37.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">ndif</span> <span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">3.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">8.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">12.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">contdifp</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">35.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">contdifp</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">30.5</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Contact</span><span class="o">.</span><span class="n">create</span> <span class="p">(</span> <span class="n">nq</span><span class="p">,</span> <span class="n">contdifn</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">1.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">doBreak</span><span class="p">(</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'Done building q.'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
<span class="n">AllianceFramework</span><span class="o">.</span><span class="n">get</span><span class="p">()</span><span class="o">.</span><span class="n">saveCell</span><span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">return</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">scriptMain</span> <span class="p">(</span> <span class="o">**</span><span class="n">kw</span> <span class="p">):</span>
|
|
|
|
|
<span class="sd">"""The Mandatory function to be run by Coriolis interactively."""</span>
|
|
|
|
|
<span class="n">editor</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
<span class="k">if</span> <span class="n">kw</span><span class="o">.</span><span class="n">has_key</span><span class="p">(</span><span class="s1">'editor'</span><span class="p">)</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]:</span>
|
|
|
|
|
<span class="k">if</span> <span class="s1">'editor'</span> <span class="ow">in</span> <span class="n">kw</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]:</span>
|
|
|
|
|
<span class="n">editor</span> <span class="o">=</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">buildInvertor</span><span class="p">(</span> <span class="n">editor</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">return</span> <span class="kc">True</span>
|
|
|
|
|
</pre></div>
|
|
|
|
@ -672,11 +887,11 @@ an algorithmic walkthrough of the database can be accessed through a <a class="r
|
|
|
|
|
<p>C++ Collections objects are exposed in <span class="sc">Python</span> through the <em>iterable</em> protocol,
|
|
|
|
|
allowing to simply write:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">net</span> <span class="ow">in</span> <span class="n">cell</span><span class="o">.</span><span class="n">getNets</span><span class="p">():</span>
|
|
|
|
|
<span class="nb">print</span> <span class="s1">'Components of'</span><span class="p">,</span> <span class="n">net</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'Components of'</span><span class="p">,</span> <span class="n">net</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">for</span> <span class="n">component</span> <span class="ow">in</span> <span class="n">net</span><span class="o">.</span><span class="n">getComponents</span><span class="p">():</span>
|
|
|
|
|
<span class="nb">print</span> <span class="s1">'|'</span><span class="p">,</span> <span class="n">component</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'|'</span><span class="p">,</span> <span class="n">component</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>In C++ we would have written:</p>
|
|
|
|
|
<p>In C++ we would have been written:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="k">for</span> <span class="p">(</span> <span class="n">Net</span><span class="o">*</span> <span class="nl">net</span> <span class="p">:</span> <span class="n">cell</span><span class="o">-></span><span class="n">getNets</span><span class="p">()</span> <span class="p">)</span> <span class="p">{</span>
|
|
|
|
|
<span class="n">cout</span> <span class="o"><<</span> <span class="s">"Components of "</span> <span class="o"><<</span> <span class="n">net</span> <span class="o"><<</span> <span class="n">endl</span><span class="p">;</span>
|
|
|
|
|
<span class="k">for</span> <span class="p">(</span> <span class="n">Component</span><span class="o">*</span> <span class="nl">component</span> <span class="p">:</span> <span class="n">net</span><span class="o">-></span><span class="n">getComponents</span><span class="p">()</span> <span class="p">)</span> <span class="p">{</span>
|
|
|
|
@ -698,7 +913,7 @@ loop. For example:</p>
|
|
|
|
|
<span class="c1"># Remove all the anonymous nets.</span>
|
|
|
|
|
<span class="k">for</span> <span class="n">net</span> <span class="ow">in</span> <span class="n">cellNets</span><span class="p">:</span>
|
|
|
|
|
<span class="k">if</span> <span class="n">net</span><span class="o">.</span><span class="n">getName</span><span class="p">()</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s1">'nymous_'</span><span class="p">):</span>
|
|
|
|
|
<span class="nb">print</span> <span class="s1">'Destroy'</span><span class="p">,</span> <span class="n">net</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'Destroy'</span><span class="p">,</span> <span class="n">net</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">net</span><span class="o">.</span><span class="n">destroy</span><span class="p">()</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
|
|
|
@ -758,37 +973,33 @@ script in the viewer, do not use the <tt class="docutils literal"><span class="p
|
|
|
|
|
you will only see the end result of your script.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">buildInvertor</span> <span class="p">(</span> <span class="n">editor</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
<span class="sd">"""Build step by step an invertor standard cell."""</span>
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">cell</span> <span class="o">=</span> <span class="n">AllianceFramework</span><span class="o">.</span><span class="n">get</span><span class="p">()</span><span class="o">.</span><span class="n">createCell</span><span class="p">(</span> <span class="s1">'invertor'</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">setTerminal</span><span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">setAbutmentBox</span><span class="p">(</span> <span class="n">Box</span><span class="p">(</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">15.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">50.0</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">setTerminalNetlist</span><span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">setAbutmentBox</span><span class="p">(</span> <span class="n">Box</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">15.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">50.0</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">if</span> <span class="n">editor</span><span class="p">:</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
<span class="n">editor</span><span class="o">.</span><span class="n">setCell</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">editor</span><span class="o">.</span><span class="n">fit</span><span class="p">()</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
<span class="c1"># The rest of the script...</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">return</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">scriptMain</span> <span class="p">(</span> <span class="o">**</span><span class="n">kw</span> <span class="p">):</span>
|
|
|
|
|
<span class="sd">"""The Mandatory function to be run by Coriolis interactively."""</span>
|
|
|
|
|
<span class="n">editor</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
<span class="k">if</span> <span class="n">kw</span><span class="o">.</span><span class="n">has_key</span><span class="p">(</span><span class="s1">'editor'</span><span class="p">)</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]:</span>
|
|
|
|
|
<span class="k">if</span> <span class="s1">'editor'</span> <span class="ow">in</span> <span class="n">kw</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]:</span>
|
|
|
|
|
<span class="n">editor</span> <span class="o">=</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">buildInvertor</span><span class="p">(</span> <span class="n">editor</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">return</span> <span class="kc">True</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<div class="section" id="using-breakpoints">
|
|
|
|
|
<h3>5.1 Using Breakpoints</h3>
|
|
|
|
|
<p>It is possible to add breakpoints inside a script by calling the <tt class="docutils literal">Breakpoint.stop()</tt>
|
|
|
|
|
function. To be able to see exactly what has just been mofied, we must close the
|
|
|
|
|
<a class="reference external" href="../../hurricane/classHurricane_1_1UpdateSession.html">UpdateSession</a> just before calling the breakpoint and reopen it just after.
|
|
|
|
|
function. To be able to see exactly what has just been modified, be sure to have
|
|
|
|
|
closed any <a class="reference external" href="../../hurricane/classHurricane_1_1UpdateSession.html">UpdateSession</a> before calling breakpoints.
|
|
|
|
|
The <tt class="docutils literal">Breakpoint.stop()</tt> function takes two arguments:</p>
|
|
|
|
|
<ol class="arabic simple">
|
|
|
|
|
<li>The <tt class="docutils literal">level</tt> above which it will be active.</li>
|
|
|
|
@ -796,9 +1007,7 @@ The <tt class="docutils literal">Breakpoint.stop()</tt> function takes two argum
|
|
|
|
|
</ol>
|
|
|
|
|
<p>We can create a little function to ease the work:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">doBreak</span> <span class="p">(</span> <span class="n">level</span><span class="p">,</span> <span class="n">message</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
<span class="n">Breakpoint</span><span class="o">.</span><span class="n">stop</span><span class="p">(</span> <span class="n">level</span><span class="p">,</span> <span class="n">message</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<!-- -*- Mode: rst -*- -->
|
|
|
|
|
</div>
|
|
|
|
@ -914,9 +1123,7 @@ that the abutment box lower left corner is at <tt class="docutils literal">(0,0)
|
|
|
|
|
instance to left of the second row.</p>
|
|
|
|
|
<p>Setting the translation on an <a class="reference external" href="../../hurricane/classHurricane_1_1Instance.html">Instance</a> is not enough to make it be displayed,
|
|
|
|
|
we also must set its <em>placement status</em> to <tt class="docutils literal">Instance.PlacementStatus.PLACED</tt>.</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">xr2_1</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span><span class="mf">100.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">Transformation</span><span class="o">.</span><span class="n">Orientation</span><span class="o">.</span><span class="n">MY</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">xr2_1</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">100.0</span><span class="p">),</span> <span class="n">Transformation</span><span class="o">.</span><span class="n">Orientation</span><span class="o">.</span><span class="n">MY</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">xr2_1</span><span class="o">.</span><span class="n">setPlacementStatus</span><span class="p">(</span> <span class="n">Instance</span><span class="o">.</span><span class="n">PlacementStatus</span><span class="o">.</span><span class="n">PLACED</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
|
|
|
@ -966,11 +1173,11 @@ contacts.</p>
|
|
|
|
|
<span class="p">,</span> <span class="n">RoutingPad</span><span class="o">.</span><span class="n">BiggestArea</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="c1"># Then regular wiring.</span>
|
|
|
|
|
<span class="n">contact1</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">rp1</span><span class="p">,</span> <span class="n">via12</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="o">-</span><span class="mf">15.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">contact2</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">rp2</span><span class="p">,</span> <span class="n">via12</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">10.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">turn</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">a</span> <span class="p">,</span> <span class="n">via23</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">35.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Horizontal</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">contact2</span><span class="p">,</span> <span class="n">turn</span> <span class="p">,</span> <span class="n">metal2</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">35.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">2.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span> <span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">turn</span> <span class="p">,</span> <span class="n">contact1</span> <span class="p">,</span> <span class="n">metal3</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">2.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">contact1</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">rp1</span><span class="p">,</span> <span class="n">via12</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="o">-</span><span class="mf">15.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">contact2</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">rp2</span><span class="p">,</span> <span class="n">via12</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">10.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">turn</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">a</span> <span class="p">,</span> <span class="n">via23</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">35.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Horizontal</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">contact2</span><span class="p">,</span> <span class="n">turn</span> <span class="p">,</span> <span class="n">metal2</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">35.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">2.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span> <span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">turn</span> <span class="p">,</span> <span class="n">contact1</span> <span class="p">,</span> <span class="n">metal3</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">2.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<div class="admonition note">
|
|
|
|
|
<p class="first admonition-title">Note</p>
|
|
|
|
@ -987,38 +1194,36 @@ directory (under the the root of the <span class="sc">Coriolis</span> installati
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/python</span>
|
|
|
|
|
|
|
|
|
|
<span class="kn">import</span> <span class="nn">sys</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="o">*</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">CRL</span> <span class="kn">import</span> <span class="o">*</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">toDbU</span> <span class="p">(</span> <span class="n">l</span> <span class="p">):</span> <span class="k">return</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span><span class="n">l</span><span class="p">)</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="n">DataBase</span><span class="p">,</span> <span class="n">Instance</span><span class="p">,</span> <span class="n">Box</span><span class="p">,</span> <span class="n">Net</span><span class="p">,</span> <span class="n">Horizontal</span><span class="p">,</span> <span class="n">Vertical</span><span class="p">,</span> <span class="n">Contact</span><span class="p">,</span> \
|
|
|
|
|
<span class="n">RoutingPad</span><span class="p">,</span> <span class="n">Transformation</span><span class="p">,</span> <span class="n">Occurrence</span><span class="p">,</span> \
|
|
|
|
|
<span class="n">Breakpoint</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">CRL</span> <span class="kn">import</span> <span class="n">AllianceFramework</span><span class="p">,</span> <span class="n">Catalog</span><span class="p">,</span> <span class="n">Gds</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">helpers</span> <span class="kn">import</span> <span class="n">l</span>
|
|
|
|
|
<span class="kn">from</span> <span class="nn">helpers.overlay</span> <span class="kn">import</span> <span class="n">UpdateSession</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">doBreak</span> <span class="p">(</span> <span class="n">level</span><span class="p">,</span> <span class="n">message</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
<span class="sd">"""Put a breakpoint into the script."""</span>
|
|
|
|
|
<span class="n">Breakpoint</span><span class="o">.</span><span class="n">stop</span><span class="p">(</span> <span class="n">level</span><span class="p">,</span> <span class="n">message</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">buildFulladder</span> <span class="p">(</span> <span class="n">editor</span> <span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
<span class="sd">"""Build step by step full adder (netlist & placement)."""</span>
|
|
|
|
|
<span class="c1"># Get the Framework and all the master cells.</span>
|
|
|
|
|
<span class="n">af</span> <span class="o">=</span> <span class="n">AllianceFramework</span><span class="o">.</span><span class="n">get</span><span class="p">()</span>
|
|
|
|
|
<span class="n">xr2_x2</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">getCell</span><span class="p">(</span> <span class="s1">'xr2_x1'</span><span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">a2_x2</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">getCell</span><span class="p">(</span> <span class="s1">'a2_x2'</span> <span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">o2_x2</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">getCell</span><span class="p">(</span> <span class="s1">'o2_x2'</span> <span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">fulladder</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">createCell</span><span class="p">(</span> <span class="s1">'fulladder'</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">fulladder</span><span class="o">.</span><span class="n">setAbutmentBox</span><span class="p">(</span> <span class="n">Box</span><span class="p">(</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">90.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">100.0</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">fulladder</span><span class="o">.</span><span class="n">setAbutmentBox</span><span class="p">(</span> <span class="n">Box</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">90.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">100.0</span><span class="p">)</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">editor</span><span class="p">:</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
<span class="n">editor</span><span class="o">.</span><span class="n">setCell</span><span class="p">(</span> <span class="n">fulladder</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">editor</span><span class="o">.</span><span class="n">fit</span><span class="p">()</span>
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="c1"># Create Instances.</span>
|
|
|
|
|
<span class="n">a2_1</span> <span class="o">=</span> <span class="n">Instance</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">fulladder</span><span class="p">,</span> <span class="s1">'a2_1'</span><span class="p">,</span> <span class="n">a2_x2</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">a2_2</span> <span class="o">=</span> <span class="n">Instance</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">fulladder</span><span class="p">,</span> <span class="s1">'a2_2'</span><span class="p">,</span> <span class="n">a2_x2</span> <span class="p">)</span>
|
|
|
|
@ -1072,49 +1277,55 @@ directory (under the the root of the <span class="sc">Coriolis</span> installati
|
|
|
|
|
<span class="n">o2_1</span><span class="o">.</span><span class="n">getPlug</span><span class="p">(</span> <span class="n">o2_x2</span><span class="o">.</span><span class="n">getNet</span><span class="p">(</span><span class="s1">'q'</span><span class="p">)</span> <span class="p">)</span><span class="o">.</span><span class="n">setNet</span><span class="p">(</span> <span class="n">cout</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="c1"># Instances placement.</span>
|
|
|
|
|
<span class="n">a2_1</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">a2_1</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">Transformation</span><span class="o">.</span><span class="n">Orientation</span><span class="o">.</span><span class="n">ID</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">a2_1</span><span class="o">.</span><span class="n">setPlacementStatus</span><span class="p">(</span> <span class="n">Instance</span><span class="o">.</span><span class="n">PlacementStatus</span><span class="o">.</span><span class="n">PLACED</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">doBreak</span><span class="p">(</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'Placed a2_1'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">xr2_1</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">100.0</span><span class="p">)</span>
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">xr2_1</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">100.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">Transformation</span><span class="o">.</span><span class="n">Orientation</span><span class="o">.</span><span class="n">MY</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">xr2_1</span><span class="o">.</span><span class="n">setPlacementStatus</span><span class="p">(</span> <span class="n">Instance</span><span class="o">.</span><span class="n">PlacementStatus</span><span class="o">.</span><span class="n">PLACED</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">doBreak</span><span class="p">(</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'Placed xr2_1'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">a2_2</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">25.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">a2_2</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span><span class="mf">25.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">Transformation</span><span class="o">.</span><span class="n">Orientation</span><span class="o">.</span><span class="n">ID</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">a2_2</span><span class="o">.</span><span class="n">setPlacementStatus</span><span class="p">(</span> <span class="n">Instance</span><span class="o">.</span><span class="n">PlacementStatus</span><span class="o">.</span><span class="n">PLACED</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">doBreak</span><span class="p">(</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'Placed a2_2'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">xr2_2</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">45.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">100.0</span><span class="p">)</span>
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">xr2_2</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span> <span class="mf">45.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">100.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">Transformation</span><span class="o">.</span><span class="n">Orientation</span><span class="o">.</span><span class="n">MY</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">xr2_2</span><span class="o">.</span><span class="n">setPlacementStatus</span><span class="p">(</span> <span class="n">Instance</span><span class="o">.</span><span class="n">PlacementStatus</span><span class="o">.</span><span class="n">PLACED</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">doBreak</span><span class="p">(</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'Placed xr2_2'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">o2_1</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">65.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">o2_1</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span><span class="mf">65.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">Transformation</span><span class="o">.</span><span class="n">Orientation</span><span class="o">.</span><span class="n">ID</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">o2_1</span><span class="o">.</span><span class="n">setPlacementStatus</span><span class="p">(</span> <span class="n">Instance</span><span class="o">.</span><span class="n">PlacementStatus</span><span class="o">.</span><span class="n">PLACED</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">doBreak</span><span class="p">(</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'Placed o2_1'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="c1"># Add filler cells.</span>
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">tie_x0</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">getCell</span><span class="p">(</span> <span class="s1">'tie_x0'</span><span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">rowend_x0</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">getCell</span><span class="p">(</span> <span class="s1">'rowend_x0'</span><span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">filler_1</span> <span class="o">=</span> <span class="n">Instance</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">fulladder</span><span class="p">,</span> <span class="s1">'filler_1'</span><span class="p">,</span> <span class="n">tie_x0</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">filler_2</span> <span class="o">=</span> <span class="n">Instance</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">fulladder</span><span class="p">,</span> <span class="s1">'filler_2'</span><span class="p">,</span> <span class="n">rowend_x0</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">filler_1</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">50.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="n">filler_1</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span><span class="mf">50.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">Transformation</span><span class="o">.</span><span class="n">Orientation</span><span class="o">.</span><span class="n">ID</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">filler_1</span><span class="o">.</span><span class="n">setPlacementStatus</span><span class="p">(</span> <span class="n">Instance</span><span class="o">.</span><span class="n">PlacementStatus</span><span class="o">.</span><span class="n">PLACED</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">filler_2</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">60.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="n">filler_2</span><span class="o">.</span><span class="n">setTransformation</span><span class="p">(</span> <span class="n">Transformation</span><span class="p">(</span> <span class="n">l</span><span class="p">(</span><span class="mf">60.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="n">Transformation</span><span class="o">.</span><span class="n">Orientation</span><span class="o">.</span><span class="n">ID</span> <span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">filler_2</span><span class="o">.</span><span class="n">setPlacementStatus</span><span class="p">(</span> <span class="n">Instance</span><span class="o">.</span><span class="n">PlacementStatus</span><span class="o">.</span><span class="n">PLACED</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">doBreak</span><span class="p">(</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">'Filler cell placeds'</span> <span class="p">)</span>
|
|
|
|
@ -1126,6 +1337,7 @@ directory (under the the root of the <span class="sc">Coriolis</span> installati
|
|
|
|
|
<span class="n">via12</span> <span class="o">=</span> <span class="n">technology</span><span class="o">.</span><span class="n">getLayer</span><span class="p">(</span> <span class="s2">"VIA12"</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">via23</span> <span class="o">=</span> <span class="n">technology</span><span class="o">.</span><span class="n">getLayer</span><span class="p">(</span> <span class="s2">"VIA23"</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="c1"># Build wiring for a.</span>
|
|
|
|
|
<span class="c1"># Create RoutingPads first.</span>
|
|
|
|
|
<span class="n">rp1</span> <span class="o">=</span> <span class="n">RoutingPad</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">a</span>
|
|
|
|
@ -1136,23 +1348,20 @@ directory (under the the root of the <span class="sc">Coriolis</span> installati
|
|
|
|
|
<span class="p">,</span> <span class="n">RoutingPad</span><span class="o">.</span><span class="n">BiggestArea</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="c1"># Then regular wiring.</span>
|
|
|
|
|
<span class="n">contact1</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">rp1</span><span class="p">,</span> <span class="n">via12</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="o">-</span><span class="mf">15.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">contact2</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">rp2</span><span class="p">,</span> <span class="n">via12</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">10.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">turn</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">a</span> <span class="p">,</span> <span class="n">via23</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span> <span class="mf">35.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Horizontal</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">contact2</span><span class="p">,</span> <span class="n">turn</span> <span class="p">,</span> <span class="n">metal2</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">35.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">2.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span> <span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">turn</span> <span class="p">,</span> <span class="n">contact1</span> <span class="p">,</span> <span class="n">metal3</span><span class="p">,</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">toDbU</span><span class="p">(</span><span class="mf">2.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
<span class="n">contact1</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">rp1</span><span class="p">,</span> <span class="n">via12</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="o">-</span><span class="mf">15.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">contact2</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">rp2</span><span class="p">,</span> <span class="n">via12</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span> <span class="mf">0.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">10.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">turn</span> <span class="o">=</span> <span class="n">Contact</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">a</span> <span class="p">,</span> <span class="n">via23</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span> <span class="mf">35.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Horizontal</span><span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">contact2</span><span class="p">,</span> <span class="n">turn</span> <span class="p">,</span> <span class="n">metal2</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">35.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">2.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">Vertical</span> <span class="o">.</span><span class="n">create</span><span class="p">(</span> <span class="n">turn</span> <span class="p">,</span> <span class="n">contact1</span> <span class="p">,</span> <span class="n">metal3</span><span class="p">,</span> <span class="n">l</span><span class="p">(</span><span class="mf">10.0</span><span class="p">),</span> <span class="n">l</span><span class="p">(</span><span class="mf">2.0</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">af</span><span class="o">.</span><span class="n">saveCell</span><span class="p">(</span> <span class="n">fulladder</span><span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">return</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">scriptMain</span> <span class="p">(</span> <span class="o">**</span><span class="n">kw</span> <span class="p">):</span>
|
|
|
|
|
<span class="sd">"""The Mandatory function to be run by Coriolis interactively."""</span>
|
|
|
|
|
<span class="n">editor</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
<span class="k">if</span> <span class="n">kw</span><span class="o">.</span><span class="n">has_key</span><span class="p">(</span><span class="s1">'editor'</span><span class="p">)</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]:</span>
|
|
|
|
|
<span class="k">if</span> <span class="s1">'editor'</span> <span class="ow">in</span> <span class="n">kw</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]:</span>
|
|
|
|
|
<span class="n">editor</span> <span class="o">=</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">buildFulladder</span><span class="p">(</span> <span class="n">editor</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">return</span> <span class="kc">True</span>
|
|
|
|
|
</pre></div>
|
|
|
|
@ -1222,15 +1431,14 @@ small, it will issue an error.</p>
|
|
|
|
|
</li>
|
|
|
|
|
<li><p class="first">Setup <span class="sc">Etesian</span> parameters through the <tt class="docutils literal">settings.py</tt> configuration
|
|
|
|
|
file. For example:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">parametersTable</span> <span class="o">=</span> \
|
|
|
|
|
<span class="p">(</span> <span class="p">(</span><span class="s2">"etesian.effort"</span> <span class="p">,</span> <span class="n">TypeEnumerate</span> <span class="p">,</span> <span class="mi">2</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="p">(</span><span class="s1">'etesian.uniformDensity'</span> <span class="p">,</span> <span class="n">TypeBool</span> <span class="p">,</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="p">(</span><span class="s1">'etesian.spaceMargin'</span> <span class="p">,</span> <span class="n">TypePercentage</span><span class="p">,</span> <span class="mf">3.0</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">,</span> <span class="p">(</span><span class="s1">'etesian.aspectRatio'</span> <span class="p">,</span> <span class="n">TypePercentage</span><span class="p">,</span> <span class="mf">100.0</span> <span class="p">)</span>
|
|
|
|
|
<span class="p">)</span>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="k">with</span> <span class="n">overlay</span><span class="o">.</span><span class="n">CfgCache</span><span class="p">(</span><span class="n">priority</span><span class="o">=</span><span class="n">Cfg</span><span class="o">.</span><span class="n">Parameter</span><span class="o">.</span><span class="n">Priority</span><span class="o">.</span><span class="n">UserFile</span><span class="p">)</span> <span class="k">as</span> <span class="n">cfg</span><span class="p">:</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">etesian</span><span class="o">.</span><span class="n">effort</span> <span class="o">=</span> <span class="mi">2</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">etesian</span><span class="o">.</span><span class="n">uniformDensity</span> <span class="o">=</span> <span class="kc">True</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">etesian</span><span class="o">.</span><span class="n">spaceMargin</span> <span class="o">=</span> <span class="mf">0.8</span>
|
|
|
|
|
<span class="n">cfg</span><span class="o">.</span><span class="n">etesian</span><span class="o">.</span><span class="n">aspectRatio</span> <span class="o">=</span> <span class="mf">1.0</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>With this setup, the cells will be spread uniformally over the
|
|
|
|
|
area (<tt class="docutils literal">etesian.uniformDensity</tt>), with <tt class="docutils literal">3.0%</tt> of free space
|
|
|
|
|
area (<tt class="docutils literal">etesian.uniformDensity</tt>), with <tt class="docutils literal">80%</tt> of free space
|
|
|
|
|
added and an aspect ratio of <tt class="docutils literal">100%</tt> (square shape).</p>
|
|
|
|
|
</li>
|
|
|
|
|
</ol>
|
|
|
|
@ -1274,7 +1482,7 @@ We directly call <a class="reference external" href="../../hurricane/classHurric
|
|
|
|
|
</div>
|
|
|
|
|
<div class="admonition note">
|
|
|
|
|
<p class="first admonition-title">Note</p>
|
|
|
|
|
<p class="last">The space margin for this example is very high (<tt class="docutils literal">30%</tt>), it's only
|
|
|
|
|
<p class="last">The space margin for this example is very high (<tt class="docutils literal">80%</tt>), it's only
|
|
|
|
|
because it's too small for the placer to run correctly. For normal
|
|
|
|
|
case it is around <tt class="docutils literal">3%</tt>.</p>
|
|
|
|
|
</div>
|
|
|
|
@ -1290,19 +1498,13 @@ case it is around <tt class="docutils literal">3%</tt>.</p>
|
|
|
|
|
<span class="c1"># Everybody needs it.</span>
|
|
|
|
|
<span class="n">af</span> <span class="o">=</span> <span class="n">AllianceFramework</span><span class="o">.</span><span class="n">get</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">toDbU</span> <span class="p">(</span> <span class="n">l</span> <span class="p">):</span> <span class="k">return</span> <span class="n">DbU</span><span class="o">.</span><span class="n">fromLambda</span><span class="p">(</span><span class="n">l</span><span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">buildFulladder</span> <span class="p">(</span> <span class="n">editor</span> <span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
<span class="c1"># Get the Framework and all the master cells.</span>
|
|
|
|
|
<span class="n">xr2_x2</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">getCell</span><span class="p">(</span> <span class="s1">'xr2_x1'</span><span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">a2_x2</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">getCell</span><span class="p">(</span> <span class="s1">'a2_x2'</span> <span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">o2_x2</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">getCell</span><span class="p">(</span> <span class="s1">'o2_x2'</span> <span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">with</span> <span class="n">UpdateSession</span><span class="p">():</span>
|
|
|
|
|
<span class="n">fulladder</span> <span class="o">=</span> <span class="n">af</span><span class="o">.</span><span class="n">createCell</span><span class="p">(</span> <span class="s1">'fulladder'</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="c1"># Create Instances.</span>
|
|
|
|
@ -1357,8 +1559,6 @@ case it is around <tt class="docutils literal">3%</tt>.</p>
|
|
|
|
|
<span class="n">cout</span><span class="o">.</span><span class="n">setExternal</span><span class="p">(</span> <span class="kc">True</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">o2_1</span><span class="o">.</span><span class="n">getPlug</span><span class="p">(</span> <span class="n">o2_x2</span><span class="o">.</span><span class="n">getNet</span><span class="p">(</span><span class="s1">'q'</span><span class="p">)</span> <span class="p">)</span><span class="o">.</span><span class="n">setNet</span><span class="p">(</span> <span class="n">cout</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">UpdateSession</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">af</span><span class="o">.</span><span class="n">saveCell</span><span class="p">(</span> <span class="n">fulladder</span><span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">return</span> <span class="n">fulladder</span>
|
|
|
|
|
|
|
|
|
@ -1367,7 +1567,6 @@ case it is around <tt class="docutils literal">3%</tt>.</p>
|
|
|
|
|
<span class="c1"># Run the placer.</span>
|
|
|
|
|
<span class="n">etesian</span> <span class="o">=</span> <span class="n">Etesian</span><span class="o">.</span><span class="n">EtesianEngine</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">cell</span><span class="p">)</span>
|
|
|
|
|
<span class="n">etesian</span><span class="o">.</span><span class="n">place</span><span class="p">()</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">editor</span><span class="p">:</span>
|
|
|
|
|
<span class="n">editor</span><span class="o">.</span><span class="n">setCell</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">editor</span><span class="o">.</span><span class="n">fit</span><span class="p">()</span>
|
|
|
|
@ -1383,14 +1582,12 @@ case it is around <tt class="docutils literal">3%</tt>.</p>
|
|
|
|
|
<span class="n">katana</span><span class="o">.</span><span class="n">runNegociate</span> <span class="p">(</span> <span class="n">Katana</span><span class="o">.</span><span class="n">Flags</span><span class="o">.</span><span class="n">NoFlags</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">af</span><span class="o">.</span><span class="n">saveCell</span><span class="p">(</span> <span class="n">cell</span><span class="p">,</span> <span class="n">Catalog</span><span class="o">.</span><span class="n">State</span><span class="o">.</span><span class="n">Views</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">return</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">scriptMain</span> <span class="p">(</span> <span class="o">**</span><span class="n">kw</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">editor</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
<span class="k">if</span> <span class="n">kw</span><span class="o">.</span><span class="n">has_key</span><span class="p">(</span><span class="s1">'editor'</span><span class="p">)</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]:</span>
|
|
|
|
|
<span class="k">if</span> <span class="s1">'editor'</span> <span class="ow">in</span> <span class="n">kw</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]:</span>
|
|
|
|
|
<span class="n">editor</span> <span class="o">=</span> <span class="n">kw</span><span class="p">[</span><span class="s1">'editor'</span><span class="p">]</span>
|
|
|
|
|
|
|
|
|
|
<span class="n">fulladder</span> <span class="o">=</span> <span class="n">buildFulladder</span><span class="p">(</span> <span class="n">editor</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">placeAndRoute</span><span class="p">(</span> <span class="n">editor</span><span class="p">,</span> <span class="n">fulladder</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">return</span> <span class="kc">True</span>
|
|
|
|
@ -1420,71 +1617,6 @@ go through all the components of a trans-hierarchical net.</p>
|
|
|
|
|
<h3>9.4 Miscellaeous trans-hierarchical functions</h3>
|
|
|
|
|
<p>For a starter, how to get all the leaf cells...</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="section" id="dynamically-decorating-data-base-objects">
|
|
|
|
|
<h3>9.5 Dynamically decorating data-base objects</h3>
|
|
|
|
|
<p>When writing algorithms directly in Python, it may come in handy to be
|
|
|
|
|
able to add attributes over the Hurricane data-base objects. As C++
|
|
|
|
|
objects exposed to the Python realm cannot natively do so (it would
|
|
|
|
|
means to be able to modify a C++ aobject attributes <em>at runtime</em>),
|
|
|
|
|
we add a special Property tasked with handling the extra Python
|
|
|
|
|
attributes. The syntax has been made as simple as possible.</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">Hurricane</span> <span class="kn">import</span> <span class="n">PythonAttributes</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">class</span> <span class="nc">MyAttribute</span> <span class="p">(</span> <span class="nb">object</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="fm">__init__</span> <span class="p">(</span> <span class="bp">self</span> <span class="p">):</span>
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">MyAttribute</span><span class="o">.</span><span class="n">count</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'</span><span class="si">{}</span><span class="s1"> has been created'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">MyAttribute</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="mi">1</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="fm">__del__</span> <span class="p">(</span> <span class="bp">self</span> <span class="p">):</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'</span><span class="si">{}</span><span class="s1"> has been deleted'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="fm">__str__</span> <span class="p">(</span> <span class="bp">self</span> <span class="p">):</span>
|
|
|
|
|
<span class="k">return</span> <span class="s1">'<MyAttribute </span><span class="si">{}</span><span class="s1">>'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">value</span><span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="nf">demoAttributes</span> <span class="p">(</span> <span class="n">cell</span> <span class="p">):</span>
|
|
|
|
|
<span class="n">PythonAttributes</span><span class="o">.</span><span class="n">enable</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span> <span class="o">=</span> <span class="n">MyAttribute</span><span class="p">()</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">myAttribute1</span> <span class="o">=</span> <span class="n">MyAttribute</span><span class="p">()</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'cell.myAttribute0 ='</span><span class="p">,</span> <span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">del</span> <span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span>
|
|
|
|
|
<span class="n">PythonAttributes</span><span class="o">.</span><span class="n">disable</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<p>Detailing the life cycle of Python attributes on a <a class="reference external" href="../../hurricane/classHurricane_1_1DBo.html">DBo</a>:</p>
|
|
|
|
|
<ol class="arabic">
|
|
|
|
|
<li><p class="first">Enabling the addition of Python attribute on a <a class="reference external" href="../../hurricane/classHurricane_1_1DBo.html">DBo</a>:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">PythonAttributes</span><span class="o">.</span><span class="n">enable</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</li>
|
|
|
|
|
<li><p class="first">Adding/removing properties on the <a class="reference external" href="../../hurricane/classHurricane_1_1DBo.html">DBo</a>:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span> <span class="o">=</span> <span class="n">MyAttribute</span><span class="p">()</span>
|
|
|
|
|
<span class="n">cell</span><span class="o">.</span><span class="n">myAttribute1</span> <span class="o">=</span> <span class="n">MyAttribute</span><span class="p">()</span>
|
|
|
|
|
<span class="nb">print</span><span class="p">(</span> <span class="s1">'cell.myAttribute0 ='</span><span class="p">,</span> <span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span> <span class="p">)</span>
|
|
|
|
|
<span class="k">del</span> <span class="n">cell</span><span class="o">.</span><span class="n">myAttribute0</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</li>
|
|
|
|
|
<li><p class="first">And finally disabling the use of Python attributes on the DBo.
|
|
|
|
|
Any still attached Python attributes will be released.</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">PythonAttributes</span><span class="o">.</span><span class="n">disable</span><span class="p">(</span> <span class="n">cell</span> <span class="p">)</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
<div class="admonition note">
|
|
|
|
|
<p class="first admonition-title">Note</p>
|
|
|
|
|
<p class="last">When the attributes of a <a class="reference external" href="../../hurricane/classHurricane_1_1DBo.html">DBo</a> are released it does not automatically
|
|
|
|
|
imply that they are removed. Their reference count is decreased, and
|
|
|
|
|
if they are only referenced here, they will be deleted. But if other
|
|
|
|
|
variables still holds reference onto them, they will stay allocateds.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
<li><p class="first">There is no need to keep track of all the <a class="reference external" href="../../hurricane/classHurricane_1_1DBo.html">DBo</a> that have Python
|
|
|
|
|
attributes to disable them. One can directly call:</p>
|
|
|
|
|
<div class="highlight"><pre><span></span><span class="n">PythonAttributes</span><span class="o">.</span><span class="n">disableAll</span><span class="p">()</span>
|
|
|
|
|
</pre></div>
|
|
|
|
|
</li>
|
|
|
|
|
</ol>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|