Updated documentation Python/Tutorial to catch up with API improvements.

This commit is contained in:
Jean-Paul Chaput 2022-08-15 13:49:35 +02:00
parent 440547a1c5
commit 16428ffaa9
35 changed files with 1778 additions and 1570 deletions

View File

@ -34,81 +34,4 @@ go through all the components of a trans-hierarchical net.
For a starter, how to get all the leaf cells...
9.5 Dynamically decorating data-base objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 *at runtime*),
we add a special Property tasked with handling the extra Python
attributes. The syntax has been made as simple as possible.
.. code-block:: python
from Hurricane import PythonAttributes
class MyAttribute ( object ):
count = 0
def __init__ ( self ):
self.value = MyAttribute.count
print( '{} has been created'.format(self) )
MyAttribute.count += 1
def __del__ ( self ):
print( '{} has been deleted'.format(self) )
def __str__ ( self ):
return '<MyAttribute {}>'.format(self.value)
def demoAttributes ( cell ):
PythonAttributes.enable( cell )
cell.myAttribute0 = MyAttribute()
cell.myAttribute1 = MyAttribute()
print( 'cell.myAttribute0 =', cell.myAttribute0 )
del cell.myAttribute0
PythonAttributes.disable( cell )
Detailing the life cycle of Python attributes on a DBo_:
1. Enabling the addition of Python attribute on a DBo_:
.. code-block:: python
PythonAttributes.enable( cell )
2. Adding/removing properties on the DBo_:
.. code-block:: python
cell.myAttribute0 = MyAttribute()
cell.myAttribute1 = MyAttribute()
print( 'cell.myAttribute0 =', cell.myAttribute0 )
del cell.myAttribute0
3. And finally disabling the use of Python attributes on the DBo.
Any still attached Python attributes will be released.
.. code-block:: python
PythonAttributes.disable( cell )
.. note::
When the attributes of a DBo_ 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.
4. There is no need to keep track of all the DBo_ that have Python
attributes to disable them. One can directly call:
.. code-block:: python
PythonAttributes.disableAll()

View File

@ -51,16 +51,13 @@ environment is provided by the |CRL| module.
from Hurricane import *
from CRL import *
from helpers.overlay import UpdateSession
af = AllianceFramework.get()
UpdateSession.open()
with UpdateSession():
cell = af.createCell( 'my_inv' )
# Build then save the Cell.
UpdateSession.close()
This is the simplest call to ``createCell()``, and in that case, the newly
created Cell_ will be saved in the *working library* (usually, the current
@ -89,6 +86,24 @@ two conversion functions are provided:
In the weakly typed |Python| world, :cb:`lbd` is *float* while :cb:`unit`
is *integer*.
In order to reduce the number of characters one has to code, the :cb:`helpers`
module provides three very short function to perform conversion *towards*
DbU_ :
.. code-block:: Python
def l ( value ):
"""Convert a lambda into a DbU."""
return DbU.fromLambda( value )
def u ( value ):
"""Convert a length in micrometer into a DbU."""
return DbU.fromPhysical( value, Hurricane.DbU.UnitPowerMicro )
def n ( value ):
"""Convert a length in nanometer into a DbU."""
return DbU.fromPhysical( value, Hurricane.DbU.UnitPowerNano )
3.5 Setting up the Abutment Box
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -99,20 +114,17 @@ corner ``(x2,y2)``.
.. code-block:: Python
b = Box( DbU.fromLambda( 0.0) # x1
, DbU.fromLambda( 0.0) # y1
, DbU.fromLambda(15.0) # x2
, DbU.fromLambda(50.0) ) # y2
b = Box( l( 0.0) # x1
, l( 0.0) # y1
, l(15.0) # x2
, l(50.0) ) # y2
cell.setAbutmentBox( b )
Or more simply:
.. code-block:: Python
cell.setAbutmentBox( Box( DbU.fromLambda( 0.0)
, DbU.fromLambda( 0.0)
, DbU.fromLambda(15.0)
, DbU.fromLambda(50.0) ) )
cell.setAbutmentBox( Box( l( 0.0), l( 0.0), l(15.0), l(50.0) ) )
3.6 Adding Nets and Components
@ -182,10 +194,10 @@ of ``METAL1``.
segment = Vertical.create( i # The owner Net.
, layer # The layer.
, DbU.fromLambda( 5.0 ) # The X coordinate.
, DbU.fromLambda( 2.0 ) # The width.
, DbU.fromLambda( 10.0 ) # The Y source coordinate.
, DbU.fromLambda( 40.0 ) ) # The Y target coordinate.
, l( 5.0 ) # The X coordinate.
, l( 2.0 ) # The width.
, l( 10.0 ) # The Y source coordinate.
, l( 40.0 ) ) # The Y target coordinate.
With this overload of the ``Vertical.create()`` function the segment is created at an
absolute position. There is a second overload for creating a relatively placed
@ -236,33 +248,31 @@ explanation of that part of the code, refer to `5. Make a script runnable throug
#!/usr/bin/python
import sys
from Hurricane import *
from CRL import *
def toDbU ( l ): return DbU.fromLambda(l)
from Hurricane import DataBase, NetExternalComponents, Net, \
DbU, Point, Box, Horizontal, Vertical, Contact, RoutingPad, \
Breakpoint
from CRL import AllianceFramework, Catalog
from helpers import l
from helpers.overlay import UpdateSession
def doBreak ( level, message ):
UpdateSession.close()
"""Put a breakpoint into the script."""
Breakpoint.stop( level, message )
UpdateSession.open()
def buildInvertor ( editor ):
UpdateSession.open()
"""Build step by step an invertor standard cell."""
with UpdateSession():
cell = AllianceFramework.get().createCell( 'invertor' )
cell.setTerminal( True )
cell.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(15.0), toDbU(50.0) ) )
cell.setTerminalNetlist( True )
cell.setAbutmentBox( Box( l(0.0), l(0.0), l(15.0), l(50.0) ) )
if editor:
UpdateSession.close()
editor.setCell( cell )
editor.fit()
UpdateSession.open()
with UpdateSession():
technology = DataBase.getDB().getTechnology()
metal1 = technology.getLayer( "METAL1" )
poly = technology.getLayer( "POLY" )
@ -277,60 +287,60 @@ explanation of that part of the code, refer to `5. Make a script runnable throug
ntie = technology.getLayer( "NTIE" )
net = Net.create( cell, "nwell" )
Vertical.create( net, nwell, toDbU(7.5), toDbU(15.0), toDbU(27.0), toDbU(51.0) )
Vertical.create( net, nwell, l(7.5), l(15.0), l(27.0), l(51.0) )
vdd = Net.create( cell, "vdd" )
vdd.setExternal( True )
vdd.setGlobal ( True )
h = Horizontal.create(vdd, metal1, toDbU(47.0), toDbU(6.0), toDbU(0.0), toDbU(15.0) )
h = Horizontal.create(vdd, metal1, l(47.0), l(6.0), l(0.0), l(15.0) )
NetExternalComponents.setExternal( h )
Contact.create ( vdd, contdifn, toDbU(10.0), toDbU(47.0), toDbU( 1.0), toDbU( 1.0) )
Contact.create ( vdd, contdifp, toDbU( 4.0), toDbU(45.0), toDbU( 1.0), toDbU( 1.0) )
Vertical.create( vdd, pdif , toDbU( 3.5), toDbU( 4.0), toDbU(28.0), toDbU(46.0) )
Vertical.create( vdd, ntie , toDbU(10.0), toDbU( 3.0), toDbU(43.0), toDbU(48.0) )
Contact.create ( vdd, contdifn, l(10.0), l(47.0), l( 1.0), l( 1.0) )
Contact.create ( vdd, contdifp, l( 4.0), l(45.0), l( 1.0), l( 1.0) )
Vertical.create( vdd, pdif , l( 3.5), l( 4.0), l(28.0), l(46.0) )
Vertical.create( vdd, ntie , l(10.0), l( 3.0), l(43.0), l(48.0) )
doBreak( 1, 'Done building vdd.' )
with UpdateSession():
vss = Net.create( cell, "vss" )
vss.setExternal( True )
vss.setGlobal ( True )
h = Horizontal.create(vss, metal1, toDbU(3.0), toDbU(6.0), toDbU(0.0), toDbU(15.0))
h = Horizontal.create(vss, metal1, l(3.0), l(6.0), l(0.0), l(15.0))
NetExternalComponents.setExternal( h )
Vertical.create( vss, ndif , toDbU(3.5), toDbU(4.0), toDbU(4.0), toDbU(12.0) )
Contact.create ( vss, contdifn, toDbU(4.0), toDbU(5.0), toDbU(1.0), toDbU( 1.0) )
Vertical.create( vss, ndif , l(3.5), l(4.0), l(4.0), l(12.0) )
Contact.create ( vss, contdifn, l(4.0), l(5.0), l(1.0), l( 1.0) )
doBreak( 1, 'Done building vss.' )
with UpdateSession():
i = Net.create( cell, "i" )
i.setExternal( True )
v = Vertical.create ( i, metal1, toDbU(5.0), toDbU(2.0), toDbU(10.0), toDbU(40.0) )
v = Vertical.create ( i, metal1, l(5.0), l(2.0), l(10.0), l(40.0) )
NetExternalComponents.setExternal( v )
Vertical.create ( i, ptrans , toDbU( 7.0), toDbU( 1.0), toDbU(26.0), toDbU(39.0) )
Vertical.create ( i, ntrans , toDbU( 7.0), toDbU( 1.0), toDbU( 6.0), toDbU(14.0) )
Vertical.create ( i, poly , toDbU( 7.0), toDbU( 1.0), toDbU(14.0), toDbU(26.0) )
Horizontal.create( i, poly , toDbU(20.0), toDbU( 3.0), toDbU( 4.0), toDbU( 7.0) )
Contact.create ( i, contpoly, toDbU( 5.0), toDbU(20.0), toDbU( 1.0), toDbU( 1.0) )
Vertical.create ( i, ptrans , l( 7.0), l( 1.0), l(26.0), l(39.0) )
Vertical.create ( i, ntrans , l( 7.0), l( 1.0), l( 6.0), l(14.0) )
Vertical.create ( i, poly , l( 7.0), l( 1.0), l(14.0), l(26.0) )
Horizontal.create( i, poly , l(20.0), l( 3.0), l( 4.0), l( 7.0) )
Contact.create ( i, contpoly, l( 5.0), l(20.0), l( 1.0), l( 1.0) )
doBreak( 1, 'Done building i.' )
with UpdateSession():
nq = Net.create ( cell, "nq" )
nq.setExternal( True )
v = Vertical.create( nq, metal1, toDbU(10.0), toDbU(2.0), toDbU(10.0), toDbU(40.0) )
v = Vertical.create( nq, metal1, l(10.0), l(2.0), l(10.0), l(40.0) )
NetExternalComponents.setExternal( v )
Vertical.create( nq, pdif , toDbU(10.0), toDbU( 3.0), toDbU(28.0), toDbU(37.0) )
Vertical.create( nq, ndif , toDbU(10.0), toDbU( 3.0), toDbU( 8.0), toDbU(12.0) )
Contact.create ( nq, contdifp, toDbU(10.0), toDbU(35.0), toDbU( 1.0), toDbU( 1.0) )
Contact.create ( nq, contdifp, toDbU(10.0), toDbU(30.5), toDbU( 1.0), toDbU( 1.0) )
Contact.create ( nq, contdifn, toDbU(10.0), toDbU(10.0), toDbU( 1.0), toDbU( 1.0) )
Vertical.create( nq, pdif , l(10.0), l( 3.0), l(28.0), l(37.0) )
Vertical.create( nq, ndif , l(10.0), l( 3.0), l( 8.0), l(12.0) )
Contact.create ( nq, contdifp, l(10.0), l(35.0), l( 1.0), l( 1.0) )
Contact.create ( nq, contdifp, l(10.0), l(30.5), l( 1.0), l( 1.0) )
Contact.create ( nq, contdifn, l(10.0), l(10.0), l( 1.0), l( 1.0) )
doBreak( 1, 'Done building q.' )
UpdateSession.close()
AllianceFramework.get().saveCell( cell, Catalog.State.Views )
return
def scriptMain ( **kw ):
"""The Mandatory function to be run by Coriolis interactively."""
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
buildInvertor( editor )
return True

