2013-04-15 04:51:51 -05:00
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
2018-01-06 10:55:44 -06:00
// Copyright (c) UPMC 2006-2018, All Rights Reserved
2013-04-15 04:51:51 -05:00
//
// +-----------------------------------------------------------------+
2008-03-06 10:46:43 -06:00
// | C O R I O L I S |
// | I s o b a r - Hurricane / Python Interface |
// | |
// | Author : Jean-Paul CHAPUT |
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
// | E-mail : Jean-Paul.Chaput@lip6.fr |
2008-03-06 10:46:43 -06:00
// | =============================================================== |
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
// | C++ Module : "./PyCell.cpp" |
2013-04-15 04:51:51 -05:00
// +-----------------------------------------------------------------+
2008-03-06 10:46:43 -06:00
2008-05-21 17:46:29 -05:00
# include "hurricane/isobar/PyCell.h"
# include "hurricane/isobar/PyBox.h"
# include "hurricane/isobar/PyLibrary.h"
# include "hurricane/isobar/PyInstance.h"
# include "hurricane/isobar/PyOccurrence.h"
# include "hurricane/isobar/ProxyProperty.h"
# include "hurricane/isobar/PyNet.h"
2008-10-14 05:48:53 -05:00
# include "hurricane/isobar/PyNetCollection.h"
2008-10-17 12:27:20 -05:00
# include "hurricane/isobar/PyReferenceCollection.h"
# include "hurricane/isobar/PyInstanceCollection.h"
2013-04-15 04:51:51 -05:00
# include "hurricane/isobar/PyComponentCollection.h"
2008-10-17 12:27:20 -05:00
# include "hurricane/isobar/PyOccurrenceCollection.h"
2008-03-06 10:46:43 -06:00
namespace Isobar {
2008-03-28 04:48:47 -05:00
using namespace Hurricane ;
2008-03-06 10:46:43 -06:00
extern " C " {
# undef ACCESS_OBJECT
# undef ACCESS_CLASS
# define ACCESS_OBJECT _baseObject._object
# define ACCESS_CLASS(_pyObject) &(_pyObject->_baseObject)
# define METHOD_HEAD(function) GENERIC_METHOD_HEAD(Cell,cell,function)
// x=================================================================x
// | "PyCell" Python Module Code Part |
// x=================================================================x
# if defined(__PYTHON_MODULE__)
// x-------------------------------------------------------------x
// | "PyCell" Attribute Methods |
// x-------------------------------------------------------------x
// Standart Accessors (Attributes).
// Standart Delete (Attribute).
2008-03-17 08:54:33 -05:00
DBoDestroyAttribute ( PyCell_destroy , PyCell )
2008-03-06 10:46:43 -06:00
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
// ---------------------------------------------------------------
// Attribute Method : "PyCell_create ()"
Added Resistor support. Completed Capacitor & Resistor support in Bora.
* New: In Analog, added Analog::ResitorFamily & Analog::Resistor classes.
* New: In Analog, added inspector support for all Parameter classes.
* New: In Analog, new FloatParameter class (for resistor value).
* New: In CRL/etc/scn6m_deep_09/devices.py, added resistor device.
* New: In Oroshi, support for Resistors, stub for ResistorSnake generator.
* New: In Bora::DNodeSets, added support for Resistor devices.
* Change: In Bora::DSlicingNode, rename setNFing()/getNFing() into
setBoxSetIndex()/getBoxSetIndex() for semantic coherency.
* New: In Karakaze/python/AnalogDesign.py, added support for Resistor.
Change in addDevice(), the span which was only meaningful for
transistor devices is replaced by a parameter argument.
The parameter argument has to be consistent with the device type.
2019-11-11 19:21:03 -06:00
PyObject * PyCell_create ( PyObject * , PyObject * args )
{
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_create() " < < endl ;
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
Added Resistor support. Completed Capacitor & Resistor support in Bora.
* New: In Analog, added Analog::ResitorFamily & Analog::Resistor classes.
* New: In Analog, added inspector support for all Parameter classes.
* New: In Analog, new FloatParameter class (for resistor value).
* New: In CRL/etc/scn6m_deep_09/devices.py, added resistor device.
* New: In Oroshi, support for Resistors, stub for ResistorSnake generator.
* New: In Bora::DNodeSets, added support for Resistor devices.
* Change: In Bora::DSlicingNode, rename setNFing()/getNFing() into
setBoxSetIndex()/getBoxSetIndex() for semantic coherency.
* New: In Karakaze/python/AnalogDesign.py, added support for Resistor.
Change in addDevice(), the span which was only meaningful for
transistor devices is replaced by a parameter argument.
The parameter argument has to be consistent with the device type.
2019-11-11 19:21:03 -06:00
char * name = NULL ;
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
PyLibrary * pyLibrary = NULL ;
Added Resistor support. Completed Capacitor & Resistor support in Bora.
* New: In Analog, added Analog::ResitorFamily & Analog::Resistor classes.
* New: In Analog, added inspector support for all Parameter classes.
* New: In Analog, new FloatParameter class (for resistor value).
* New: In CRL/etc/scn6m_deep_09/devices.py, added resistor device.
* New: In Oroshi, support for Resistors, stub for ResistorSnake generator.
* New: In Bora::DNodeSets, added support for Resistor devices.
* Change: In Bora::DSlicingNode, rename setNFing()/getNFing() into
setBoxSetIndex()/getBoxSetIndex() for semantic coherency.
* New: In Karakaze/python/AnalogDesign.py, added support for Resistor.
Change in addDevice(), the span which was only meaningful for
transistor devices is replaced by a parameter argument.
The parameter argument has to be consistent with the device type.
2019-11-11 19:21:03 -06:00
Cell * cell = NULL ;
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
HTRY
Added Resistor support. Completed Capacitor & Resistor support in Bora.
* New: In Analog, added Analog::ResitorFamily & Analog::Resistor classes.
* New: In Analog, added inspector support for all Parameter classes.
* New: In Analog, new FloatParameter class (for resistor value).
* New: In CRL/etc/scn6m_deep_09/devices.py, added resistor device.
* New: In Oroshi, support for Resistors, stub for ResistorSnake generator.
* New: In Bora::DNodeSets, added support for Resistor devices.
* Change: In Bora::DSlicingNode, rename setNFing()/getNFing() into
setBoxSetIndex()/getBoxSetIndex() for semantic coherency.
* New: In Karakaze/python/AnalogDesign.py, added support for Resistor.
Change in addDevice(), the span which was only meaningful for
transistor devices is replaced by a parameter argument.
The parameter argument has to be consistent with the device type.
2019-11-11 19:21:03 -06:00
if ( PyArg_ParseTuple ( args , " O!s:Cell.create " , & PyTypeLibrary , & pyLibrary , & name ) ) {
cell = Cell : : create ( PYLIBRARY_O ( pyLibrary ) , Name ( name ) ) ;
} else {
string message = " Cell::create(): Invalid number of parameters for Cell constructor, name= " ;
if ( name ) message + = " \" " + getString ( name ) + " \" . " ;
else message + = " (NULL). " ;
PyErr_SetString ( ConstructorError , message . c_str ( ) ) ;
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
return NULL ;
Added Resistor support. Completed Capacitor & Resistor support in Bora.
* New: In Analog, added Analog::ResitorFamily & Analog::Resistor classes.
* New: In Analog, added inspector support for all Parameter classes.
* New: In Analog, new FloatParameter class (for resistor value).
* New: In CRL/etc/scn6m_deep_09/devices.py, added resistor device.
* New: In Oroshi, support for Resistors, stub for ResistorSnake generator.
* New: In Bora::DNodeSets, added support for Resistor devices.
* Change: In Bora::DSlicingNode, rename setNFing()/getNFing() into
setBoxSetIndex()/getBoxSetIndex() for semantic coherency.
* New: In Karakaze/python/AnalogDesign.py, added support for Resistor.
Change in addDevice(), the span which was only meaningful for
transistor devices is replaced by a parameter argument.
The parameter argument has to be consistent with the device type.
2019-11-11 19:21:03 -06:00
}
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
HCATCH
return PyCell_Link ( cell ) ;
}
2008-03-06 10:46:43 -06:00
// ---------------------------------------------------------------
2008-03-17 08:54:33 -05:00
// Attribute Method : "PyCell_getLibrary ()"
2008-03-06 10:46:43 -06:00
2008-03-17 08:54:33 -05:00
static PyObject * PyCell_getLibrary ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getLibrary () " < < endl ;
2008-03-06 10:46:43 -06:00
Library * library = NULL ;
HTRY
2008-03-17 08:54:33 -05:00
METHOD_HEAD ( " Cell.getLibrary() " )
library = cell - > getLibrary ( ) ;
2008-03-06 10:46:43 -06:00
HCATCH
2008-10-17 12:27:20 -05:00
return PyLibrary_Link ( library ) ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-03-17 08:54:33 -05:00
// Attribute Method : "PyCell_getName ()"
2008-03-06 10:46:43 -06:00
2008-12-11 06:25:02 -06:00
GetNameMethod ( Cell , cell )
2008-03-06 10:46:43 -06:00
// ---------------------------------------------------------------
2008-03-17 08:54:33 -05:00
// Attribute Method : "PyCell_getInstance ()"
2008-03-06 10:46:43 -06:00
2008-03-17 08:54:33 -05:00
static PyObject * PyCell_getInstance ( PyCell * self , PyObject * args ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getInstance () " < < endl ;
2008-12-10 12:37:32 -06:00
METHOD_HEAD ( " Cell.getInstance() " )
2008-03-06 10:46:43 -06:00
Instance * instance = NULL ;
HTRY
2008-12-10 12:37:32 -06:00
char * name ;
if ( PyArg_ParseTuple ( args , " s:Cell.getInstance " , & name ) ) {
instance = cell - > getInstance ( Name ( name ) ) ;
} else {
PyErr_SetString ( ConstructorError , " invalid number of parameters for Cell.getInstance. " ) ;
2008-10-17 12:27:20 -05:00
return NULL ;
2008-12-10 12:37:32 -06:00
}
2008-03-06 10:46:43 -06:00
HCATCH
2008-12-10 12:37:32 -06:00
return PyInstance_Link ( instance ) ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-17 12:27:20 -05:00
// Attribute Method : "PyCell_getInstances()"
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
static PyObject * PyCell_getInstances ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getInstances() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
METHOD_HEAD ( " Cell.getInstances() " )
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
PyInstanceCollection * pyInstanceCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-17 12:27:20 -05:00
Instances * instances = new Instances ( cell - > getInstances ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
pyInstanceCollection = PyObject_NEW ( PyInstanceCollection , & PyTypeInstanceCollection ) ;
if ( pyInstanceCollection = = NULL ) {
return NULL ;
}
pyInstanceCollection - > _object = instances ;
HCATCH
return ( PyObject * ) pyInstanceCollection ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-17 12:27:20 -05:00
// Attribute Method : "PyCell_getInstancesUnder()"
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
static PyObject * PyCell_getInstancesUnder ( PyCell * self , PyObject * args ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getInstancesUnder() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
METHOD_HEAD ( " Cell.getInstancesUnder() " )
2008-03-06 10:46:43 -06:00
2008-12-12 12:49:17 -06:00
PyBox * pyBox ;
if ( ! PyArg_ParseTuple ( args , " O!:Cell.getInstancesUnder " , & PyTypeBox , & pyBox ) ) {
return NULL ;
}
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
PyInstanceCollection * pyInstanceCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-12-12 12:49:17 -06:00
Instances * instances = new Instances ( cell - > getInstancesUnder ( * PYBOX_O ( pyBox ) ) ) ;
2008-10-17 12:27:20 -05:00
pyInstanceCollection = PyObject_NEW ( PyInstanceCollection , & PyTypeInstanceCollection ) ;
if ( pyInstanceCollection = = NULL ) {
return NULL ;
}
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
pyInstanceCollection - > _object = instances ;
HCATCH
return ( PyObject * ) pyInstanceCollection ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-17 12:27:20 -05:00
// Attribute Method : "PyCell_getSlaveInstances()"
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
static PyObject * PyCell_getSlaveInstances ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getSlaveInstances() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
METHOD_HEAD ( " Cell.getSlaveInstances() " )
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
PyInstanceCollection * pyInstanceCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-17 12:27:20 -05:00
Instances * instances = new Instances ( cell - > getSlaveInstances ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
pyInstanceCollection = PyObject_NEW ( PyInstanceCollection , & PyTypeInstanceCollection ) ;
if ( pyInstanceCollection = = NULL ) {
return NULL ;
}
pyInstanceCollection - > _object = instances ;
HCATCH
return ( PyObject * ) pyInstanceCollection ;
2008-03-06 10:46:43 -06:00
}
2013-04-15 04:51:51 -05:00
// ---------------------------------------------------------------
// Attribute Method : "PyCell_getComponents()"
static PyObject * PyCell_getComponents ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getComponents() " < < endl ;
2013-04-15 04:51:51 -05:00
METHOD_HEAD ( " Cell.getComponents() " )
PyComponentCollection * pyComponentCollection = NULL ;
HTRY
Components * components = new Components ( cell - > getComponents ( ) ) ;
pyComponentCollection = PyObject_NEW ( PyComponentCollection , & PyTypeComponentCollection ) ;
if ( pyComponentCollection = = NULL ) {
return NULL ;
}
pyComponentCollection - > _object = components ;
HCATCH
return ( PyObject * ) pyComponentCollection ;
}
// ---------------------------------------------------------------
// Attribute Method : "PyCell_getComponentsUnder()"
static PyObject * PyCell_getComponentsUnder ( PyCell * self , PyObject * args ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getComponentsUnder() " < < endl ;
2013-04-15 04:51:51 -05:00
METHOD_HEAD ( " Cell.getComponentsUnder() " )
PyBox * pyBox ;
if ( ! PyArg_ParseTuple ( args , " O!:Cell.getInstancesUnder " , & PyTypeBox , & pyBox ) ) {
return NULL ;
}
PyComponentCollection * pyComponentCollection = NULL ;
HTRY
Components * components = new Components ( cell - > getComponentsUnder ( * PYBOX_O ( pyBox ) ) ) ;
pyComponentCollection = PyObject_NEW ( PyComponentCollection , & PyTypeComponentCollection ) ;
if ( pyComponentCollection = = NULL ) {
return NULL ;
}
pyComponentCollection - > _object = components ;
HCATCH
return ( PyObject * ) pyComponentCollection ;
}
2008-03-06 10:46:43 -06:00
// ---------------------------------------------------------------
2008-10-17 12:27:20 -05:00
// Attribute Method : "PyCell_getOccurrences()"
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
static PyObject * PyCell_getOccurrences ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getOccurrences() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
METHOD_HEAD ( " Cell.getOccurrences() " )
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
PyOccurrenceCollection * pyOccurrenceCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-17 12:27:20 -05:00
Occurrences * occurrences = new Occurrences ( cell - > getOccurrences ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
pyOccurrenceCollection = PyObject_NEW ( PyOccurrenceCollection , & PyTypeOccurrenceCollection ) ;
if ( pyOccurrenceCollection = = NULL ) {
return NULL ;
}
pyOccurrenceCollection - > _object = occurrences ;
HCATCH
return ( PyObject * ) pyOccurrenceCollection ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-17 12:27:20 -05:00
// Attribute Method : "PyCell_getOccurrencesUnder()"
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
static PyObject * PyCell_getOccurrencesUnder ( PyCell * self , PyObject * args ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getOccurrencesUnder() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
METHOD_HEAD ( " Cell.getOccurrencesUnder() " )
2008-03-06 10:46:43 -06:00
2008-12-12 12:49:17 -06:00
PyBox * pyBox ;
if ( ! PyArg_ParseTuple ( args , " O!:Cell.getInstancesUnder " , & PyTypeBox , & pyBox ) ) {
2008-10-17 12:27:20 -05:00
return NULL ;
2008-12-12 12:49:17 -06:00
}
2008-10-17 12:27:20 -05:00
PyOccurrenceCollection * pyOccurrenceCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-12-12 12:49:17 -06:00
Occurrences * occurrences = new Occurrences ( cell - > getOccurrencesUnder ( * PYBOX_O ( pyBox ) ) ) ;
2008-10-17 12:27:20 -05:00
pyOccurrenceCollection = PyObject_NEW ( PyOccurrenceCollection , & PyTypeOccurrenceCollection ) ;
if ( pyOccurrenceCollection = = NULL ) {
return NULL ;
}
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
pyOccurrenceCollection - > _object = occurrences ;
HCATCH
return ( PyObject * ) pyOccurrenceCollection ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-17 12:27:20 -05:00
// Attribute Method : "PyCell_getLeafInstanceOccurrences()"
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
static PyObject * PyCell_getLeafInstanceOccurrences ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getLeafInstanceOccurrences() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
METHOD_HEAD ( " Cell.getLeafInstanceOccurrences() " )
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
PyOccurrenceCollection * pyOccurrenceCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-17 12:27:20 -05:00
Occurrences * occurrences = new Occurrences ( cell - > getLeafInstanceOccurrences ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
pyOccurrenceCollection = PyObject_NEW ( PyOccurrenceCollection , & PyTypeOccurrenceCollection ) ;
if ( pyOccurrenceCollection = = NULL ) {
return NULL ;
}
pyOccurrenceCollection - > _object = occurrences ;
HCATCH
return ( PyObject * ) pyOccurrenceCollection ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-17 12:27:20 -05:00
// Attribute Method : "PyCell_getLeafInstanceOccurrencesUnder()"
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
static PyObject * PyCell_getLeafInstanceOccurrencesUnder ( PyCell * self , PyObject * args ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getLeafInstanceOccurrencesUnder() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
METHOD_HEAD ( " Cell.getLeafInstanceOccurrencesUnder() " )
2008-03-06 10:46:43 -06:00
2008-12-12 12:49:17 -06:00
PyBox * pyBox ;
if ( ! PyArg_ParseTuple ( args , " O!:Cell.getInstancesUnder " , & PyTypeBox , & pyBox ) ) {
return NULL ;
}
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
PyOccurrenceCollection * pyOccurrenceCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-12-12 12:49:17 -06:00
Occurrences * occurrences = new Occurrences ( cell - > getLeafInstanceOccurrencesUnder ( * PYBOX_O ( pyBox ) ) ) ;
2008-10-17 12:27:20 -05:00
pyOccurrenceCollection = PyObject_NEW ( PyOccurrenceCollection , & PyTypeOccurrenceCollection ) ;
if ( pyOccurrenceCollection = = NULL ) {
return NULL ;
}
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
pyOccurrenceCollection - > _object = occurrences ;
HCATCH
return ( PyObject * ) pyOccurrenceCollection ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-17 12:27:20 -05:00
// Attribute Method : "PyCell_getReferences()"
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
static PyObject * PyCell_getReferences ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getReferences() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
METHOD_HEAD ( " Cell.getReferences() " )
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
PyReferenceCollection * pyReferenceCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-17 12:27:20 -05:00
References * references = new References ( cell - > getReferences ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
pyReferenceCollection = PyObject_NEW ( PyReferenceCollection , & PyTypeReferenceCollection ) ;
if ( pyReferenceCollection = = NULL ) {
return NULL ;
}
pyReferenceCollection - > _object = references ;
HCATCH
return ( PyObject * ) pyReferenceCollection ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-17 12:27:20 -05:00
// Attribute Method : "PyCell_getHyperNets()"
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
static PyObject * PyCell_getHyperNets ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getHyperNets() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
METHOD_HEAD ( " Cell.getHyperNets() " )
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
PyOccurrenceCollection * pyOccurrenceCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-17 12:27:20 -05:00
Occurrences * occurrences = new Occurrences ( cell - > getHyperNetRootNetOccurrences ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-17 12:27:20 -05:00
pyOccurrenceCollection = PyObject_NEW ( PyOccurrenceCollection , & PyTypeOccurrenceCollection ) ;
if ( pyOccurrenceCollection = = NULL ) {
return NULL ;
}
pyOccurrenceCollection - > _object = occurrences ;
HCATCH
return ( ( PyObject * ) pyOccurrenceCollection ) ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-03-17 08:54:33 -05:00
// Attribute Method : "PyCell_getNet ()"
2008-03-06 10:46:43 -06:00
2008-12-10 12:37:32 -06:00
static PyObject * PyCell_getNet ( PyCell * self , PyObject * args ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getNet () " < < endl ;
2008-12-10 12:37:32 -06:00
METHOD_HEAD ( " Cell.getNet() " )
Net * net = NULL ;
HTRY
char * name = NULL ;
2008-12-12 12:49:17 -06:00
if ( ! PyArg_ParseTuple ( args , " s:Cell.getNet " , & name ) ) {
2008-12-10 12:37:32 -06:00
return NULL ;
2008-12-12 12:49:17 -06:00
}
net = cell - > getNet ( Name ( name ) ) ;
2008-12-10 12:37:32 -06:00
HCATCH
return PyNet_Link ( net ) ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-14 05:48:53 -05:00
// Attribute Method : "PyCell_getNets ()"
2008-03-06 10:46:43 -06:00
2008-10-14 05:48:53 -05:00
static PyObject * PyCell_getNets ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getNets() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
METHOD_HEAD ( " Cell.getNets() " )
2008-03-06 10:46:43 -06:00
2008-10-14 05:48:53 -05:00
PyNetCollection * pyNetCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-14 13:44:20 -05:00
Nets * nets = new Nets ( cell - > getNets ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
pyNetCollection = PyObject_NEW ( PyNetCollection , & PyTypeNetCollection ) ;
if ( pyNetCollection = = NULL ) {
return NULL ;
}
2008-03-06 10:46:43 -06:00
2008-10-14 05:48:53 -05:00
pyNetCollection - > _object = nets ;
2008-03-06 10:46:43 -06:00
HCATCH
2008-10-14 13:44:20 -05:00
2008-10-14 05:48:53 -05:00
return ( ( PyObject * ) pyNetCollection ) ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-14 13:44:20 -05:00
// Attribute Method : "PyCell_getExternalNets()"
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
static PyObject * PyCell_getExternalNets ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getExternalNets() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
METHOD_HEAD ( " Cell.getExternalNets() " )
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
PyNetCollection * pyNetCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-14 13:44:20 -05:00
Nets * nets = new Nets ( cell - > getExternalNets ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
pyNetCollection = PyObject_NEW ( PyNetCollection , & PyTypeNetCollection ) ;
if ( pyNetCollection = = NULL ) {
return NULL ;
}
pyNetCollection - > _object = nets ;
2008-03-06 10:46:43 -06:00
HCATCH
2008-10-14 13:44:20 -05:00
return ( ( PyObject * ) pyNetCollection ) ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-14 13:44:20 -05:00
// Attribute Method : "PyCell_getClockNets()"
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
static PyObject * PyCell_getClockNets ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getClockNets() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
METHOD_HEAD ( " Cell.getClockNets " )
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
PyNetCollection * pyNetCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-14 13:44:20 -05:00
Nets * nets = new Nets ( cell - > getClockNets ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
pyNetCollection = PyObject_NEW ( PyNetCollection , & PyTypeNetCollection ) ;
if ( pyNetCollection = = NULL ) {
return NULL ;
}
pyNetCollection - > _object = nets ;
2008-03-06 10:46:43 -06:00
HCATCH
2008-10-14 13:44:20 -05:00
return ( ( PyObject * ) pyNetCollection ) ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-14 13:44:20 -05:00
// Attribute Method : "PyCell_getSupplyNets()"
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
static PyObject * PyCell_getSupplyNets ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getSupplyNets() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
METHOD_HEAD ( " Cell.getSupplyNets() " )
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
PyNetCollection * pyNetCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-14 13:44:20 -05:00
Nets * nets = new Nets ( cell - > getSupplyNets ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
pyNetCollection = PyObject_NEW ( PyNetCollection , & PyTypeNetCollection ) ;
if ( pyNetCollection = = NULL ) {
return NULL ;
}
pyNetCollection - > _object = nets ;
2008-03-06 10:46:43 -06:00
HCATCH
2008-10-14 13:44:20 -05:00
return ( ( PyObject * ) pyNetCollection ) ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-14 13:44:20 -05:00
// Attribute Method : "PyCell_getPowerNets()"
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
static PyObject * PyCell_getPowerNets ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getPowerNets() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
METHOD_HEAD ( " Cell.getPowerNets() " )
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
PyNetCollection * pyNetCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-14 13:44:20 -05:00
Nets * nets = new Nets ( cell - > getPowerNets ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
pyNetCollection = PyObject_NEW ( PyNetCollection , & PyTypeNetCollection ) ;
if ( pyNetCollection = = NULL ) {
return NULL ;
}
pyNetCollection - > _object = nets ;
2008-03-06 10:46:43 -06:00
HCATCH
2008-10-14 13:44:20 -05:00
return ( ( PyObject * ) pyNetCollection ) ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-10-14 13:44:20 -05:00
// Attribute Method : "PyCell_getGroundNets()"
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
static PyObject * PyCell_getGroundNets ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getGroundNets() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
METHOD_HEAD ( " Cell.getGroundNets() " )
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
PyNetCollection * pyNetCollection = NULL ;
2008-03-06 10:46:43 -06:00
HTRY
2008-10-14 13:44:20 -05:00
Nets * nets = new Nets ( cell - > getGroundNets ( ) ) ;
2008-03-06 10:46:43 -06:00
2008-10-14 13:44:20 -05:00
pyNetCollection = PyObject_NEW ( PyNetCollection , & PyTypeNetCollection ) ;
if ( pyNetCollection = = NULL ) {
return NULL ;
}
pyNetCollection - > _object = nets ;
2008-03-06 10:46:43 -06:00
HCATCH
2008-10-14 13:44:20 -05:00
return ( ( PyObject * ) pyNetCollection ) ;
2008-03-06 10:46:43 -06:00
}
// ---------------------------------------------------------------
2008-03-17 08:54:33 -05:00
// Attribute Method : "PyCell_getAbutmentBox ()"
2008-03-06 10:46:43 -06:00
2008-03-17 08:54:33 -05:00
static PyObject * PyCell_getAbutmentBox ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getAbutmentBox() " < < endl ;
2008-03-06 10:46:43 -06:00
2008-03-17 08:54:33 -05:00
METHOD_HEAD ( " Cell.getAbutmentBox() " )
2008-03-06 10:46:43 -06:00
PyBox * abutmentBox = PyObject_NEW ( PyBox , & PyTypeBox ) ;
if ( abutmentBox = = NULL ) { return NULL ; }
HTRY
2008-03-17 08:54:33 -05:00
abutmentBox - > _object = new Box ( cell - > getAbutmentBox ( ) ) ;
2008-03-06 10:46:43 -06:00
HCATCH
return ( ( PyObject * ) abutmentBox ) ;
}
// ---------------------------------------------------------------
2008-03-22 08:18:26 -05:00
// Attribute Method : "PyCell_setName ()"
2008-03-06 10:46:43 -06:00
2008-12-11 06:25:02 -06:00
SetNameMethod ( Cell , cell )
2008-03-06 10:46:43 -06:00
// ---------------------------------------------------------------
2008-03-22 08:18:26 -05:00
// Attribute Method : "PyCell_setAbutmentBox ()"
2008-03-06 10:46:43 -06:00
2008-03-22 08:18:26 -05:00
static PyObject * PyCell_setAbutmentBox ( PyCell * self , PyObject * args ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " Cell.setAbutmentBox() " < < endl ;
2008-03-06 10:46:43 -06:00
HTRY
2008-03-22 08:18:26 -05:00
METHOD_HEAD ( " Cell.setAbutmentBox() " )
2008-03-06 10:46:43 -06:00
2008-12-12 12:49:17 -06:00
PyBox * pyBox ;
2012-12-04 06:29:45 -06:00
if ( ! PyArg_ParseTuple ( args , " O!:Cell.setAbutmentBox " , & PyTypeBox , & pyBox ) ) {
2008-10-17 12:27:20 -05:00
return NULL ;
2008-12-12 12:49:17 -06:00
}
cell - > setAbutmentBox ( * PYBOX_O ( pyBox ) ) ;
2008-03-06 10:46:43 -06:00
HCATCH
Py_RETURN_NONE ;
}
// ---------------------------------------------------------------
2008-03-22 08:18:26 -05:00
// Attribute Method : "PyCell_setTerminal ()"
2008-03-06 10:46:43 -06:00
2008-03-22 08:18:26 -05:00
static PyObject * PyCell_setTerminal ( PyCell * self , PyObject * args ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_setTerminal () " < < endl ;
2008-03-06 10:46:43 -06:00
HTRY
2008-03-22 08:18:26 -05:00
METHOD_HEAD ( " Cell.setTerminal() " )
2008-03-06 10:46:43 -06:00
PyObject * arg0 ;
2008-12-12 12:49:17 -06:00
if ( ! PyArg_ParseTuple ( args , " O:Cell.setTerminal " , & arg0 ) & & PyBool_Check ( arg0 ) ) {
return NULL ;
}
2012-11-16 06:48:38 -06:00
PyObject_IsTrue ( arg0 ) ? cell - > setTerminal ( true ) : cell - > setTerminal ( false ) ;
2008-03-06 10:46:43 -06:00
HCATCH
Py_RETURN_NONE ;
}
Support for Uniquification. Rewrite of the Blif parser.
* New: In Hurricane, In NetAlias & Net, add an AliasList collection to
iterate over all the aliases names (this *not* include the main
net name).
* New: In Hurricane, In Cell, Instance & Net add support for cloning and
uniquification (update documentation).
All Cells that are uniquified from a given model are kept in an
Uniquify relation. This relation allows to get all the clones and
generate unique clone names by adding a "_uXX" suffix.
* Bug: In Hurricane, the Cell::_isFlattenLeaf attribute was not initialized
in the constructor.
* Change: In CRL Core, in AllianceFramework::getCell(), no longer destroy
a partially loaded Cell in case of parser failure, let the incomplete
Cell be.
* New: In CRL Core, in ApParser, if all the instances are placed, sets the
Cell::Placed flag.
* Change: In CRL Core, in BlifParser, complete rewrite of the parser.
Not so good an idea afterwards...
* New: In Etesian, uniquify the design before placing.
* Change: In Kite, display the list of unrouted wired after all other
statistics.
2015-04-25 09:52:18 -05:00
// ---------------------------------------------------------------
// Attribute Method : "PyCell_uniquify ()"
static PyObject * PyCell_uniquify ( PyCell * self , PyObject * args ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_uniquify () " < < endl ;
Support for Uniquification. Rewrite of the Blif parser.
* New: In Hurricane, In NetAlias & Net, add an AliasList collection to
iterate over all the aliases names (this *not* include the main
net name).
* New: In Hurricane, In Cell, Instance & Net add support for cloning and
uniquification (update documentation).
All Cells that are uniquified from a given model are kept in an
Uniquify relation. This relation allows to get all the clones and
generate unique clone names by adding a "_uXX" suffix.
* Bug: In Hurricane, the Cell::_isFlattenLeaf attribute was not initialized
in the constructor.
* Change: In CRL Core, in AllianceFramework::getCell(), no longer destroy
a partially loaded Cell in case of parser failure, let the incomplete
Cell be.
* New: In CRL Core, in ApParser, if all the instances are placed, sets the
Cell::Placed flag.
* Change: In CRL Core, in BlifParser, complete rewrite of the parser.
Not so good an idea afterwards...
* New: In Etesian, uniquify the design before placing.
* Change: In Kite, display the list of unrouted wired after all other
statistics.
2015-04-25 09:52:18 -05:00
HTRY
METHOD_HEAD ( " Cell.uniquify() " )
unsigned int depth ;
if ( not PyArg_ParseTuple ( args , " I:Cell.uniquify " , & depth ) ) {
PyErr_SetString ( ConstructorError , " Cell.uniquify(): Invalid number/bad type of parameter. " ) ;
return NULL ;
}
cell - > uniquify ( depth ) ;
HCATCH
Py_RETURN_NONE ;
}
// ---------------------------------------------------------------
// Attribute Method : "PyCell_getClone ()"
static PyObject * PyCell_getClone ( PyCell * self ) {
2016-06-11 14:56:12 -05:00
cdebug_log ( 20 , 0 ) < < " PyCell_getClone () " < < endl ;
Support for Uniquification. Rewrite of the Blif parser.
* New: In Hurricane, In NetAlias & Net, add an AliasList collection to
iterate over all the aliases names (this *not* include the main
net name).
* New: In Hurricane, In Cell, Instance & Net add support for cloning and
uniquification (update documentation).
All Cells that are uniquified from a given model are kept in an
Uniquify relation. This relation allows to get all the clones and
generate unique clone names by adding a "_uXX" suffix.
* Bug: In Hurricane, the Cell::_isFlattenLeaf attribute was not initialized
in the constructor.
* Change: In CRL Core, in AllianceFramework::getCell(), no longer destroy
a partially loaded Cell in case of parser failure, let the incomplete
Cell be.
* New: In CRL Core, in ApParser, if all the instances are placed, sets the
Cell::Placed flag.
* Change: In CRL Core, in BlifParser, complete rewrite of the parser.
Not so good an idea afterwards...
* New: In Etesian, uniquify the design before placing.
* Change: In Kite, display the list of unrouted wired after all other
statistics.
2015-04-25 09:52:18 -05:00
Cell * cloneCell = NULL ;
HTRY
METHOD_HEAD ( " Cell.getClone() " )
cloneCell = cell - > getClone ( ) ;
HCATCH
return PyCell_Link ( cloneCell ) ;
}
2008-03-06 10:46:43 -06:00
// Standart Predicates (Attributes).
Merged QuadTrees in overlayed Cells (placed together).
* New: In Hurricane, in Cell & Instance, add the ability to merge the
QuadTree when *second level* instances of a Cell are placed in
the same space as the top Cell. This is the case of a deeply
hierarchical design made of only standard cells that are to
be placed in a "flat" manner.
The design is uniquified then the intermediate instances models,
which should be unique at that point have their QuadTree merged
through a call to Instance::slaveAbutmentBox(). That method will
make the model of the instance use the QuadTree of the Cell to
which the instance belong. The instance model no longer posseses
a dedicated QuadTree. As a corollary the abutment box of both
Cell are kept identical and the Instance has it's transformation
set to (0,0,ID).
Remark: when we talk about "QuadTree", we mean in fact the
QuadTree for the instances *and* the SliceMap (Layer+QuadTree).
Consequence in Query: when going through the resulting
"flattened" QuadTree we will find objects with an incomplete
Path du to the fact that we didn't have to explore their
Instance/Cell level to reach them. The shunted part of the
Path is stored in the Go master Cell in the _shuntedPath
attribute. This also affect the displayed depth of hierarchy,
but not too badly.
* New: In Hurricane, in Cell, new methods:
- Cell::updatePlacedFlag() : set the placement flags.
- Cell::isUnique() : one or less instance.
- Cell::isUniquified() : is the result of an uniquification.
- Cell::isUniquifyMaster() : is the reference cell of the
uniquification.
* Change: In Hurricane, in Cell::Uniquify(), uniquify a Cell only
if it is unplaced. We do not need to duplicate placed Cells
(see datapathes).
2015-06-26 11:35:11 -05:00
DirectGetBoolAttribute ( PyCell_isTerminal , isTerminal , PyCell , Cell )
DirectGetBoolAttribute ( PyCell_isLeaf , isLeaf , PyCell , Cell )
DirectGetBoolAttribute ( PyCell_isUnique , isUnique , PyCell , Cell )
DirectGetBoolAttribute ( PyCell_isUniquified , isUniquified , PyCell , Cell )
DirectGetBoolAttribute ( PyCell_isUniquifyMaster , isUniquifyMaster , PyCell , Cell )
Various bug corrections to pass the alliance-check-toolkit reference benchs.
* New: In Isobar::PyCell, export the isRouted() and setRouted() to the
Python interface.
* Bug: In CRL::Entity::parseEntity(), check that the closing parenthesis
is the last character of the net name. Issue a more relevant error
message.
* In Anabatic::NetBuilder::_do_xG() and all other unimplemented methods,
throw an error if called from a derived classes instead of just
issuing a message in the debug stream. Avoid later core dumps...
* In Anabatic::NetBuilderHV, implement the builders for GCells with
one pin. Needed to support chip/corona routing.
* Bug: In Cumulus/plugins/Chip.py, check that coronaCk exists before
using it.
* New: In Cumulus/plugins/PadsCorona/Side._placePad(), when routing
a design with symbolic pads, export the chip external "pad"
connectors to be able to perform a lvx (otherwise cougar do not
create external nets).
In Corona._createCoreWire(), set the minimal gap between the pads
and the corona to 6 pitches. Empirical value to avoid DRC errors
with symbolic pads (pxlib).
When successufully done, mark the Corona cell as routed.
* Bug: In Cumulus/plugins/Core2Chip.IoNet, the regex for vectorizet net
was wrong, it was allowing only one digit in the index.
* Bug: In Cumulus/plugins/Core2Chip.cmos, correct management of
pad & corona clock nets. Correct connexion between vdde/vddi.
* Bug: In Unicorn/cgt.py, forgot to execute scripts when in text mode.
2019-05-24 16:57:22 -05:00
DirectGetBoolAttribute ( PyCell_isRouted , isRouted , PyCell , Cell )
DirectSetBoolAttribute ( PyCell_setRouted , setRouted , PyCell , Cell )
2008-03-06 10:46:43 -06:00
2008-03-22 08:18:26 -05:00
GetBoundStateAttribute ( PyCell_isPyBound , PyCell , Cell )
2008-03-06 10:46:43 -06:00
// ---------------------------------------------------------------
// PyCell Attribute Method table.
PyMethodDef PyCell_Methods [ ] =
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
{ { " create " , ( PyCFunction ) PyCell_create , METH_VARARGS | METH_STATIC
, " Create a new cell. " }
, { " getLibrary " , ( PyCFunction ) PyCell_getLibrary , METH_NOARGS , " Returns the library owning the cell. " }
2008-03-17 08:54:33 -05:00
, { " getName " , ( PyCFunction ) PyCell_getName , METH_NOARGS , " Returns the name of the cell. " }
, { " getInstance " , ( PyCFunction ) PyCell_getInstance , METH_VARARGS , " Returns the instance of name <name> if it exists, else NULL. " }
2013-04-15 04:51:51 -05:00
, { " getInstances " , ( PyCFunction ) PyCell_getInstances , METH_NOARGS , " Returns the locator of the collection of all instances called by the cell. " } // getInstances
, { " getInstancesUnder " , ( PyCFunction ) PyCell_getInstancesUnder , METH_VARARGS , " Returns the locator of the collection of all instances of the cell intersecting the given rectangular area. " } // getInstancesUnder
, { " getSlaveInstances " , ( PyCFunction ) PyCell_getSlaveInstances , METH_NOARGS , " Returns the locator of the collection of instances whose master is this cell. " } // getSlaveInstances
2013-04-15 05:49:48 -05:00
, { " getComponents " , ( PyCFunction ) PyCell_getComponents , METH_NOARGS , " Returns the collection of all components belonging to the cell. " }
, { " getComponentsUnder " , ( PyCFunction ) PyCell_getComponentsUnder , METH_VARARGS , " Returns the collection of all components belonging to this cell and intersecting the given rectangular area. " }
, { " getOccurrences " , ( PyCFunction ) PyCell_getOccurrences , METH_NOARGS , " Returns the collection of all occurrences belonging to the cell. " }
, { " getOccurrencesUnder " , ( PyCFunction ) PyCell_getOccurrencesUnder , METH_VARARGS , " Returns the collection of all occurrences belonging to this cell and intersecting the given rectangular area. " }
, { " getLeafInstanceOccurrences " , ( PyCFunction ) PyCell_getLeafInstanceOccurrences , METH_NOARGS
2013-04-15 04:51:51 -05:00
, " Returns the collection of all occurrences belonging to the cell. " }
2013-04-15 05:49:48 -05:00
, { " getLeafInstanceOccurrencesUnder " , ( PyCFunction ) PyCell_getLeafInstanceOccurrencesUnder , METH_VARARGS
2013-04-15 04:51:51 -05:00
, " Returns the collection of all occurrences belonging to this cell and intersecting the given rectangular area. " }
, { " getReferences " , ( PyCFunction ) PyCell_getReferences , METH_VARARGS , " Returns the collection of all references belonging to the cell. " }
, { " getHyperNets " , ( PyCFunction ) PyCell_getHyperNets , METH_VARARGS , " Returns the collection of all hyperNets belonging to the cell. " }
2008-03-17 08:54:33 -05:00
, { " getNet " , ( PyCFunction ) PyCell_getNet , METH_VARARGS , " Returns the net of name <name> if it exists, else NULL. " }
2013-04-15 04:51:51 -05:00
, { " getNets " , ( PyCFunction ) PyCell_getNets , METH_NOARGS , " Returns the collection of all nets of the cell. " }
, { " getExternalNets " , ( PyCFunction ) PyCell_getExternalNets , METH_NOARGS , " Returns the collection of all external nets of the cell. " }
, { " getClockNets " , ( PyCFunction ) PyCell_getClockNets , METH_NOARGS , " Returns the collection of all clock nets of the cell. " }
, { " getSupplyNets " , ( PyCFunction ) PyCell_getSupplyNets , METH_NOARGS , " Returns the collection of all supply nets of the cell. " }
, { " getPowerNets " , ( PyCFunction ) PyCell_getPowerNets , METH_NOARGS , " Returns the collection of all power nets of the cell. " }
, { " getGroundNets " , ( PyCFunction ) PyCell_getGroundNets , METH_NOARGS , " Returns the collection of all ground nets of the cell. " }
2008-03-17 08:54:33 -05:00
, { " getAbutmentBox " , ( PyCFunction ) PyCell_getAbutmentBox , METH_NOARGS , " Returns the abutment box of the cell(which is defined by the designer unlike the bounding box which is managed dynamically) " }
2008-03-22 08:18:26 -05:00
, { " isTerminal " , ( PyCFunction ) PyCell_isTerminal , METH_NOARGS , " Returns true if the cell is marked as terminal, else false. " }
, { " isLeaf " , ( PyCFunction ) PyCell_isLeaf , METH_NOARGS , " Returns true if the cell is a leaf of the hierarchy, else false. " }
Merged QuadTrees in overlayed Cells (placed together).
* New: In Hurricane, in Cell & Instance, add the ability to merge the
QuadTree when *second level* instances of a Cell are placed in
the same space as the top Cell. This is the case of a deeply
hierarchical design made of only standard cells that are to
be placed in a "flat" manner.
The design is uniquified then the intermediate instances models,
which should be unique at that point have their QuadTree merged
through a call to Instance::slaveAbutmentBox(). That method will
make the model of the instance use the QuadTree of the Cell to
which the instance belong. The instance model no longer posseses
a dedicated QuadTree. As a corollary the abutment box of both
Cell are kept identical and the Instance has it's transformation
set to (0,0,ID).
Remark: when we talk about "QuadTree", we mean in fact the
QuadTree for the instances *and* the SliceMap (Layer+QuadTree).
Consequence in Query: when going through the resulting
"flattened" QuadTree we will find objects with an incomplete
Path du to the fact that we didn't have to explore their
Instance/Cell level to reach them. The shunted part of the
Path is stored in the Go master Cell in the _shuntedPath
attribute. This also affect the displayed depth of hierarchy,
but not too badly.
* New: In Hurricane, in Cell, new methods:
- Cell::updatePlacedFlag() : set the placement flags.
- Cell::isUnique() : one or less instance.
- Cell::isUniquified() : is the result of an uniquification.
- Cell::isUniquifyMaster() : is the reference cell of the
uniquification.
* Change: In Hurricane, in Cell::Uniquify(), uniquify a Cell only
if it is unplaced. We do not need to duplicate placed Cells
(see datapathes).
2015-06-26 11:35:11 -05:00
, { " isUnique " , ( PyCFunction ) PyCell_isUnique , METH_NOARGS , " Returns true if the cell has one or less instance. " }
, { " isUniquified " , ( PyCFunction ) PyCell_isUniquified , METH_NOARGS , " Returns true if the cell is the result of an uniquification. " }
, { " isUniquifyMaster " , ( PyCFunction ) PyCell_isUniquifyMaster , METH_NOARGS , " Returns true if the cell is the reference for an uniquification. " }
Various bug corrections to pass the alliance-check-toolkit reference benchs.
* New: In Isobar::PyCell, export the isRouted() and setRouted() to the
Python interface.
* Bug: In CRL::Entity::parseEntity(), check that the closing parenthesis
is the last character of the net name. Issue a more relevant error
message.
* In Anabatic::NetBuilder::_do_xG() and all other unimplemented methods,
throw an error if called from a derived classes instead of just
issuing a message in the debug stream. Avoid later core dumps...
* In Anabatic::NetBuilderHV, implement the builders for GCells with
one pin. Needed to support chip/corona routing.
* Bug: In Cumulus/plugins/Chip.py, check that coronaCk exists before
using it.
* New: In Cumulus/plugins/PadsCorona/Side._placePad(), when routing
a design with symbolic pads, export the chip external "pad"
connectors to be able to perform a lvx (otherwise cougar do not
create external nets).
In Corona._createCoreWire(), set the minimal gap between the pads
and the corona to 6 pitches. Empirical value to avoid DRC errors
with symbolic pads (pxlib).
When successufully done, mark the Corona cell as routed.
* Bug: In Cumulus/plugins/Core2Chip.IoNet, the regex for vectorizet net
was wrong, it was allowing only one digit in the index.
* Bug: In Cumulus/plugins/Core2Chip.cmos, correct management of
pad & corona clock nets. Correct connexion between vdde/vddi.
* Bug: In Unicorn/cgt.py, forgot to execute scripts when in text mode.
2019-05-24 16:57:22 -05:00
, { " isRouted " , ( PyCFunction ) PyCell_isRouted , METH_NOARGS , " Returns true if the cell is flagged as routed. " }
Support for Uniquification. Rewrite of the Blif parser.
* New: In Hurricane, In NetAlias & Net, add an AliasList collection to
iterate over all the aliases names (this *not* include the main
net name).
* New: In Hurricane, In Cell, Instance & Net add support for cloning and
uniquification (update documentation).
All Cells that are uniquified from a given model are kept in an
Uniquify relation. This relation allows to get all the clones and
generate unique clone names by adding a "_uXX" suffix.
* Bug: In Hurricane, the Cell::_isFlattenLeaf attribute was not initialized
in the constructor.
* Change: In CRL Core, in AllianceFramework::getCell(), no longer destroy
a partially loaded Cell in case of parser failure, let the incomplete
Cell be.
* New: In CRL Core, in ApParser, if all the instances are placed, sets the
Cell::Placed flag.
* Change: In CRL Core, in BlifParser, complete rewrite of the parser.
Not so good an idea afterwards...
* New: In Etesian, uniquify the design before placing.
* Change: In Kite, display the list of unrouted wired after all other
statistics.
2015-04-25 09:52:18 -05:00
, { " isBound " , ( PyCFunction ) PyCell_isPyBound , METH_NOARGS , " Returns true if the cell is bounded to the hurricane cell " }
2008-03-22 08:18:26 -05:00
, { " setName " , ( PyCFunction ) PyCell_setName , METH_VARARGS , " Allows to change the cell name. " }
, { " setAbutmentBox " , ( PyCFunction ) PyCell_setAbutmentBox , METH_VARARGS , " Sets the cell abutment box. " }
, { " setTerminal " , ( PyCFunction ) PyCell_setTerminal , METH_VARARGS , " Sets the cell terminal status. " }
Various bug corrections to pass the alliance-check-toolkit reference benchs.
* New: In Isobar::PyCell, export the isRouted() and setRouted() to the
Python interface.
* Bug: In CRL::Entity::parseEntity(), check that the closing parenthesis
is the last character of the net name. Issue a more relevant error
message.
* In Anabatic::NetBuilder::_do_xG() and all other unimplemented methods,
throw an error if called from a derived classes instead of just
issuing a message in the debug stream. Avoid later core dumps...
* In Anabatic::NetBuilderHV, implement the builders for GCells with
one pin. Needed to support chip/corona routing.
* Bug: In Cumulus/plugins/Chip.py, check that coronaCk exists before
using it.
* New: In Cumulus/plugins/PadsCorona/Side._placePad(), when routing
a design with symbolic pads, export the chip external "pad"
connectors to be able to perform a lvx (otherwise cougar do not
create external nets).
In Corona._createCoreWire(), set the minimal gap between the pads
and the corona to 6 pitches. Empirical value to avoid DRC errors
with symbolic pads (pxlib).
When successufully done, mark the Corona cell as routed.
* Bug: In Cumulus/plugins/Core2Chip.IoNet, the regex for vectorizet net
was wrong, it was allowing only one digit in the index.
* Bug: In Cumulus/plugins/Core2Chip.cmos, correct management of
pad & corona clock nets. Correct connexion between vdde/vddi.
* Bug: In Unicorn/cgt.py, forgot to execute scripts when in text mode.
2019-05-24 16:57:22 -05:00
, { " setRouted " , ( PyCFunction ) PyCell_setRouted , METH_VARARGS , " Sets the cell routed status. " }
Support for Uniquification. Rewrite of the Blif parser.
* New: In Hurricane, In NetAlias & Net, add an AliasList collection to
iterate over all the aliases names (this *not* include the main
net name).
* New: In Hurricane, In Cell, Instance & Net add support for cloning and
uniquification (update documentation).
All Cells that are uniquified from a given model are kept in an
Uniquify relation. This relation allows to get all the clones and
generate unique clone names by adding a "_uXX" suffix.
* Bug: In Hurricane, the Cell::_isFlattenLeaf attribute was not initialized
in the constructor.
* Change: In CRL Core, in AllianceFramework::getCell(), no longer destroy
a partially loaded Cell in case of parser failure, let the incomplete
Cell be.
* New: In CRL Core, in ApParser, if all the instances are placed, sets the
Cell::Placed flag.
* Change: In CRL Core, in BlifParser, complete rewrite of the parser.
Not so good an idea afterwards...
* New: In Etesian, uniquify the design before placing.
* Change: In Kite, display the list of unrouted wired after all other
statistics.
2015-04-25 09:52:18 -05:00
, { " uniquify " , ( PyCFunction ) PyCell_uniquify , METH_VARARGS , " Uniquify the Cell and it's instances up to <depth>. " }
, { " getClone " , ( PyCFunction ) PyCell_getClone , METH_NOARGS , " Return a copy of the Cell (placement only). " }
2008-03-22 08:18:26 -05:00
, { " destroy " , ( PyCFunction ) PyCell_destroy , METH_NOARGS
2008-03-17 08:54:33 -05:00
, " Destroy associated hurricane object The python object remains. " }
2008-03-06 10:46:43 -06:00
, { NULL , NULL , 0 , NULL } /* sentinel */
} ;
// x-------------------------------------------------------------x
// | "PyCell" Object Methods |
// x-------------------------------------------------------------x
2009-09-30 10:11:49 -05:00
DBoDeleteMethod ( Cell )
PyTypeObjectLinkPyType ( Cell )
# else // End of Python Module Code Part.
// x=================================================================x
// | "PyCell" Shared Library Code Part |
// x=================================================================x
2008-03-06 10:46:43 -06:00
// Link/Creation Method.
2008-10-12 08:37:33 -05:00
DBoLinkCreateMethod ( Cell )
2009-09-30 10:11:49 -05:00
PyTypeInheritedObjectDefinitions ( Cell , Entity )
2008-03-06 10:46:43 -06:00
# endif // End of Shared Library Code Part.
} // End of extern "C".
} // End of Isobar namespace.