View File

@ -33,29 +33,25 @@ using the menu:
.. code-block:: Python
def buildInvertor ( editor ):
UpdateSession.open()
"""Build step by step an invertor standard cell."""
with UpdateSession():
cell = AllianceFramework.get().createCell( 'invertor' )
cell.setTerminal( True )
cell.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(15.0), toDbU(50.0) ) )
cell.setTerminalNetlist( True )
cell.setAbutmentBox( Box( l(0.0), l(0.0), l(15.0), l(50.0) ) )
if editor:
UpdateSession.close()
editor.setCell( cell )
editor.fit()
UpdateSession.open()
# The rest of the script...
return
def scriptMain ( **kw ):
"""The Mandatory function to be run by Coriolis interactively."""
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
buildInvertor( editor )
return True
@ -64,8 +60,8 @@ using the menu:
~~~~~~~~~~~~~~~~~~~~~
It is possible to add breakpoints inside a script by calling the ``Breakpoint.stop()``
function. To be able to see exactly what has just been mofied, we must close the
UpdateSession_ 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 UpdateSession_ before calling breakpoints.
The ``Breakpoint.stop()`` function takes two arguments:
#. The ``level`` above which it will be active.
@ -76,6 +72,4 @@ We can create a little function to ease the work:
.. code-block:: Python
def doBreak ( level, message ):
UpdateSession.close()
Breakpoint.stop( level, message )
UpdateSession.open()

View File

@ -23,12 +23,12 @@ allowing to simply write:
.. code-block:: Python
for net in cell.getNets():
print 'Components of', net
print( 'Components of', net )
for component in net.getComponents():
print '|', component
print( '|', component )
In C++ we would have written:
In C++ we would have been written:
.. code-block:: C++
@ -59,7 +59,7 @@ loop. For example:
# Remove all the anonymous nets.
for net in cellNets:
if net.getName().endswith('nymous_'):
print 'Destroy', net
print( 'Destroy', net )
net.destroy()

View File

@ -37,53 +37,68 @@ Use it like this (don't forget the ``eval`` **and** the backquotes):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You may create, in the directory you are lanching |Coriolis| tools, a special
sub-directory ``.coriolis2/`` that can contain two configuration files:
sub-directory ``coriolis2/`` that can contain the configuration files:
* ``techno.py`` tells which technology to use.
* ``__init__.py`` to tell |Python| this directory is a module.
* ``settings.py`` can override almost any default configuration setting.
Those two files are *optional*, if they do not exist the default settings
will be used and the technology is ``symbolic/cmos`` (i.e. purely symbolic).
.. note:: Those two files will by processed by the |Python| interpreter,
so they can contain any code in addition to the mandatory
variables.
2.2.1 The :cb:`techno.py` File
------------------------------
Must provide one variable named :cb:`technology` which values the path towards
the technology file. The available technologies are installed under
``<CORIOLIS_INSTALL>/etc/coriolis2``. For example, to use the 45nm FreeDPK
which is in: ::
2.3 The :cb:`settings.py` File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<CORIOLIS_INSTALL>/etc/coriolis2/45/freepdk_45/
The attributes name and definitions of :cb:`cfg` are detailed
in `CGT - The Graphical Interface <../UsersGuide/ViewerTools.html>`_.
The ``techno.py`` file must contain:
**Selecting the Technology**
The important line here is:
.. code-block:: Python
technology = '45/freepdk_45'
import symbolic.cmos
2.2.2 The :cb:`settings.py` File
--------------------------------
The entries of the ``parametersTable`` and their definitions are detailed
in `CGT - The Graphical Interface <../UsersGuide/ViewerTools.html>`_.
This import loads and setup the technology used througout this run of
|Coriolis|. One and only one technology can be loaded in a |Coriolis| run.
Example of file:
.. code-block:: Python
defaultStyle = 'Alliance.Classic [black]'
# -*- Mode:Python -*-
parametersTable = \
( ('misc.catchCore' , TypeBool , False )
, ('misc.info' , TypeBool , False )
, ('misc.paranoid' , TypeBool , False )
, ('misc.bug' , TypeBool , False )
, ('misc.logMode' , TypeBool , False )
, ('misc.verboseLevel1' , TypeBool , False )
, ('misc.verboseLevel2' , TypeBool , True )
)
import os
import Cfg
import Viewer
import CRL
import symbolic.cmos
from helpers import overlay
if 'CELLS_TOP' in os.environ:
cellsTop = os.environ['CELLS_TOP']
else:
cellsTop = '../../../cells'
with overlay.CfgCache(priority=Cfg.Parameter.Priority.UserFile) as cfg:
cfg.misc.catchCore = False
cfg.misc.info = False
cfg.misc.paranoid = False
cfg.misc.bug = False
cfg.misc.logMode = True
cfg.misc.verboseLevel1 = True
cfg.misc.verboseLevel2 = True
cfg.misc.minTraceLevel = 1900
cfg.misc.maxTraceLevel = 3000
cfg.katana.eventsLimit = 1000000
cfg.katana.termSatReservedLocal = 6
cfg.katana.termSatThreshold = 9
Viewer.Graphics.setStyle( 'Alliance.Classic [black]' )
af = CRL.AllianceFramework.get()
env = af.getEnvironment()
env.setCLOCK( '^ck$|m_clock|^clk$' )
env.addSYSTEM_LIBRARY( library=cellsTop+'/nsxlib', mode=CRL.Environment.Prepend )
env.addSYSTEM_LIBRARY( library=cellsTop+'/niolib', mode=CRL.Environment.Prepend )

View File

@ -17,8 +17,25 @@ of |Python| objects or use |Python| containers to store them.
The only limitation is that you may not use |Hurricane| classes as base
classes in |Python|.
All |Hurricane| objects implements the |Python| ``__str__()`` function,
they print the result of the C++ method ``::getString()``.
All the example scripts given in this tutorial con be found under: ::
<CORIOLIS_INSTALL>/share/doc/coriolis2/examples/scripts/
Provided scripts:
======================= ==============================================================
**Script** **Feature**
======================= ==============================================================
:cb:`coriolisLogo.py` Draw a layout of the |Coriolis| logo
:cb:`diagonals.py` Test the :cb:`Hurricane::Diagonal` class
:cb:`polygons.py` Test the :cb:`Hurricane::Polygon` class
:cb:`rectilinear.py` Test the :cb:`Hurricane::rectilinear` class
:cb:`invertor.py` Procedural build of the layout of an invertor standard cell
:cb:`fulladder.py` Procedural build of a small netlist along with it's manual
placement and the routing of one net (:cb:`"a"`)
:cb:`toolengines.py` Build the netlist (only) of the full adder then call the
place and route engines
======================= ==============================================================
1.1 Terminology
@ -61,17 +78,45 @@ Mostly:
to use ``string``.
* Coordinates are expressed in ``DbU`` which are ``long`` with a special
semantic (see ??).
* All |Hurricane| objects implements the |Python| ``__str__()`` function,
they print the result of the C++ method ``::getString()``.
In ``hurricane/Session.h`` header we have:
In ``hurricane/Net.h`` header we have:
.. code-block:: c++
namespace Hurricane {
class UpdateSession {
class Net : public Entity {
public:
static void open ();
static void close ();
class Direction {
public: enum Code { DirIn = 0x0001
, DirOut = 0x0002
, DirUndefined = 0x0000
, ConnTristate = 0x0100
, ConnWiredOr = 0x0200
, UNDEFINED = DirUndefined
, IN = DirIn
, OUT = DirOut
, INOUT = DirIn | DirOut
, TRISTATE = DirOut | ConnTristate
, TRANSCV = DirIn | DirOut | ConnTristate
, WOR_OUT = DirOut | ConnWiredOr
, WOR_INOUT = DirIn | DirOut | ConnWiredOr
, DirMask = DirIn | DirOut | DirUndefined
};
// [The rest of Class Direction]
};
public:
static Net* create ( Cell* , const Name& );
bool isGlobal ();
bool isExternal ();
const Direction& getDirection ();
void setName ( Name );
void setGlobal ( bool );
void setExternal ( bool );
void setDirection ( const Direction& );
// [The rest of Class Net]
};
}
@ -81,15 +126,18 @@ So we can use it the following way in C++:
.. code-block:: c++
#include "hurricane/Session.h"
#include "hurricane/Net.h"
using namespace Hurricane;
void doSomething ()
void addNetToCell ( Cell* cell )
{
UpdateSession::open();
// Something...
UpdateSession::close();
Net* net = Net::create( cell, "new_net" );
net->setGlobal ( false );
net->setExternal ( true );
net->setDirection( Net.Direction.IN );
cout << "Created " << net << endl;
return net;
}
@ -97,12 +145,15 @@ The equivalent |Python| code will be:
.. code-block:: Python
from Hurricane import *
from Hurricane import Net
def doSomething ():
UpdateSession.open()
# Something...
UpdateSession.close()
def addNetToCell ( cell ):
net = Net.create( cell, "new_net" )
net.setGlobal ( False )
net.setExternal( True )
net.setDirection( Net.Direction.IN )
print( "Created", net )
return net
1.3 Various Kinds of Constructors
@ -130,9 +181,152 @@ Regarding the memory allocation, the |Hurricane| database contains two kind of o
.. code-block:: Python
from Hurricane import DbU, Box
def myfunc():
bb = Box( DbU.fromLambda( 0.0)
, DbU.fromLambda( 0.0)
, DbU.fromLambda(15.0)
, DbU.fromLambda(50.0) )
return # bb will be freed at that point.
1.4 Collections and Iterators
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hurricane Collection_ behave like containers under |Python| and provide
support for the :cb:`iterator` protocol.
.. code-block:: Python
from Hurricane import Net, Horizontal
def delAllHorizontals ( net ):
horizontals = []
for component in net.getComponents():
if isinstance(component,Horizontal):
horizontals.append( component )
# Now we can remove the Horizontals.
for horizontal in horizontals:
horizontal.destroy()
.. note:: **Never remove an element from a Collection_ while iterating over it**.
You must save the to be removed elements in an auxiliary container
then remove them, like shown in the example above
1.5 Dynamically decorating data-base objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 *at runtime*),
we add a special Property tasked with handling the extra Python
attributes. The syntax has been made as simple as possible.
.. code-block:: python
from Hurricane import PythonAttributes
class MyAttribute ( object ):
count = 0
def __init__ ( self ):
self.value = MyAttribute.count
print( '{} has been created'.format(self) )
MyAttribute.count += 1
def __del__ ( self ):
print( '{} has been deleted'.format(self) )
def __str__ ( self ):
return '<MyAttribute {}>'.format(self.value)
def demoAttributes ( cell ):
PythonAttributes.enable( cell )
cell.myAttribute0 = MyAttribute()
cell.myAttribute1 = MyAttribute()
print( 'cell.myAttribute0 =', cell.myAttribute0 )
del cell.myAttribute0
PythonAttributes.disable( cell )
Detailing the life cycle of Python attributes on a DBo_:
1. Enabling the addition of Python attribute on a DBo_:
.. code-block:: python
PythonAttributes.enable( cell )
2. Adding/removing properties on the DBo_:
.. code-block:: python
cell.myAttribute0 = MyAttribute()
cell.myAttribute1 = MyAttribute()
print( 'cell.myAttribute0 =', cell.myAttribute0 )
del cell.myAttribute0
3. And finally disabling the use of Python attributes on the DBo.
Any still attached Python attributes will be released.
.. code-block:: python
PythonAttributes.disable( cell )
.. note::
When the attributes of a DBo_ 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.
4. There is no need to keep track of all the DBo_ that have Python
attributes to disable them. One can directly call:
.. code-block:: python
PythonAttributes.disableAll()
1.6 Adapting C++ : Overlay
~~~~~~~~~~~~~~~~~~~~~~~~~~
Sometimes, the use of a wrapped C++ feature would be counter intuitive regarding
the |Python| feature. For those cases the :cb:`overlay` module provide an
adaptation of the C++ API for a more *Python-like* code. A typical example is
with the UpdateSession_ mechanism.
Using directly the C++ wrapper, we would write a code like this:
.. code-block:: python
from Hurricane import UpdateSession, Net, Vertical
from helpers import l
def editCell ( cell ):
UpdateSession.open()
net = Net.create( cell, "nwell" )
Vertical.create( net, nwell, l(7.5), l(15.0), l(27.0), l(51.0) )
# Continued cell's layout building.
# ...
UpdateSession.close()
But, using the :cb:`overlay` we got the more *pythonic* code:
.. code-block:: python
from Hurricane import Net, Vertical
from helpers import l
from helpers.overlay import UpdateSession
def editCell ( cell ):
with UpdateSession():
net = Net.create( cell, "nwell" )
Vertical.create( net, nwell, l(7.5), l(15.0), l(27.0), l(51.0) )
# Continued cell's layout building.
# ...

View File

@ -140,9 +140,7 @@ we also must set its *placement status* to ``Instance.PlacementStatus.PLACED``.
.. code-block:: Python
xr2_1.setTransformation( Transformation( DbU.fromLambda( 0.0)
, DbU.fromLambda(100.0)
, Transformation.Orientation.MY ) )
xr2_1.setTransformation( Transformation( l(0.0), l(100.0), Transformation.Orientation.MY ) )
xr2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
@ -204,11 +202,11 @@ contacts.
, RoutingPad.BiggestArea )
# Then regular wiring.
contact1 = Contact.create( rp1, via12, toDbU( 0.0), toDbU(-15.0) )
contact2 = Contact.create( rp2, via12, toDbU( 0.0), toDbU( 10.0) )
turn = Contact.create( a , via23, toDbU(10.0), toDbU( 35.0) )
Horizontal.create( contact2, turn , metal2, toDbU(35.0), toDbU(2.0) )
Vertical .create( turn , contact1 , metal3, toDbU(10.0), toDbU(2.0) )
contact1 = Contact.create( rp1, via12, l( 0.0), l(-15.0) )
contact2 = Contact.create( rp2, via12, l( 0.0), l( 10.0) )
turn = Contact.create( a , via23, l(10.0), l( 35.0) )
Horizontal.create( contact2, turn , metal2, l(35.0), l(2.0) )
Vertical .create( turn , contact1 , metal3, l(10.0), l(2.0) )
.. note:: In order to better see the layout of the wiring only, open the
@ -227,38 +225,36 @@ directory (under the the root of the |Coriolis| installation).
#!/usr/bin/python
import sys
from Hurricane import *
from CRL import *
def toDbU ( l ): return DbU.fromLambda(l)
from Hurricane import DataBase, Instance, Box, Net, Horizontal, Vertical, Contact, \
RoutingPad, Transformation, Occurrence, \
Breakpoint
from CRL import AllianceFramework, Catalog, Gds
from helpers import l
from helpers.overlay import UpdateSession
def doBreak ( level, message ):
UpdateSession.close()
"""Put a breakpoint into the script."""
Breakpoint.stop( level, message )
UpdateSession.open()
def buildFulladder ( editor ):
"""Build step by step full adder (netlist & placement)."""
# Get the Framework and all the master cells.
af = AllianceFramework.get()
xr2_x2 = af.getCell( 'xr2_x1', Catalog.State.Views )
a2_x2 = af.getCell( 'a2_x2' , Catalog.State.Views )
o2_x2 = af.getCell( 'o2_x2' , Catalog.State.Views )
UpdateSession.open()
with UpdateSession():
fulladder = af.createCell( 'fulladder' )
fulladder.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(90.0), toDbU(100.0) ) )
fulladder.setAbutmentBox( Box( l(0.0), l(0.0), l(90.0), l(100.0) ) )
if editor:
UpdateSession.close()
editor.setCell( fulladder )
editor.fit()
UpdateSession.open()
with UpdateSession():
# Create Instances.
a2_1 = Instance.create( fulladder, 'a2_1', a2_x2 )
a2_2 = Instance.create( fulladder, 'a2_2', a2_x2 )
@ -312,49 +308,55 @@ directory (under the the root of the |Coriolis| installation).
o2_1.getPlug( o2_x2.getNet('q') ).setNet( cout )
# Instances placement.
a2_1.setTransformation( Transformation( toDbU(0.0)
, toDbU(0.0)
with UpdateSession():
a2_1.setTransformation( Transformation( l(0.0)
, l(0.0)
, Transformation.Orientation.ID ) )
a2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
doBreak( 1, 'Placed a2_1' )
xr2_1.setTransformation( Transformation( toDbU( 0.0)
, toDbU(100.0)
with UpdateSession():
xr2_1.setTransformation( Transformation( l( 0.0)
, l(100.0)
, Transformation.Orientation.MY ) )
xr2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
doBreak( 1, 'Placed xr2_1' )
a2_2.setTransformation( Transformation( toDbU(25.0)
, toDbU( 0.0)
with UpdateSession():
a2_2.setTransformation( Transformation( l(25.0)
, l( 0.0)
, Transformation.Orientation.ID ) )
a2_2.setPlacementStatus( Instance.PlacementStatus.PLACED )
doBreak( 1, 'Placed a2_2' )
xr2_2.setTransformation( Transformation( toDbU( 45.0)
, toDbU(100.0)
with UpdateSession():
xr2_2.setTransformation( Transformation( l( 45.0)
, l(100.0)
, Transformation.Orientation.MY ) )
xr2_2.setPlacementStatus( Instance.PlacementStatus.PLACED )
doBreak( 1, 'Placed xr2_2' )
o2_1.setTransformation( Transformation( toDbU(65.0)
, toDbU( 0.0)
with UpdateSession():
o2_1.setTransformation( Transformation( l(65.0)
, l( 0.0)
, Transformation.Orientation.ID ) )
o2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
doBreak( 1, 'Placed o2_1' )
# Add filler cells.
with UpdateSession():
tie_x0 = af.getCell( 'tie_x0', Catalog.State.Views )
rowend_x0 = af.getCell( 'rowend_x0', Catalog.State.Views )
filler_1 = Instance.create( fulladder, 'filler_1', tie_x0 )
filler_2 = Instance.create( fulladder, 'filler_2', rowend_x0 )
filler_1.setTransformation( Transformation( toDbU(50.0)
, toDbU( 0.0)
filler_1.setTransformation( Transformation( l(50.0)
, l( 0.0)
, Transformation.Orientation.ID ) )
filler_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
filler_2.setTransformation( Transformation( toDbU(60.0)
, toDbU( 0.0)
filler_2.setTransformation( Transformation( l(60.0)
, l( 0.0)
, Transformation.Orientation.ID ) )
filler_2.setPlacementStatus( Instance.PlacementStatus.PLACED )
doBreak( 1, 'Filler cell placeds' )
@ -366,6 +368,7 @@ directory (under the the root of the |Coriolis| installation).
via12 = technology.getLayer( "VIA12" )
via23 = technology.getLayer( "VIA23" )
with UpdateSession():
# Build wiring for a.
# Create RoutingPads first.
rp1 = RoutingPad.create( a
@ -376,22 +379,19 @@ directory (under the the root of the |Coriolis| installation).
, RoutingPad.BiggestArea )
# Then regular wiring.
contact1 = Contact.create( rp1, via12, toDbU( 0.0), toDbU(-15.0) )
contact2 = Contact.create( rp2, via12, toDbU( 0.0), toDbU( 10.0) )
turn = Contact.create( a , via23, toDbU(10.0), toDbU( 35.0) )
Horizontal.create( contact2, turn , metal2, toDbU(35.0), toDbU(2.0) )
Vertical .create( turn , contact1 , metal3, toDbU(10.0), toDbU(2.0) )
UpdateSession.close()
contact1 = Contact.create( rp1, via12, l( 0.0), l(-15.0) )
contact2 = Contact.create( rp2, via12, l( 0.0), l( 10.0) )
turn = Contact.create( a , via23, l(10.0), l( 35.0) )
Horizontal.create( contact2, turn , metal2, l(35.0), l(2.0) )
Vertical .create( turn , contact1 , metal3, l(10.0), l(2.0) )
af.saveCell( fulladder, Catalog.State.Views )
return
def scriptMain ( **kw ):
"""The Mandatory function to be run by Coriolis interactively."""
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
buildFulladder( editor )
return True

View File

@ -35,15 +35,15 @@ You can configure the placer in two ways:
.. code-block:: Python
parametersTable = \
( ("etesian.effort" , TypeEnumerate , 2 )
, ('etesian.uniformDensity' , TypeBool , True )
, ('etesian.spaceMargin' , TypePercentage, 3.0 )
, ('etesian.aspectRatio' , TypePercentage, 100.0 )
)
with overlay.CfgCache(priority=Cfg.Parameter.Priority.UserFile) as cfg:
cfg.etesian.effort = 2
cfg.etesian.uniformDensity = True
cfg.etesian.spaceMargin = 0.8
cfg.etesian.aspectRatio = 1.0
With this setup, the cells will be spread uniformally over the
area (``etesian.uniformDensity``), with ``3.0%`` of free space
area (``etesian.uniformDensity``), with ``80%`` of free space
added and an aspect ratio of ``100%`` (square shape).
@ -87,7 +87,7 @@ previously. The call to the ToolEngines_ is made inside the new function
do not need the wrapper function ``doBreak()`` around the breakpoints.
We directly call Breakpoint_.
.. note:: The space margin for this example is very high (``30%``), it's only
.. note:: The space margin for this example is very high (``80%``), it's only
because it's too small for the placer to run correctly. For normal
case it is around ``3%``.
@ -105,19 +105,13 @@ previously. The call to the ToolEngines_ is made inside the new function
# Everybody needs it.
af = AllianceFramework.get()
def toDbU ( l ): return DbU.fromLambda(l)
def buildFulladder ( editor ):
# Get the Framework and all the master cells.
xr2_x2 = af.getCell( 'xr2_x1', Catalog.State.Views )
a2_x2 = af.getCell( 'a2_x2' , Catalog.State.Views )
o2_x2 = af.getCell( 'o2_x2' , Catalog.State.Views )
UpdateSession.open()
with UpdateSession():
fulladder = af.createCell( 'fulladder' )
# Create Instances.
@ -172,8 +166,6 @@ previously. The call to the ToolEngines_ is made inside the new function
cout.setExternal( True )
o2_1.getPlug( o2_x2.getNet('q') ).setNet( cout )
UpdateSession.close()
af.saveCell( fulladder, Catalog.State.Views )
return fulladder
@ -182,7 +174,6 @@ previously. The call to the ToolEngines_ is made inside the new function
# Run the placer.
etesian = Etesian.EtesianEngine.create(cell)
etesian.place()
if editor:
editor.setCell( cell )
editor.fit()
@ -198,14 +189,12 @@ previously. The call to the ToolEngines_ is made inside the new function
katana.runNegociate ( Katana.Flags.NoFlags )
af.saveCell( cell, Catalog.State.Views )
return
def scriptMain ( **kw ):
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
fulladder = buildFulladder( editor )
placeAndRoute( editor, fulladder )
return True

Binary file not shown.

View File

@ -1,23 +0,0 @@
# -*- Mode:Python -*-
defaultStyle = 'Alliance.Classic [black]'
parametersTable = \
( ('misc.catchCore' , TypeBool , False )
, ('misc.info' , TypeBool , False )
, ('misc.paranoid' , TypeBool , False )
, ('misc.bug' , TypeBool , False )
, ('misc.logMode' , TypeBool , False )
, ('misc.verboseLevel1' , TypeBool , False )
, ('misc.verboseLevel2' , TypeBool , True )
, ('misc.traceLevel' , TypeInt , 1000 )
, ('etesian.spaceMargin' , TypePercentage, 30.0 )
, ('etesian.aspectRatio' , TypePercentage, 100.0 )
# Kite parameters.
, ("kite.eventsLimit" , TypeInt , 1000000 )
, ('katabatic.topRoutingLayer', TypeString , 'METAL5')
, ("kite.hTracksReservedLocal", TypeInt , 4 )
, ("kite.vTracksReservedLocal", TypeInt , 3 )
)

View File

@ -1 +0,0 @@
technology = 'symbolic/cmos'

View File

@ -4,6 +4,9 @@
install ( FILES invertor.py
fulladder.py
polygons.py
diagonals.py
rectilinear.py
coriolisLogo.py
toolengines.py DESTINATION ${examplesInstallDir}/scripts )
install ( DIRECTORY .coriolis2 DESTINATION ${examplesInstallDir}/scripts )
install ( DIRECTORY coriolis2 DESTINATION ${examplesInstallDir}/scripts )

View File

@ -0,0 +1,38 @@
# -*- Mode:Python -*-
import os
import Cfg
import Viewer
import CRL
import symbolic.cmos
from helpers import overlay
#if 'CELLS_TOP' in os.environ:
# cellsTop = os.environ['CELLS_TOP']
#else:
# cellsTop = '../../../cells'
with overlay.CfgCache(priority=Cfg.Parameter.Priority.UserFile) as cfg:
cfg.misc.catchCore = False
cfg.misc.info = False
cfg.misc.paranoid = False
cfg.misc.bug = False
cfg.misc.logMode = True
cfg.misc.verboseLevel1 = True
cfg.misc.verboseLevel2 = True
cfg.misc.minTraceLevel = 1900
cfg.misc.maxTraceLevel = 3000
cfg.etesian.effort = 2
cfg.etesian.uniformDensity = True
cfg.etesian.spaceMargin = 0.8
cfg.etesian.aspectRatio = 1.0
cfg.katana.eventsLimit = 1000000
cfg.katana.termSatReservedLocal = 6
cfg.katana.termSatThreshold = 9
Viewer.Graphics.setStyle( 'Alliance.Classic [black]' )
#af = CRL.AllianceFramework.get()
#env = af.getEnvironment()
#env.setCLOCK( '^ck$|m_clock|^clk$' )
#env.addSYSTEM_LIBRARY( library=cellsTop+'/nsxlib', mode=CRL.Environment.Prepend )
#env.addSYSTEM_LIBRARY( library=cellsTop+'/niolib', mode=CRL.Environment.Prepend )

View File

@ -1,33 +1,24 @@
#!/usr/bin/python
import sys
from Hurricane import *
from CRL import *
def toDbU ( l ): return DbU.fromLambda(l)
def doBreak ( level, message ):
UpdateSession.close()
Breakpoint.stop( level, message )
UpdateSession.open()
from Hurricane import DataBase, Box, Net, Vertical, Horizontal
from CRL import AllianceFramework, Catalog
from helpers import l
from helpers.overlay import UpdateSession
def drawLogo ( editor ):
UpdateSession.open()
"""Draw a small logo of Coriolis in GDS."""
with UpdateSession():
cell = AllianceFramework.get().createCell( 'coriolis_logo' )
cell.setTerminal( True )
cell.setAbutmentBox( Box( toDbU(-16.0), toDbU(-16.0), toDbU(76.0), toDbU(76.0) ) )
cell.setTerminalNetlist( True )
cell.setAbutmentBox( Box( l(-16.0), l(-16.0), l(76.0), l(76.0) ) )
if editor:
UpdateSession.close()
editor.setCell( cell )
editor.fit()
UpdateSession.open()
with UpdateSession():
technology = DataBase.getDB().getTechnology()
metal1 = technology.getLayer( "metal1" )
metal2 = technology.getLayer( "metal2" )
@ -46,28 +37,25 @@ def drawLogo ( editor ):
net = Net.create( cell, 'logo' )
net.setExternal( True )
Vertical .create( net, metal1, toDbU(10.0), toDbU(12.0), toDbU( 4.0), toDbU(56.0) )
Horizontal.create( net, metal1, toDbU(50.0), toDbU(12.0), toDbU( 4.0), toDbU(56.0) )
Vertical .create( net, metal1, toDbU(50.0), toDbU(12.0), toDbU(56.0), toDbU( 4.0) )
Horizontal.create( net, metal1, toDbU(10.0), toDbU(12.0), toDbU(56.0), toDbU( 4.0) )
Vertical .create( net, metal1, l(10.0), l(12.0), l( 4.0), l(56.0) )
Horizontal.create( net, metal1, l(50.0), l(12.0), l( 4.0), l(56.0) )
Vertical .create( net, metal1, l(50.0), l(12.0), l(56.0), l( 4.0) )
Horizontal.create( net, metal1, l(10.0), l(12.0), l(56.0), l( 4.0) )
Vertical .create( net, metal1, toDbU(-6.0), toDbU(12.0), toDbU(22.0), toDbU(56.0) )
Horizontal.create( net, metal1, toDbU(66.0), toDbU(12.0), toDbU(22.0), toDbU(56.0) )
Vertical .create( net, metal1, toDbU(66.0), toDbU(12.0), toDbU(36.0), toDbU( 4.0) )
Horizontal.create( net, metal1, toDbU(-6.0), toDbU(12.0), toDbU(36.0), toDbU( 4.0) )
Vertical .create( net, metal1, l(-6.0), l(12.0), l(22.0), l(56.0) )
Horizontal.create( net, metal1, l(66.0), l(12.0), l(22.0), l(56.0) )
Vertical .create( net, metal1, l(66.0), l(12.0), l(36.0), l( 4.0) )
Horizontal.create( net, metal1, l(-6.0), l(12.0), l(36.0), l( 4.0) )
Horizontal.create( net, nwell, toDbU(30.0), toDbU(92.0), toDbU(-16.0), toDbU(76.0) )
UpdateSession.close()
Horizontal.create( net, nwell, l(30.0), l(92.0), l(-16.0), l(76.0) )
AllianceFramework.get().saveCell( cell, Catalog.State.Views )
return
def scriptMain ( **kw ):
"""The mandatory function to be called by Coriolis CGT/Unicorn."""
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
drawLogo( editor )
return True

View File

@ -1,34 +1,25 @@
#!/usr/bin/python
import sys
from Hurricane import *
from CRL import *
def toDbU ( l ): return DbU.fromLambda(l)
def doBreak ( level, message ):
UpdateSession.close()
Breakpoint.stop( level, message )
UpdateSession.open()
from Hurricane import DataBase, DbU, Point, Box, Net, Vertical, Horizontal, Diagonal
from CRL import AllianceFramework, Catalog, Gds
from helpers import l
from helpers.overlay import UpdateSession
def buildDiagonals ( editor ):
DbU.setPolygonStep( toDbU(1.0) )
UpdateSession.open()
"""Check the Diagonal segments of Hurricane."""
DbU.setPolygonStep( l(1.0) )
with UpdateSession():
cell = AllianceFramework.get().createCell( 'diagonal' )
cell.setTerminal( True )
cell.setTerminalNetlist( True )
cell.setAbutmentBox( Box( toDbU(-5.0), toDbU(-5.0), toDbU(65.0), toDbU(75.0) ) )
cell.setAbutmentBox( Box( l(-5.0), l(-5.0), l(65.0), l(75.0) ) )
if editor:
UpdateSession.close()
editor.setCell( cell )
editor.fit()
UpdateSession.open()
technology = DataBase.getDB().getTechnology()
metal1 = technology.getLayer( "metal1" )
@ -45,45 +36,42 @@ def buildDiagonals ( editor ):
contpoly = technology.getLayer( "CONT_POLY" )
ntie = technology.getLayer( "NTIE" )
with UpdateSession():
net = Net.create( cell, 'my_net' )
net.setExternal( True )
Diagonal.create( net, metal2
, Point( toDbU(20.0), toDbU(10.0) )
, Point( toDbU(10.0), toDbU(20.0) )
, toDbU(4.0)
, Point( l(20.0), l(10.0) )
, Point( l(10.0), l(20.0) )
, l(4.0)
)
Vertical.create( net, metal2, toDbU(10.0), toDbU(4.0), toDbU(20.0), toDbU(30.0) )
Vertical.create( net, metal2, l(10.0), l(4.0), l(20.0), l(30.0) )
Diagonal.create( net, metal2
, Point( toDbU(10.0), toDbU(30.0) )
, Point( toDbU(20.0), toDbU(40.0) )
, toDbU(4.0)
, Point( l(10.0), l(30.0) )
, Point( l(20.0), l(40.0) )
, l(4.0)
)
Horizontal.create( net, metal2, toDbU(40.0), toDbU(4.0), toDbU(20.0), toDbU(30.0) )
Horizontal.create( net, metal2, l(40.0), l(4.0), l(20.0), l(30.0) )
Diagonal.create( net, metal2
, Point( toDbU(30.0), toDbU(40.0) )
, Point( toDbU(40.0), toDbU(30.0) )
, toDbU(4.0)
, Point( l(30.0), l(40.0) )
, Point( l(40.0), l(30.0) )
, l(4.0)
)
Vertical.create( net, metal2, toDbU(40.0), toDbU(4.0), toDbU(30.0), toDbU(20.0) )
Vertical.create( net, metal2, l(40.0), l(4.0), l(30.0), l(20.0) )
Diagonal.create( net, metal2
, Point( toDbU(40.0), toDbU(20.0) )
, Point( toDbU(30.0), toDbU(10.0) )
, toDbU(4.0)
, Point( l(40.0), l(20.0) )
, Point( l(30.0), l(10.0) )
, l(4.0)
)
Horizontal.create( net, metal2, toDbU(10.0), toDbU(4.0), toDbU(30.0), toDbU(20.0) )
UpdateSession.close()
Horizontal.create( net, metal2, l(10.0), l(4.0), l(30.0), l(20.0) )
Gds.save( cell )
return
def scriptMain ( **kw ):
"""The mandatory function to be called by Coriolis CGT/Unicorn."""
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
buildDiagonals( editor )
return True

View File

@ -1,38 +1,37 @@
#!/usr/bin/python
import sys
from Hurricane import *
from CRL import *
def toDbU ( l ): return DbU.fromLambda(l)
from Hurricane import DataBase, Instance, Box, Net, Horizontal, Vertical, Contact, \
RoutingPad, Transformation, Occurrence, \
Breakpoint
from CRL import AllianceFramework, Catalog, Gds
from helpers import l
from helpers.overlay import UpdateSession
def doBreak ( level, message ):
UpdateSession.close()
Breakpoint.stop( level, message )
UpdateSession.open()
def buildFulladder ( editor ):
"""
Build a full adder, place it, add filler cells and create routing
for the "a" net.
"""
# Get the Framework and all the master cells.
af = AllianceFramework.get()
xr2_x2 = af.getCell( 'xr2_x1', Catalog.State.Views )
a2_x2 = af.getCell( 'a2_x2' , Catalog.State.Views )
o2_x2 = af.getCell( 'o2_x2' , Catalog.State.Views )
UpdateSession.open()
with UpdateSession():
fulladder = af.createCell( 'fulladder' )
fulladder.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(90.0), toDbU(100.0) ) )
fulladder.setAbutmentBox( Box( l(0.0), l(0.0), l(90.0), l(100.0) ) )
if editor:
UpdateSession.close()
editor.setCell( fulladder )
editor.fit()
UpdateSession.open()
with UpdateSession():
# Create Instances.
a2_1 = Instance.create( fulladder, 'a2_1', a2_x2 )
a2_2 = Instance.create( fulladder, 'a2_2', a2_x2 )
@ -85,54 +84,60 @@ def buildFulladder ( editor ):
cout.setExternal( True )
o2_1.getPlug( o2_x2.getNet('q') ).setNet( cout )
with UpdateSession():
# Instances placement.
a2_1.setTransformation( Transformation( toDbU(0.0)
, toDbU(0.0)
a2_1.setTransformation( Transformation( l(0.0)
, l(0.0)
, Transformation.Orientation.ID ) )
a2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
#doBreak( 1, 'Placed a2_1' )
xr2_1.setTransformation( Transformation( toDbU( 0.0)
, toDbU(100.0)
with UpdateSession():
xr2_1.setTransformation( Transformation( l( 0.0)
, l(100.0)
, Transformation.Orientation.MY ) )
xr2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
#doBreak( 1, 'Placed xr2_1' )
a2_2.setTransformation( Transformation( toDbU(25.0)
, toDbU( 0.0)
with UpdateSession():
a2_2.setTransformation( Transformation( l(25.0)
, l( 0.0)
, Transformation.Orientation.ID ) )
a2_2.setPlacementStatus( Instance.PlacementStatus.PLACED )
#doBreak( 1, 'Placed a2_2' )
xr2_2.setTransformation( Transformation( toDbU( 45.0)
, toDbU(100.0)
with UpdateSession():
xr2_2.setTransformation( Transformation( l( 45.0)
, l(100.0)
, Transformation.Orientation.MY ) )
xr2_2.setPlacementStatus( Instance.PlacementStatus.PLACED )
#doBreak( 1, 'Placed xr2_2' )
o2_1.setTransformation( Transformation( toDbU(65.0)
, toDbU( 0.0)
with UpdateSession():
o2_1.setTransformation( Transformation( l(65.0)
, l( 0.0)
, Transformation.Orientation.ID ) )
o2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
#doBreak( 1, 'Placed o2_1' )
with UpdateSession():
# Add filler cells.
tie_x0 = af.getCell( 'tie_x0', Catalog.State.Views )
rowend_x0 = af.getCell( 'rowend_x0', Catalog.State.Views )
filler_1 = Instance.create( fulladder, 'filler_1', tie_x0 )
filler_2 = Instance.create( fulladder, 'filler_2', rowend_x0 )
filler_1.setTransformation( Transformation( toDbU(50.0)
, toDbU( 0.0)
filler_1.setTransformation( Transformation( l(50.0)
, l( 0.0)
, Transformation.Orientation.ID ) )
filler_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
filler_2.setTransformation( Transformation( toDbU(60.0)
, toDbU( 0.0)
filler_2.setTransformation( Transformation( l(60.0)
, l( 0.0)
, Transformation.Orientation.ID ) )
filler_2.setPlacementStatus( Instance.PlacementStatus.PLACED )
#doBreak( 1, 'Filler cell placeds' )
#
# Getting the layers.
technology = DataBase.getDB().getTechnology()
metal2 = technology.getLayer( "METAL2" )
@ -140,6 +145,7 @@ def buildFulladder ( editor ):
via12 = technology.getLayer( "VIA12" )
via23 = technology.getLayer( "VIA23" )
with UpdateSession():
# Build wiring for a.
# Create RoutingPads first.
rp1 = RoutingPad.create( a
@ -150,23 +156,20 @@ def buildFulladder ( editor ):
, RoutingPad.BiggestArea )
# Then regular wiring.
contact1 = Contact.create( rp1, via12, toDbU( 0.0), toDbU(-15.0) )
contact2 = Contact.create( rp2, via12, toDbU( 0.0), toDbU( 10.0) )
turn = Contact.create( a , via23, toDbU(10.0), toDbU( 35.0) )
Horizontal.create( contact2, turn , metal2, toDbU(35.0), toDbU(2.0) )
Vertical .create( turn , contact1, metal3, toDbU(10.0), toDbU(2.0) )
UpdateSession.close()
contact1 = Contact.create( rp1, via12, l( 0.0), l(-15.0) )
contact2 = Contact.create( rp2, via12, l( 0.0), l( 10.0) )
turn = Contact.create( a , via23, l(10.0), l( 35.0) )
Horizontal.create( contact2, turn , metal2, l(35.0), l(2.0) )
Vertical .create( turn , contact1, metal3, l(10.0), l(2.0) )
af.saveCell( fulladder, Catalog.State.Views )
Gds.save( fulladder )
return
def scriptMain ( **kw ):
"""The mandatory function to be called by Coriolis CGT/Unicorn."""
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
buildFulladder( editor )
return True

View File

@ -1,32 +1,28 @@
#!/usr/bin/python
import sys
from Hurricane import *
from CRL import *
def toDbU ( l ): return DbU.fromLambda(l)
from Hurricane import DataBase, NetExternalComponents, Net, \
DbU, Point, Box, Horizontal, Vertical, Contact, RoutingPad, \
Breakpoint
from CRL import AllianceFramework, Catalog
from helpers import l
from helpers.overlay import UpdateSession
def doBreak ( level, message ):
UpdateSession.close()
"""Put a breakpoint into the script."""
Breakpoint.stop( level, message )
UpdateSession.open()
def buildInvertor ( editor ):
UpdateSession.open()
"""Build step by step an invertor standard cell."""
with UpdateSession():
cell = AllianceFramework.get().createCell( 'invertor' )
cell.setTerminal( True )
cell.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(15.0), toDbU(50.0) ) )
cell.setTerminalNetlist( True )
cell.setAbutmentBox( Box( l(0.0), l(0.0), l(15.0), l(50.0) ) )
if editor:
UpdateSession.close()
editor.setCell( cell )
editor.fit()
UpdateSession.open()
technology = DataBase.getDB().getTechnology()
metal1 = technology.getLayer( "METAL1" )
@ -41,61 +37,62 @@ def buildInvertor ( editor ):
contpoly = technology.getLayer( "CONT_POLY" )
ntie = technology.getLayer( "NTIE" )
with UpdateSession():
net = Net.create( cell, "nwell" )
Vertical.create( net, nwell, toDbU(7.5), toDbU(15.0), toDbU(27.0), toDbU(51.0) )
Vertical.create( net, nwell, l(7.5), l(15.0), l(27.0), l(51.0) )
vdd = Net.create( cell, "vdd" )
vdd.setExternal( True )
vdd.setGlobal ( True )
h = Horizontal.create(vdd, metal1, toDbU(47.0), toDbU(6.0), toDbU(0.0), toDbU(15.0) )
h = Horizontal.create(vdd, metal1, l(47.0), l(6.0), l(0.0), l(15.0) )
NetExternalComponents.setExternal( h )
Contact.create ( vdd, contdifn, toDbU(10.0), toDbU(47.0), toDbU( 1.0), toDbU( 1.0) )
Contact.create ( vdd, contdifp, toDbU( 4.0), toDbU(45.0), toDbU( 1.0), toDbU( 1.0) )
Vertical.create( vdd, pdif , toDbU( 3.5), toDbU( 4.0), toDbU(28.0), toDbU(46.0) )
Vertical.create( vdd, ntie , toDbU(10.0), toDbU( 3.0), toDbU(43.0), toDbU(48.0) )
Contact.create ( vdd, contdifn, l(10.0), l(47.0), l( 1.0), l( 1.0) )
Contact.create ( vdd, contdifp, l( 4.0), l(45.0), l( 1.0), l( 1.0) )
Vertical.create( vdd, pdif , l( 3.5), l( 4.0), l(28.0), l(46.0) )
Vertical.create( vdd, ntie , l(10.0), l( 3.0), l(43.0), l(48.0) )
doBreak( 1, 'Done building vdd.' )
with UpdateSession():
vss = Net.create( cell, "vss" )
vss.setExternal( True )
vss.setGlobal ( True )
h = Horizontal.create(vss, metal1, toDbU(3.0), toDbU(6.0), toDbU(0.0), toDbU(15.0))
h = Horizontal.create(vss, metal1, l(3.0), l(6.0), l(0.0), l(15.0))
NetExternalComponents.setExternal( h )
Vertical.create( vss, ndif , toDbU(3.5), toDbU(4.0), toDbU(4.0), toDbU(12.0) )
Contact.create ( vss, contdifn, toDbU(4.0), toDbU(5.0), toDbU(1.0), toDbU( 1.0) )
Vertical.create( vss, ndif , l(3.5), l(4.0), l(4.0), l(12.0) )
Contact.create ( vss, contdifn, l(4.0), l(5.0), l(1.0), l( 1.0) )
doBreak( 1, 'Done building vss.' )
with UpdateSession():
i = Net.create( cell, "i" )
i.setExternal( True )
v = Vertical.create ( i, metal1, toDbU(5.0), toDbU(2.0), toDbU(10.0), toDbU(40.0) )
v = Vertical.create ( i, metal1, l(5.0), l(2.0), l(10.0), l(40.0) )
NetExternalComponents.setExternal( v )
Vertical.create ( i, ptrans , toDbU( 7.0), toDbU( 1.0), toDbU(26.0), toDbU(39.0) )
Vertical.create ( i, ntrans , toDbU( 7.0), toDbU( 1.0), toDbU( 6.0), toDbU(14.0) )
Vertical.create ( i, poly , toDbU( 7.0), toDbU( 1.0), toDbU(14.0), toDbU(26.0) )
Horizontal.create( i, poly , toDbU(20.0), toDbU( 3.0), toDbU( 4.0), toDbU( 7.0) )
Contact.create ( i, contpoly, toDbU( 5.0), toDbU(20.0), toDbU( 1.0), toDbU( 1.0) )
Vertical.create ( i, ptrans , l( 7.0), l( 1.0), l(26.0), l(39.0) )
Vertical.create ( i, ntrans , l( 7.0), l( 1.0), l( 6.0), l(14.0) )
Vertical.create ( i, poly , l( 7.0), l( 1.0), l(14.0), l(26.0) )
Horizontal.create( i, poly , l(20.0), l( 3.0), l( 4.0), l( 7.0) )
Contact.create ( i, contpoly, l( 5.0), l(20.0), l( 1.0), l( 1.0) )
doBreak( 1, 'Done building i.' )
with UpdateSession():
nq = Net.create ( cell, "nq" )
nq.setExternal( True )
v = Vertical.create( nq, metal1, toDbU(10.0), toDbU(2.0), toDbU(10.0), toDbU(40.0) )
v = Vertical.create( nq, metal1, l(10.0), l(2.0), l(10.0), l(40.0) )
NetExternalComponents.setExternal( v )
Vertical.create( nq, pdif , toDbU(10.0), toDbU( 3.0), toDbU(28.0), toDbU(37.0) )
Vertical.create( nq, ndif , toDbU(10.0), toDbU( 3.0), toDbU( 8.0), toDbU(12.0) )
Contact.create ( nq, contdifp, toDbU(10.0), toDbU(35.0), toDbU( 1.0), toDbU( 1.0) )
Contact.create ( nq, contdifp, toDbU(10.0), toDbU(30.5), toDbU( 1.0), toDbU( 1.0) )
Contact.create ( nq, contdifn, toDbU(10.0), toDbU(10.0), toDbU( 1.0), toDbU( 1.0) )
Vertical.create( nq, pdif , l(10.0), l( 3.0), l(28.0), l(37.0) )
Vertical.create( nq, ndif , l(10.0), l( 3.0), l( 8.0), l(12.0) )
Contact.create ( nq, contdifp, l(10.0), l(35.0), l( 1.0), l( 1.0) )
Contact.create ( nq, contdifp, l(10.0), l(30.5), l( 1.0), l( 1.0) )
Contact.create ( nq, contdifn, l(10.0), l(10.0), l( 1.0), l( 1.0) )
doBreak( 1, 'Done building q.' )
UpdateSession.close()
AllianceFramework.get().saveCell( cell, Catalog.State.Views )
return
def scriptMain ( **kw ):
"""The mandatory function to be called by Coriolis CGT/Unicorn."""
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
buildInvertor( editor )
return True

View File

@ -1,36 +1,24 @@
#!/usr/bin/python
import sys
from Hurricane import *
from CRL import *
def toDbU ( l ): return DbU.fromLambda(l)
def toMicron ( u ): return DbU.toPhysical( u, DbU.UnitPowerMicro )
def doBreak ( level, message ):
UpdateSession.close()
Breakpoint.stop( level, message )
UpdateSession.open()
from Hurricane import DataBase, NetExternalComponents, Net, \
DbU, Point, Box, Polygon
from CRL import AllianceFramework, Catalog, Gds
from helpers import l, u
from helpers.overlay import UpdateSession
def buildPolygons ( editor ):
#DbU.setPolygonStep( toDbU(0.1) )
UpdateSession.open()
"""Draw a set of Polygons checking all possible combination."""
#DbU.setPolygonStep( l(0.1) )
with UpdateSession():
cell = AllianceFramework.get().createCell( 'polygons' )
cell.setTerminal( True )
cell.setAbutmentBox( Box( toDbU(-5.0), toDbU(-5.0), toDbU(65.0), toDbU(75.0) ) )
#cell.setAbutmentBox( Box( toDbU(-5.0), toDbU(-5.0), toDbU(21.0), toDbU(35.0) ) )
cell.setTerminalNetlist( True )
cell.setAbutmentBox( Box( l(-5.0), l(-5.0), l(65.0), l(75.0) ) )
#cell.setAbutmentBox( Box( l(-5.0), l(-5.0), l(21.0), l(35.0) ) )
if editor:
UpdateSession.close()
editor.setCell( cell )
editor.fit()
UpdateSession.open()
technology = DataBase.getDB().getTechnology()
metal1 = technology.getLayer( "METAL1" )
@ -48,124 +36,117 @@ def buildPolygons ( editor ):
contpoly = technology.getLayer( "CONT_POLY" )
ntie = technology.getLayer( "NTIE" )
with UpdateSession():
net = Net.create( cell, 'my_net' )
net.setExternal( True )
#points = [ Point( toDbU( 0.0), toDbU( 0.0) )
# , Point( toDbU( 10.0), toDbU( 0.0) )
# , Point( toDbU( 7.0), toDbU( 8.0) )
# , Point( toDbU( 3.0), toDbU( 8.0) ) ]
#points = [ Point( l( 0.0), l( 0.0) )
# , Point( l( 10.0), l( 0.0) )
# , Point( l( 7.0), l( 8.0) )
# , Point( l( 3.0), l( 8.0) ) ]
#p = Polygon.create( net, metal4, points )
# Counter-clockwise, slope > 1.
points = [ Point( toDbU( 3.0), toDbU( 0.0) )
, Point( toDbU( 13.0), toDbU( 0.0) )
, Point( toDbU( 16.0), toDbU( 10.0) )
, Point( toDbU( 16.0), toDbU( 20.0) )
, Point( toDbU( 13.0), toDbU( 30.0) )
, Point( toDbU( 3.0), toDbU( 30.0) )
, Point( toDbU( 0.0), toDbU( 20.0) )
, Point( toDbU( 0.0), toDbU( 10.0) ) ]
points = [ Point( l( 3.0), l( 0.0) )
, Point( l( 13.0), l( 0.0) )
, Point( l( 16.0), l( 10.0) )
, Point( l( 16.0), l( 20.0) )
, Point( l( 13.0), l( 30.0) )
, Point( l( 3.0), l( 30.0) )
, Point( l( 0.0), l( 20.0) )
, Point( l( 0.0), l( 10.0) ) ]
p = Polygon.create( net, metal2, points )
#p.translate( toDbU(40.0), toDbU(0.0) )
#p.translate( l(40.0), l(0.0) )
# clockwise, slope > 1.
points = [ Point( toDbU( 0.0), toDbU( 10.0) )
, Point( toDbU( 0.0), toDbU( 20.0) )
, Point( toDbU( 3.0), toDbU( 30.0) )
, Point( toDbU( 13.0), toDbU( 30.0) )
, Point( toDbU( 16.0), toDbU( 20.0) )
, Point( toDbU( 16.0), toDbU( 10.0) )
, Point( toDbU( 13.0), toDbU( 0.0) )
, Point( toDbU( 3.0), toDbU( 0.0) ) ]
points = [ Point( l( 0.0), l( 10.0) )
, Point( l( 0.0), l( 20.0) )
, Point( l( 3.0), l( 30.0) )
, Point( l( 13.0), l( 30.0) )
, Point( l( 16.0), l( 20.0) )
, Point( l( 16.0), l( 10.0) )
, Point( l( 13.0), l( 0.0) )
, Point( l( 3.0), l( 0.0) ) ]
p = Polygon.create( net, metal2, points )
p.translate( toDbU(0.0), toDbU(40.0) )
p.translate( l(0.0), l(40.0) )
# Counter-clockwise, slope < 1.
points = [ Point( toDbU( 10.0), toDbU( 0.0) )
, Point( toDbU( 20.0), toDbU( 0.0) )
, Point( toDbU( 30.0), toDbU( 3.0) )
, Point( toDbU( 30.0), toDbU( 13.0) )
, Point( toDbU( 20.0), toDbU( 16.0) )
, Point( toDbU( 10.0), toDbU( 16.0) )
, Point( toDbU( 0.0), toDbU( 13.0) )
, Point( toDbU( 0.0), toDbU( 3.0) ) ]
points = [ Point( l( 10.0), l( 0.0) )
, Point( l( 20.0), l( 0.0) )
, Point( l( 30.0), l( 3.0) )
, Point( l( 30.0), l( 13.0) )
, Point( l( 20.0), l( 16.0) )
, Point( l( 10.0), l( 16.0) )
, Point( l( 0.0), l( 13.0) )
, Point( l( 0.0), l( 3.0) ) ]
p = Polygon.create( net, metal2, points )
p.translate( toDbU(30.0), toDbU(0.0) )
p.translate( l(30.0), l(0.0) )
# clockwise.
points = [ Point( toDbU( 0.0), toDbU( 3.0) )
, Point( toDbU( 0.0), toDbU( 13.0) )
, Point( toDbU( 10.0), toDbU( 16.0) )
, Point( toDbU( 20.0), toDbU( 16.0) )
, Point( toDbU( 30.0), toDbU( 13.0) )
, Point( toDbU( 30.0), toDbU( 3.0) )
, Point( toDbU( 20.0), toDbU( 0.0) )
, Point( toDbU( 10.0), toDbU( 0.0) ) ]
points = [ Point( l( 0.0), l( 3.0) )
, Point( l( 0.0), l( 13.0) )
, Point( l( 10.0), l( 16.0) )
, Point( l( 20.0), l( 16.0) )
, Point( l( 30.0), l( 13.0) )
, Point( l( 30.0), l( 3.0) )
, Point( l( 20.0), l( 0.0) )
, Point( l( 10.0), l( 0.0) ) ]
p = Polygon.create( net, metal2, points )
p.translate( toDbU(30.0), toDbU(40.0) )
p.translate( l(30.0), l(40.0) )
# Big parallelogram.
points = [ Point( toDbU( 0.0), toDbU( 0.0) )
, Point( toDbU( 20.0), toDbU( 20.0) )
, Point( toDbU( 60.0), toDbU( 20.0) )
, Point( toDbU( 40.0), toDbU( 0.0) ) ]
points = [ Point( l( 0.0), l( 0.0) )
, Point( l( 20.0), l( 20.0) )
, Point( l( 60.0), l( 20.0) )
, Point( l( 40.0), l( 0.0) ) ]
p = Polygon.create( net, metal3, points )
p.translate( toDbU(70.0), toDbU(0.0) )
p.translate( l(70.0), l(0.0) )
points = [ Point( toDbU( 0.0), toDbU( 20.0) )
, Point( toDbU( 40.0), toDbU( 20.0) )
, Point( toDbU( 60.0), toDbU( 0.0) )
, Point( toDbU( 20.0), toDbU( 0.0) ) ]
points = [ Point( l( 0.0), l( 20.0) )
, Point( l( 40.0), l( 20.0) )
, Point( l( 60.0), l( 0.0) )
, Point( l( 20.0), l( 0.0) ) ]
p = Polygon.create( net, metal3, points )
p.translate( toDbU(140.0), toDbU(0.0) )
p.translate( l(140.0), l(0.0) )
points = [ Point( toDbU( 0.0), toDbU( 0.0) )
, Point( toDbU( 0.0), toDbU( 10.0) )
, Point( toDbU( 20.0), toDbU( 30.0) )
, Point( toDbU( 60.0), toDbU( 30.0) )
, Point( toDbU( 60.0), toDbU( 20.0) )
, Point( toDbU( 40.0), toDbU( 0.0) ) ]
points = [ Point( l( 0.0), l( 0.0) )
, Point( l( 0.0), l( 10.0) )
, Point( l( 20.0), l( 30.0) )
, Point( l( 60.0), l( 30.0) )
, Point( l( 60.0), l( 20.0) )
, Point( l( 40.0), l( 0.0) ) ]
p = Polygon.create( net, metal3, points )
p.translate( toDbU(70.0), toDbU(40.0) )
p.translate( l(70.0), l(40.0) )
points = [ Point( toDbU( 0.0), toDbU( 20.0) )
, Point( toDbU( 0.0), toDbU( 30.0) )
, Point( toDbU( 40.0), toDbU( 30.0) )
, Point( toDbU( 60.0), toDbU( 10.0) )
, Point( toDbU( 60.0), toDbU( 0.0) )
, Point( toDbU( 20.0), toDbU( 0.0) ) ]
points = [ Point( l( 0.0), l( 20.0) )
, Point( l( 0.0), l( 30.0) )
, Point( l( 40.0), l( 30.0) )
, Point( l( 60.0), l( 10.0) )
, Point( l( 60.0), l( 0.0) )
, Point( l( 20.0), l( 0.0) ) ]
p = Polygon.create( net, metal3, points )
p.translate( toDbU(140.0), toDbU(40.0) )
p.translate( l(140.0), l(40.0) )
print 'Normalized and manhattanized contour:'
print( 'Normalized and manhattanized contour:' )
i = 0
for point in p.getMContour():
print '| %d '%i, point \
, '[%fum %fum]' % ( toMicron(point.getX()) \
, toMicron(point.getY()) )
print( '| %d '%i, point, '[%fum %fum]' % ( u(point.getX()), u(point.getY()) ))
i += 1
print 'Sub-polygons (for GDSII generation)'
print( 'Sub-polygons (for GDSII generation)' )
subpolygons = p.getSubPolygons()
for i in range(len(subpolygons)):
print '+ Sub-Polygon %d:' % i
print( '+ Sub-Polygon %d:' % i )
for j in range(len(subpolygons[i])):
print ' [%3d]' % j, subpolygons[i][j] \
, '[%fum %fum]' % ( toMicron(subpolygons[i][j].getX()) \
, toMicron(subpolygons[i][j].getY()) )
UpdateSession.close()
print( ' [%3d]' % j, subpolygons[i][j] \
, '[%fum %fum]' % ( u(subpolygons[i][j].getX()), u(subpolygons[i][j].getY()) ))
Gds.save( cell )
return
def scriptMain ( **kw ):
"""The mandatory function to be called by Coriolis CGT/Unicorn."""
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
buildPolygons( editor )
return True

View File

@ -1,34 +1,23 @@
#!/usr/bin/python
import sys
from Hurricane import *
from CRL import *
def toDbU ( l ): return DbU.fromLambda(l)
def toMicron ( u ): return DbU.toPhysical( u, DbU.UnitPowerMicro )
def doBreak ( level, message ):
UpdateSession.close()
Breakpoint.stop( level, message )
UpdateSession.open()
from Hurricane import DataBase, Net, \
DbU, Point, Box, Rectilinear
from CRL import AllianceFramework, Catalog, Gds
from helpers import l, u
from helpers.overlay import UpdateSession
def buildRectilinear ( editor ):
UpdateSession.open()
"""Check Hurricane.Rectilinear class."""
with UpdateSession():
cell = AllianceFramework.get().createCell( 'Rectilinear' )
cell.setTerminal( True )
cell.setAbutmentBox( Box( toDbU(-5.0), toDbU(-5.0), toDbU(65.0), toDbU(75.0) ) )
#cell.setAbutmentBox( Box( toDbU(-5.0), toDbU(-5.0), toDbU(21.0), toDbU(35.0) ) )
cell.setTerminalNetlist( True )
cell.setAbutmentBox( Box( l(-5.0), l(-5.0), l(65.0), l(75.0) ) )
#cell.setAbutmentBox( Box( l(-5.0), l(-5.0), l(21.0), l(35.0) ) )
if editor:
UpdateSession.close()
editor.setCell( cell )
editor.fit()
UpdateSession.open()
technology = DataBase.getDB().getTechnology()
metal1 = technology.getLayer( "METAL1" )
@ -46,37 +35,32 @@ def buildRectilinear ( editor ):
contpoly = technology.getLayer( "CONT_POLY" )
ntie = technology.getLayer( "NTIE" )
with UpdateSession():
net = Net.create( cell, 'my_net' )
net.setExternal( True )
points = [ Point( toDbU( 0.0), toDbU( 0.0) )
, Point( toDbU( 0.0), toDbU( 10.0) )
, Point( toDbU( 20.0), toDbU( 30.0) )
, Point( toDbU( 30.0), toDbU( 30.0) )
, Point( toDbU( 30.0), toDbU( 20.0) )
, Point( toDbU( 10.0), toDbU( 0.0) ) ]
points = [ Point( l( 0.0), l( 0.0) )
, Point( l( 0.0), l( 10.0) )
, Point( l( 20.0), l( 30.0) )
, Point( l( 30.0), l( 30.0) )
, Point( l( 30.0), l( 20.0) )
, Point( l( 10.0), l( 0.0) ) ]
r = Rectilinear.create( net, metal2, points )
#print 'Normalized and manhattanized contour:'
#print( 'Normalized and manhattanized contour:' )
#i = 0
#for point in p.getMContour():
# print '| %d '%i, point \
# , '[%fum %fum]' % ( toMicron(point.getX()) \
# , toMicron(point.getY()) )
# print( '| %d '%i, point, '[%fum %fum]' % ( u(point.getX()), u(point.getY()) ))
# i += 1
UpdateSession.close()
Gds.save( cell )
return
def scriptMain ( **kw ):
"""The mandatory function to be called by Coriolis CGT/Unicorn."""
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
buildRectilinear( editor )
return True

View File

@ -1,8 +1,12 @@
#!/usr/bin/python
import sys
from Hurricane import *
from CRL import *
from Hurricane import Instance, Net, Horizontal, Vertical, Contact, \
RoutingPad, Transformation, \
Breakpoint
from CRL import AllianceFramework, Catalog
from helpers import l
from helpers.overlay import UpdateSession
import Etesian
import Anabatic
import Katana
@ -11,24 +15,19 @@ import Katana
af = AllianceFramework.get()
def toDbU ( l ): return DbU.fromLambda(l)
def doBreak ( level, message ):
UpdateSession.close()
Breakpoint.stop( level, message )
UpdateSession.open()
def buildFulladder ( editor ):
"""Build the netlist of a full adder."""
# Get the Framework and all the master cells.
xr2_x2 = af.getCell( 'xr2_x1', Catalog.State.Views )
a2_x2 = af.getCell( 'a2_x2' , Catalog.State.Views )
o2_x2 = af.getCell( 'o2_x2' , Catalog.State.Views )
UpdateSession.open()
with UpdateSession():
fulladder = af.createCell( 'fulladder' )
# Create Instances.
@ -83,40 +82,42 @@ def buildFulladder ( editor ):
cout.setExternal( True )
o2_1.getPlug( o2_x2.getNet('q') ).setNet( cout )
UpdateSession.close()
af.saveCell( fulladder, Catalog.State.Views )
return fulladder
def placeAndRoute ( editor, cell ):
# Run the placer.
etesian = Etesian.EtesianEngine.create(cell)
etesian.place()
"""
Direct call of the ToolEngines:
* Etesian: placement.
* Katana: routing.
"""
# Run the placer.
etesian = Etesian.EtesianEngine.create( cell )
etesian.place()
if editor:
editor.setCell( cell )
editor.fit()
Breakpoint.stop( 1, 'After placement' )
# Run the router.
katana = Katana.KatanaEngine.create(cell)
katana = Katana.KatanaEngine.create( cell )
katana.digitalInit ()
katana.runGlobalRouter ()
katana.runGlobalRouter ( Katana.Flags.NoFlags )
katana.loadGlobalRouting( Anabatic.EngineLoadGrByNet )
katana.layerAssign ( Anabatic.EngineNoNetLayerAssign )
katana.runNegociate ( Katana.Flags.NoFlags )
af.saveCell( cell, Catalog.State.Views )
return
def scriptMain ( **kw ):
"""The mandatory function to be called by Coriolis CGT/Unicorn."""
editor = None
if kw.has_key('editor') and kw['editor']:
if 'editor' in kw and kw['editor']:
editor = kw['editor']
fulladder = buildFulladder( editor )
placeAndRoute( editor, fulladder )
return True

View File

@ -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">
&lt;CORIOLIS_INSTALL&gt;/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">&quot;a&quot;</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">&amp;</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">&amp;</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">&amp;</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">&quot;hurricane/Session.h&quot;</span><span class="cp"></span>
<div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf">&quot;hurricane/Net.h&quot;</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">&quot;new_net&quot;</span> <span class="p">);</span>
<span class="n">net</span><span class="o">-&gt;</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">-&gt;</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">-&gt;</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">&lt;&lt;</span> <span class="s">&quot;Created &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">net</span> <span class="o">&lt;&lt;</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">&quot;new_net&quot;</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">&quot;Created&quot;</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">&#39;</span><span class="si">{}</span><span class="s1"> has been created&#39;</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">&#39;</span><span class="si">{}</span><span class="s1"> has been deleted&#39;</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">&#39;&lt;MyAttribute </span><span class="si">{}</span><span class="s1">&gt;&#39;</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">&#39;cell.myAttribute0 =&#39;</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">&#39;cell.myAttribute0 =&#39;</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">&quot;nwell&quot;</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&#39;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">&quot;nwell&quot;</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&#39;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">&lt;CORIOLIS_INSTALL&gt;/etc/coriolis2</span></tt>. For example, to use the 45nm FreeDPK
which is in:</p>
<pre class="literal-block">
&lt;CORIOLIS_INSTALL&gt;/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">&#39;45/freepdk_45&#39;</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">&#39;Alliance.Classic [black]&#39;</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">&#39;misc.catchCore&#39;</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">&#39;misc.info&#39;</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">&#39;misc.paranoid&#39;</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">&#39;misc.bug&#39;</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">&#39;misc.logMode&#39;</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">&#39;misc.verboseLevel1&#39;</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">&#39;misc.verboseLevel2&#39;</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">&#39;CELLS_TOP&#39;</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">&#39;CELLS_TOP&#39;</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">&#39;../../../cells&#39;</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">&#39;Alliance.Classic [black]&#39;</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">&#39;^ck$|m_clock|^clk$&#39;</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">&#39;/nsxlib&#39;</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">&#39;/niolib&#39;</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">&#39;my_inv&#39;</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">&#39;my_inv&#39;</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">&quot;&quot;&quot;Convert a lambda into a DbU.&quot;&quot;&quot;</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">&quot;&quot;&quot;Convert a length in micrometer into a DbU.&quot;&quot;&quot;</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">&quot;&quot;&quot;Convert a length in nanometer into a DbU.&quot;&quot;&quot;</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">&quot;&quot;&quot;Put a breakpoint into the script.&quot;&quot;&quot;</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">&quot;&quot;&quot;Build step by step an invertor standard cell.&quot;&quot;&quot;</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">&#39;invertor&#39;</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">&quot;METAL1&quot;</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">&quot;POLY&quot;</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">&quot;NTIE&quot;</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">&quot;nwell&quot;</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">&quot;vdd&quot;</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">&#39;Done building vdd.&#39;</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">&quot;vss&quot;</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">&#39;Done building vss.&#39;</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">&quot;i&quot;</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">&#39;Done building i.&#39;</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">&quot;nq&quot;</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">&#39;Done building q.&#39;</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">&quot;&quot;&quot;The Mandatory function to be run by Coriolis interactively.&quot;&quot;&quot;</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">&#39;editor&#39;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">&#39;editor&#39;</span><span class="p">]:</span>
<span class="k">if</span> <span class="s1">&#39;editor&#39;</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">&#39;editor&#39;</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">&#39;editor&#39;</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">&#39;Components of&#39;</span><span class="p">,</span> <span class="n">net</span>
<span class="nb">print</span><span class="p">(</span> <span class="s1">&#39;Components of&#39;</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">&#39;|&#39;</span><span class="p">,</span> <span class="n">component</span>
<span class="nb">print</span><span class="p">(</span> <span class="s1">&#39;|&#39;</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">-&gt;</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">&lt;&lt;</span> <span class="s">&quot;Components of &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">net</span> <span class="o">&lt;&lt;</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">-&gt;</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">&#39;nymous_&#39;</span><span class="p">):</span>
<span class="nb">print</span> <span class="s1">&#39;Destroy&#39;</span><span class="p">,</span> <span class="n">net</span>
<span class="nb">print</span><span class="p">(</span> <span class="s1">&#39;Destroy&#39;</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">&quot;&quot;&quot;Build step by step an invertor standard cell.&quot;&quot;&quot;</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">&#39;invertor&#39;</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">&quot;&quot;&quot;The Mandatory function to be run by Coriolis interactively.&quot;&quot;&quot;</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">&#39;editor&#39;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">&#39;editor&#39;</span><span class="p">]:</span>
<span class="k">if</span> <span class="s1">&#39;editor&#39;</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">&#39;editor&#39;</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">&#39;editor&#39;</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">&quot;&quot;&quot;Put a breakpoint into the script.&quot;&quot;&quot;</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">&quot;&quot;&quot;Build step by step full adder (netlist &amp; placement).&quot;&quot;&quot;</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">&#39;xr2_x1&#39;</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">&#39;a2_x2&#39;</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">&#39;o2_x2&#39;</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">&#39;fulladder&#39;</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">&#39;a2_1&#39;</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">&#39;a2_2&#39;</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">&#39;q&#39;</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">&#39;Placed a2_1&#39;</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">&#39;Placed xr2_1&#39;</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">&#39;Placed a2_2&#39;</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">&#39;Placed xr2_2&#39;</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">&#39;Placed o2_1&#39;</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">&#39;tie_x0&#39;</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">&#39;rowend_x0&#39;</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">&#39;filler_1&#39;</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">&#39;filler_2&#39;</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">&#39;Filler cell placeds&#39;</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">&quot;VIA12&quot;</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">&quot;VIA23&quot;</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">&quot;&quot;&quot;The Mandatory function to be run by Coriolis interactively.&quot;&quot;&quot;</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">&#39;editor&#39;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">&#39;editor&#39;</span><span class="p">]:</span>
<span class="k">if</span> <span class="s1">&#39;editor&#39;</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">&#39;editor&#39;</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">&#39;editor&#39;</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">&quot;etesian.effort&quot;</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">&#39;etesian.uniformDensity&#39;</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">&#39;etesian.spaceMargin&#39;</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">&#39;etesian.aspectRatio&#39;</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">&#39;xr2_x1&#39;</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">&#39;a2_x2&#39;</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">&#39;o2_x2&#39;</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">&#39;fulladder&#39;</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">&#39;q&#39;</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">&#39;editor&#39;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">kw</span><span class="p">[</span><span class="s1">&#39;editor&#39;</span><span class="p">]:</span>
<span class="k">if</span> <span class="s1">&#39;editor&#39;</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">&#39;editor&#39;</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">&#39;editor&#39;</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">&#39;</span><span class="si">{}</span><span class="s1"> has been created&#39;</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">&#39;</span><span class="si">{}</span><span class="s1"> has been deleted&#39;</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">&#39;&lt;MyAttribute </span><span class="si">{}</span><span class="s1">&gt;&#39;</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">&#39;cell.myAttribute0 =&#39;</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">&#39;cell.myAttribute0 =&#39;</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>

Binary file not shown.

View File

@ -100,7 +100,8 @@ div#contents ul > li > a {
*/
span.cb {
background: yellow;
font-family: "courrier";
font-weight: bold;
}
div.note {

View File

@ -100,7 +100,8 @@ div#contents ul > li > a {
*/
span.cb {
background: yellow;
font-family: "courrier";
font-weight: bold;
}
div.note {

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# This file is part of the Coriolis Software.
# Copyright (c) Sorbonne Université 2017-2021, All Rights Reserved
# Copyright (c) Sorbonne Université 2017-2022, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
@ -21,20 +21,12 @@ try:
import Viewer
import CRL
import helpers
from helpers.io import ErrorMessage
from helpers.io import WarningMessage
from helpers import showPythonTrace
from helpers import showPythonTrace, trace, l, u, n
from helpers.io import ErrorMessage, WarningMessage
from helpers.overlay import UpdateSession
import plugins
from Hurricane import DataBase
from Hurricane import Breakpoint
from Hurricane import UpdateSession
from Hurricane import DbU
from Hurricane import Box
from Hurricane import Contact
from Hurricane import Vertical
from Hurricane import Horizontal
from Hurricane import Net
from Hurricane import Cell
from Hurricane import DataBase, Breakpoint, DbU, Box, Contact, \
Vertical, Horizontal, Net, Cell
except ImportError as e:
serror = str(e)
if serror.startswith('No module named'):
@ -44,8 +36,6 @@ except ImportError as e:
if serror.find('cannot open shared object file'):
library = serror.split(':')[0]
print( '[ERROR] The "{}" shared library cannot be loaded.'.format(library) )
print( ' Under RHEL 6, you must be under devtoolset-2.' )
print( ' (scl enable devtoolset-2 bash)' )
sys.exit(1)
except Exception as e:
print( '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' )
@ -66,16 +56,13 @@ def runDemo ( cell, editor ):
if cell:
print( WarningMessage( '"demo_cell" has already been created, do not run twice.' ))
return
UpdateSession.open()
with UpdateSession():
cell = Cell.create( library, 'demo_cell' )
cell.setAbutmentBox( Box( DbU.fromLambda( 0.0), DbU.fromLambda( 0.0)
, DbU.fromLambda(15.0), DbU.fromLambda(50.0) ) )
UpdateSession.close()
cell.setAbutmentBox( Box( l( 0.0), l( 0.0), l(15.0), l(50.0) ) )
if editor: editor.setCell( cell )
Breakpoint.stop( 1, 'Abutment box has been drawn.' )
UpdateSession.open()
with UpdateSession():
technology = DataBase.getDB().getTechnology()
nwell = technology.getLayer( 'NWELL' )
ntrans = technology.getLayer( 'NTRANS' )
@ -89,47 +76,46 @@ def runDemo ( cell, editor ):
metal1 = technology.getLayer( 'METAL1' )
nwellNet = Net.create( cell, 'nwell' )
Horizontal.create( nwellNet, nwell, DbU.fromLambda(39.0), DbU.fromLambda(24.0), DbU.fromLambda(0.0), DbU.fromLambda(15.0) )
Horizontal.create( nwellNet, nwell, l(39.0), l(24.0), l(0.0), l(15.0) )
vss = Net.create( cell, 'vss' )
vdd = Net.create( cell, 'vdd' )
Horizontal.create( vss, metal1 , DbU.fromLambda(3.0), DbU.fromLambda(6.0), DbU.fromLambda(0.0), DbU.fromLambda(15.0) )
Vertical.create ( vss, diffN , DbU.fromLambda(3.5), DbU.fromLambda(4.0), DbU.fromLambda(4.0), DbU.fromLambda(12.0) )
Contact.create ( vss, contDiffN, DbU.fromLambda(4.0), DbU.fromLambda(5.0) )
Horizontal.create( vdd, metal1 , DbU.fromLambda(47.0), DbU.fromLambda( 6.0), DbU.fromLambda( 0.0), DbU.fromLambda(15.0) )
Vertical.create ( vdd, diffP , DbU.fromLambda( 3.5), DbU.fromLambda( 4.0), DbU.fromLambda(28.0), DbU.fromLambda(46.0) )
Contact.create ( vdd, contDiffP, DbU.fromLambda( 4.0), DbU.fromLambda(45.0) )
UpdateSession.close()
Horizontal.create( vss, metal1 , l(3.0), l(6.0), l(0.0), l(15.0) )
Vertical.create ( vss, diffN , l(3.5), l(4.0), l(4.0), l(12.0) )
Contact.create ( vss, contDiffN, l(4.0), l(5.0) )
Horizontal.create( vdd, metal1 , l(47.0), l( 6.0), l( 0.0), l(15.0) )
Vertical.create ( vdd, diffP , l( 3.5), l( 4.0), l(28.0), l(46.0) )
Contact.create ( vdd, contDiffP, l( 4.0), l(45.0) )
Breakpoint.stop( 1, 'Power nets have been drawn.' )
UpdateSession.open()
with UpdateSession():
nq = Net.create( cell, 'nq' )
Vertical.create ( nq, diffN , DbU.fromLambda(10.0), DbU.fromLambda( 3.0), DbU.fromLambda( 8.0), DbU.fromLambda(12.0) )
Vertical.create ( nq, diffP , DbU.fromLambda(10.0), DbU.fromLambda( 3.0), DbU.fromLambda(28.0), DbU.fromLambda(37.0) )
Contact.create ( nq, contDiffN, DbU.fromLambda(10.0), DbU.fromLambda(10.0) )
Contact.create ( nq, contDiffP, DbU.fromLambda(10.0), DbU.fromLambda(30.0) )
Contact.create ( nq, contDiffP, DbU.fromLambda(10.0), DbU.fromLambda(35.0) )
Vertical.create ( nq, metal1 , DbU.fromLambda(10.0), DbU.fromLambda( 2.0), DbU.fromLambda(10.0), DbU.fromLambda(40.0) )
UpdateSession.close()
Vertical.create ( nq, diffN , l(10.0), l( 3.0), l( 8.0), l(12.0) )
Vertical.create ( nq, diffP , l(10.0), l( 3.0), l(28.0), l(37.0) )
Contact.create ( nq, contDiffN, l(10.0), l(10.0) )
Contact.create ( nq, contDiffP, l(10.0), l(30.0) )
Contact.create ( nq, contDiffP, l(10.0), l(35.0) )
Vertical.create ( nq, metal1 , l(10.0), l( 2.0), l(10.0), l(40.0) )
Breakpoint.stop( 1, 'Output has been drawn.' )
UpdateSession.open()
with UpdateSession():
i = Net.create( cell, 'i' )
Vertical.create ( i, ntrans , DbU.fromLambda( 7.0), DbU.fromLambda( 1.0), DbU.fromLambda( 6.0), DbU.fromLambda(14.0) )
Vertical.create ( i, poly , DbU.fromLambda( 7.0), DbU.fromLambda( 1.0), DbU.fromLambda(14.0), DbU.fromLambda(26.0) )
Vertical.create ( i, ptrans , DbU.fromLambda( 7.0), DbU.fromLambda( 1.0), DbU.fromLambda(26.0), DbU.fromLambda(39.0) )
Horizontal.create( i, poly , DbU.fromLambda(20.0), DbU.fromLambda( 3.0), DbU.fromLambda( 4.0), DbU.fromLambda( 7.0) )
Contact.create ( i, contPoly , DbU.fromLambda( 5.0), DbU.fromLambda(20.0) )
Vertical.create ( i, metal1 , DbU.fromLambda( 5.0), DbU.fromLambda( 2.0), DbU.fromLambda(10.0), DbU.fromLambda(40.0) )
UpdateSession.close()
Vertical.create ( i, ntrans , l( 7.0), l( 1.0), l( 6.0), l(14.0) )
Vertical.create ( i, poly , l( 7.0), l( 1.0), l(14.0), l(26.0) )
Vertical.create ( i, ptrans , l( 7.0), l( 1.0), l(26.0), l(39.0) )
Horizontal.create( i, poly , l(20.0), l( 3.0), l( 4.0), l( 7.0) )
Contact.create ( i, contPoly , l( 5.0), l(20.0) )
Vertical.create ( i, metal1 , l( 5.0), l( 2.0), l(10.0), l(40.0) )
Breakpoint.stop( 1, 'Input has been drawn.' )
return
# --------------------------------------------------------------------
# Plugin hook functions, unicornHook:menus, ScritMain:call
def unicornHook ( **kw ):
"""
The mandatory function to make the plugin appears in the menus.
"""
editor = kw['editor']
editor.addMenu( 'tutorials' , 'Tutorials', Viewer.CellViewer.TopMenu )
#editor.addMenu( 'tutorials.plugins', 'Plugins' , Viewer.CellViewer.NoFlags )
@ -143,6 +129,10 @@ def unicornHook ( **kw ):
def scriptMain ( **kw ):
"""
The mandatory function from which a plugin will be called by Coriolis CGT/Unicorn.
"""
try:
helpers.staticInitialization( quiet=True )
#helpers.setTraceLevel( 550 )