2012-11-16 06:48:38 -06:00
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
Complete replacement of the Chip placement Python scripts.
Finally get rid of the demonic code from Wu Yifei...
* New: In Isobar, added encapsulation of Interval (don't know how have
forgotten it for so long).
* Change: In Isobar, In PyLayer, new PyLink_LayerDerived() function to
create/link the C++ object to the correct derived class and not the
base one (PyLayer) which then prevent to use the specialized methods.
Must replace PyLink_Layer() througout all the code.
* Change: In Isobar, in PyPoint the "setX()" & "setY()" methods where
still capitalized.
* Change: In Isobar, in PyQuery, complete the exportation of the C++
interface. remove the code belonging to a more "boost" way of
building the Python interface (will do that in a far future).
* New: In CRL Core, In PyAllianceFramework, export isPad() method.
* Change: In Unicorn, in unicornInit.py, protect the loading of each
single plugin by a "try" / "except" clause to the failing of one
plugins do not stop the loading of the next one.
Pass the same dictionnary argument to unicornHook() as for
ScripMain(), this is more uniform this way.
* New: In Cumulus, complete replacement of the chip placement scripts
from Wu Yifei (at last!). The clock-tree integration is still to
be done.
________________________________________________________________________
2014-07-21 06:18:34 -05:00
|
|
|
// This file is part of the Coriolis Software.
|
2016-01-20 17:41:19 -06:00
|
|
|
// Copyright (c) UPMC 2006-2016, All Rights Reserved
|
2012-11-16 06:48:38 -06: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 |
|
|
|
|
// | |
|
2012-11-16 06:48:38 -06:00
|
|
|
// | Author : Jean-Paul Chaput |
|
|
|
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
2008-03-06 10:46:43 -06:00
|
|
|
// | =============================================================== |
|
2012-11-16 06:48:38 -06:00
|
|
|
// | C++ Module : "./PyLayer.cpp" |
|
|
|
|
// +-----------------------------------------------------------------+
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
2008-05-21 17:46:29 -05:00
|
|
|
#include "hurricane/isobar/PyTechnology.h"
|
2012-11-16 06:48:38 -06:00
|
|
|
#include "hurricane/isobar/PyLayer.h"
|
|
|
|
#include "hurricane/isobar/PyLayerMask.h"
|
|
|
|
#include "hurricane/isobar/PyBasicLayer.h"
|
Complete replacement of the Chip placement Python scripts.
Finally get rid of the demonic code from Wu Yifei...
* New: In Isobar, added encapsulation of Interval (don't know how have
forgotten it for so long).
* Change: In Isobar, In PyLayer, new PyLink_LayerDerived() function to
create/link the C++ object to the correct derived class and not the
base one (PyLayer) which then prevent to use the specialized methods.
Must replace PyLink_Layer() througout all the code.
* Change: In Isobar, in PyPoint the "setX()" & "setY()" methods where
still capitalized.
* Change: In Isobar, in PyQuery, complete the exportation of the C++
interface. remove the code belonging to a more "boost" way of
building the Python interface (will do that in a far future).
* New: In CRL Core, In PyAllianceFramework, export isPad() method.
* Change: In Unicorn, in unicornInit.py, protect the loading of each
single plugin by a "try" / "except" clause to the failing of one
plugins do not stop the loading of the next one.
Pass the same dictionnary argument to unicornHook() as for
ScripMain(), this is more uniform this way.
* New: In Cumulus, complete replacement of the chip placement scripts
from Wu Yifei (at last!). The clock-tree integration is still to
be done.
________________________________________________________________________
2014-07-21 06:18:34 -05:00
|
|
|
#include "hurricane/isobar/PyRegularLayer.h"
|
|
|
|
#include "hurricane/isobar/PyContactLayer.h"
|
|
|
|
#include "hurricane/isobar/PyViaLayer.h"
|
|
|
|
#include "hurricane/isobar/PyDiffusionLayer.h"
|
|
|
|
#include "hurricane/isobar/PyTransistorLayer.h"
|
2012-11-16 06:48:38 -06:00
|
|
|
#include "hurricane/isobar/PyBasicLayerCollection.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" {
|
|
|
|
|
|
|
|
|
|
|
|
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(Layer,layer,function)
|
|
|
|
|
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
// +=================================================================+
|
2008-03-06 10:46:43 -06:00
|
|
|
// | "PyLayer" Python Module Code Part |
|
2012-11-16 06:48:38 -06:00
|
|
|
// +=================================================================+
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
#if defined(__PYTHON_MODULE__)
|
|
|
|
|
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
// +-------------------------------------------------------------+
|
2008-03-06 10:46:43 -06:00
|
|
|
// | "PyLayer" Attribute Methods |
|
2012-11-16 06:48:38 -06:00
|
|
|
// +-------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
# define accessorDbuFromOptBasicLayer(FUNC_NAME,PY_SELF_TYPE,SELF_TYPE) \
|
|
|
|
static PyObject* PY_SELF_TYPE##_##FUNC_NAME ( PY_SELF_TYPE* self, PyObject* args ) \
|
|
|
|
{ \
|
2016-06-11 14:56:12 -05:00
|
|
|
cdebug_log(20,0) << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
2012-11-16 06:48:38 -06:00
|
|
|
\
|
|
|
|
DbU::Unit rvalue = 0; \
|
|
|
|
\
|
|
|
|
HTRY \
|
|
|
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,#SELF_TYPE"."#FUNC_NAME"()") \
|
|
|
|
\
|
|
|
|
PyObject* arg0 = NULL; \
|
|
|
|
\
|
|
|
|
__cs.init (#SELF_TYPE"."#FUNC_NAME"()"); \
|
|
|
|
if (PyArg_ParseTuple( args, "|O&:"#SELF_TYPE"."#FUNC_NAME"()", Converter, &arg0)) { \
|
|
|
|
if ( __cs.getObjectIds() == ":basiclayer" ) \
|
|
|
|
rvalue = cobject->FUNC_NAME( PYBASICLAYER_O(arg0) ); \
|
|
|
|
else if ( __cs.getObjectIds() == "" ) \
|
|
|
|
rvalue = cobject->FUNC_NAME(); \
|
|
|
|
else { \
|
|
|
|
PyErr_SetString ( ConstructorError \
|
|
|
|
, "invalid parameter type for "#SELF_TYPE"."#FUNC_NAME"()." ); \
|
|
|
|
return NULL; \
|
|
|
|
} \
|
|
|
|
} else { \
|
|
|
|
PyErr_SetString ( ConstructorError \
|
|
|
|
, "Invalid number of parameters passed to "#SELF_TYPE"."#FUNC_NAME"()." ); \
|
|
|
|
return NULL; \
|
|
|
|
} \
|
|
|
|
HCATCH \
|
|
|
|
\
|
Correction in plugins to support msxlib compatible pads.
* New: In CRL Core, in helpers & alliance.conf, set and read a "PAD"
variable to define the pad model name extension ("px" for "sxlib
and "pxr" for vsxlib, this is provisional).
* New: In CRL Core, in plugin.conf, add parameters to define the name
of used for power & clock supply. We may remove the extention in
the future (to be more coherent with the previous modification).
* New: In Cumulus, in chip.Configuration.GaugeConf._rpAccess(), no
longer place the accessing contact *at the center* of the
RoutingPad. It works under sxlib because buffers & registers all
have same size terminals. But this is not true under vsxlib,
leading to misaligned contacts & wires. Now systematically place
on the slice midlle track (maybe with one pitch above or below).
This is still very weak as we do not check if the terminal
reach were the contact is being put. Has to be strenthened in
the future.
* New: In Cumulus, in chip.Configuration.ChipConf, read the new
clock & power pad parameters.
* Change: In Isobar (and all other Python wrappers), uses PyLong instead
of PyInt for DbU conversions. In PyHurricane argument converter,
automatically check for both PyLong and then PyInt.
* Change: In Cumulus, in chip.PadsCorona, more accurate error message
in case of discrepency in global net connections (i.e. no net
of the same name in instance model and instance model owner.
* Change: In Kite, in BuildPowerRails, when looking up at the pads
model name to find "pck_" or "pvddeck_", do not compare the
extension part. But we still use hard-coded stem pad names,
maybe we shouldn't.
* Bug: In Katabatic, in GCellConfiguration::_do_xG_xM1_xM3(), there
was a loop in the search of the best N/E initial RoutingPad.
* Bug: In Kite, in KiteEngine::protectRoutingPads(), *do not* protect
RoutingPads of fixed nets, they are already through the
BuildPowerRails stage (and it's causing scary overlap warning
messages).
* Bug: In Cumulus, in ClockTree.HTreeNode.addLeaf(), do not create
deep-plug when the core is flat (not sub-modules). All the new
nets are at core level.
* Bug: In Cumulus, in ChipPlugin.PlaceCore.doFloorplan(), ensure
that the core is aligned on the GCell grid (i.e. the slice
grid of the overall chip).
* Bug: In Kite, in GCellTopology::_do_xG_xM1_xM3(), infinite loop
while looking for the bigger N-E RoutingPad. Forgot to decrement
the index...
2014-09-13 10:45:30 -05:00
|
|
|
return PyLong_FromLong(rvalue); \
|
2012-11-16 06:48:38 -06:00
|
|
|
}
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
# define accessorLayerFromLayer(FUNC_NAME,PY_SELF_TYPE,SELF_TYPE) \
|
|
|
|
static PyObject* PY_SELF_TYPE##_##FUNC_NAME ( PY_SELF_TYPE* self, PyObject* args ) \
|
|
|
|
{ \
|
2016-06-11 14:56:12 -05:00
|
|
|
cdebug_log(20,0) << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
2012-11-16 06:48:38 -06:00
|
|
|
\
|
|
|
|
Layer* rlayer = 0; \
|
|
|
|
\
|
|
|
|
HTRY \
|
|
|
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,#SELF_TYPE"."#FUNC_NAME"()") \
|
|
|
|
\
|
|
|
|
PyObject* arg0 = NULL; \
|
|
|
|
\
|
|
|
|
if (PyArg_ParseTuple( args, "O:"#SELF_TYPE"."#FUNC_NAME"()", &arg0)) { \
|
|
|
|
Layer* argLayer = PYLAYER_O(arg0); \
|
|
|
|
if (argLayer == NULL) { \
|
|
|
|
PyErr_SetString ( ConstructorError \
|
|
|
|
, #SELF_TYPE"."#FUNC_NAME"(): Parameter is not of Layer type" ); \
|
|
|
|
return NULL; \
|
|
|
|
} \
|
|
|
|
rlayer = const_cast<Layer*>(cobject->FUNC_NAME( argLayer )); \
|
|
|
|
} else { \
|
|
|
|
PyErr_SetString ( ConstructorError \
|
|
|
|
, #SELF_TYPE"."#FUNC_NAME"(): Parameter is not of Layer type" ); \
|
|
|
|
return NULL; \
|
|
|
|
} \
|
|
|
|
HCATCH \
|
|
|
|
\
|
Complete replacement of the Chip placement Python scripts.
Finally get rid of the demonic code from Wu Yifei...
* New: In Isobar, added encapsulation of Interval (don't know how have
forgotten it for so long).
* Change: In Isobar, In PyLayer, new PyLink_LayerDerived() function to
create/link the C++ object to the correct derived class and not the
base one (PyLayer) which then prevent to use the specialized methods.
Must replace PyLink_Layer() througout all the code.
* Change: In Isobar, in PyPoint the "setX()" & "setY()" methods where
still capitalized.
* Change: In Isobar, in PyQuery, complete the exportation of the C++
interface. remove the code belonging to a more "boost" way of
building the Python interface (will do that in a far future).
* New: In CRL Core, In PyAllianceFramework, export isPad() method.
* Change: In Unicorn, in unicornInit.py, protect the loading of each
single plugin by a "try" / "except" clause to the failing of one
plugins do not stop the loading of the next one.
Pass the same dictionnary argument to unicornHook() as for
ScripMain(), this is more uniform this way.
* New: In Cumulus, complete replacement of the chip placement scripts
from Wu Yifei (at last!). The clock-tree integration is still to
be done.
________________________________________________________________________
2014-07-21 06:18:34 -05:00
|
|
|
return PyLayer_LinkDerived(rlayer); \
|
2012-11-16 06:48:38 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# define accessorMaskFromVoid(FUNC_NAME,PY_SELF_TYPE,SELF_TYPE) \
|
|
|
|
static PyObject* PY_SELF_TYPE##_##FUNC_NAME ( PY_SELF_TYPE* self ) \
|
|
|
|
{ \
|
2016-06-11 14:56:12 -05:00
|
|
|
cdebug_log(20,0) << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
2012-11-16 06:48:38 -06:00
|
|
|
\
|
|
|
|
Layer::Mask mask = 0; \
|
|
|
|
\
|
|
|
|
HTRY \
|
|
|
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,#SELF_TYPE"."#FUNC_NAME"()") \
|
|
|
|
mask = cobject->FUNC_NAME(); \
|
|
|
|
HCATCH \
|
|
|
|
\
|
|
|
|
return PyLayerMask_Link(mask); \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# define accessorLayerFromOptBool(FUNC_NAME,PY_SELF_TYPE,SELF_TYPE) \
|
|
|
|
static PyObject* PY_SELF_TYPE##_##FUNC_NAME ( PY_SELF_TYPE* self, PyObject* args ) \
|
|
|
|
{ \
|
2016-06-11 14:56:12 -05:00
|
|
|
cdebug_log(20,0) << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
2012-11-16 06:48:38 -06:00
|
|
|
\
|
|
|
|
Layer* rlayer = NULL; \
|
|
|
|
\
|
|
|
|
HTRY \
|
|
|
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,#SELF_TYPE"."#FUNC_NAME"()") \
|
|
|
|
\
|
|
|
|
PyObject* arg0 = NULL; \
|
|
|
|
bool useWorking = true; \
|
|
|
|
\
|
|
|
|
if (PyArg_ParseTuple( args, "|O:"#SELF_TYPE"."#FUNC_NAME"()", &arg0)) { \
|
|
|
|
if (arg0 != NULL) { \
|
|
|
|
useWorking = PyObject_IsTrue(arg0); \
|
|
|
|
} \
|
|
|
|
} else { \
|
|
|
|
PyErr_SetString ( ConstructorError \
|
|
|
|
, "Invalid number of parameters passed to "#SELF_TYPE"."#FUNC_NAME"()." ); \
|
|
|
|
return NULL; \
|
|
|
|
} \
|
|
|
|
rlayer = const_cast<SELF_TYPE*>(cobject->FUNC_NAME(useWorking)); \
|
|
|
|
HCATCH \
|
|
|
|
\
|
|
|
|
if (rlayer == NULL) Py_RETURN_NONE; \
|
Complete replacement of the Chip placement Python scripts.
Finally get rid of the demonic code from Wu Yifei...
* New: In Isobar, added encapsulation of Interval (don't know how have
forgotten it for so long).
* Change: In Isobar, In PyLayer, new PyLink_LayerDerived() function to
create/link the C++ object to the correct derived class and not the
base one (PyLayer) which then prevent to use the specialized methods.
Must replace PyLink_Layer() througout all the code.
* Change: In Isobar, in PyPoint the "setX()" & "setY()" methods where
still capitalized.
* Change: In Isobar, in PyQuery, complete the exportation of the C++
interface. remove the code belonging to a more "boost" way of
building the Python interface (will do that in a far future).
* New: In CRL Core, In PyAllianceFramework, export isPad() method.
* Change: In Unicorn, in unicornInit.py, protect the loading of each
single plugin by a "try" / "except" clause to the failing of one
plugins do not stop the loading of the next one.
Pass the same dictionnary argument to unicornHook() as for
ScripMain(), this is more uniform this way.
* New: In Cumulus, complete replacement of the chip placement scripts
from Wu Yifei (at last!). The clock-tree integration is still to
be done.
________________________________________________________________________
2014-07-21 06:18:34 -05:00
|
|
|
return PyLayer_LinkDerived(rlayer); \
|
2012-11-16 06:48:38 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# define predicateFromVoid(FUNC_NAME,PY_SELF_TYPE,SELF_TYPE) \
|
|
|
|
static PyObject* PY_SELF_TYPE##_##FUNC_NAME ( PY_SELF_TYPE* self ) \
|
|
|
|
{ \
|
2016-06-11 14:56:12 -05:00
|
|
|
cdebug_log(20,0) << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
2012-11-16 06:48:38 -06:00
|
|
|
\
|
|
|
|
HTRY \
|
|
|
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,#SELF_TYPE"."#FUNC_NAME"()") \
|
|
|
|
if (cobject->FUNC_NAME()) Py_RETURN_TRUE; \
|
|
|
|
HCATCH \
|
|
|
|
\
|
|
|
|
Py_RETURN_FALSE; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# define updatorFromDbu(FUNC_NAME,PY_SELF_TYPE,SELF_TYPE) \
|
|
|
|
static PyObject* PY_SELF_TYPE##_##FUNC_NAME ( PY_SELF_TYPE* self, PyObject* args ) \
|
|
|
|
{ \
|
2016-11-30 14:50:25 -06:00
|
|
|
cdebug_log(20,0) << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
2012-11-16 06:48:38 -06:00
|
|
|
\
|
|
|
|
HTRY \
|
|
|
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,#SELF_TYPE"."#FUNC_NAME"()") \
|
|
|
|
\
|
2016-11-30 14:50:25 -06:00
|
|
|
PyObject* pyDimension = NULL; \
|
2012-11-16 06:48:38 -06:00
|
|
|
\
|
2016-11-30 14:50:25 -06:00
|
|
|
if (PyArg_ParseTuple( args, "O:"#SELF_TYPE"."#FUNC_NAME"()", &pyDimension)) { \
|
|
|
|
cobject->FUNC_NAME( PyAny_AsLong(pyDimension) ); \
|
2012-11-16 06:48:38 -06:00
|
|
|
} else { \
|
|
|
|
PyErr_SetString ( ConstructorError \
|
|
|
|
, #SELF_TYPE"."#FUNC_NAME"(): Parameter is not of long (DbU) type" ); \
|
|
|
|
return NULL; \
|
|
|
|
} \
|
|
|
|
HCATCH \
|
|
|
|
\
|
|
|
|
Py_RETURN_NONE; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# define updatorFromBasicLayerDbu(FUNC_NAME,PY_SELF_TYPE,SELF_TYPE) \
|
|
|
|
static PyObject* PY_SELF_TYPE##_##FUNC_NAME ( PY_SELF_TYPE* self, PyObject* args ) \
|
|
|
|
{ \
|
2016-06-11 14:56:12 -05:00
|
|
|
cdebug_log(20,0) << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
2012-11-16 06:48:38 -06:00
|
|
|
\
|
|
|
|
HTRY \
|
|
|
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,#SELF_TYPE"."#FUNC_NAME"()") \
|
|
|
|
\
|
|
|
|
PyObject* pyBasicLayer = NULL; \
|
2016-11-30 14:50:25 -06:00
|
|
|
PyObject* pyDimension = NULL; \
|
2012-11-16 06:48:38 -06:00
|
|
|
\
|
2016-11-30 14:50:25 -06:00
|
|
|
if (PyArg_ParseTuple( args, "OO:"#SELF_TYPE"."#FUNC_NAME"()", &pyBasicLayer, &pyDimension)) { \
|
2012-11-16 06:48:38 -06:00
|
|
|
BasicLayer* layer = PYBASICLAYER_O(pyBasicLayer); \
|
|
|
|
if (layer == NULL) { \
|
|
|
|
PyErr_SetString ( ConstructorError \
|
|
|
|
, #SELF_TYPE"."#FUNC_NAME"(): First parameter is not of BasicLayer type" ); \
|
|
|
|
return NULL; \
|
|
|
|
} \
|
2016-11-30 14:50:25 -06:00
|
|
|
cobject->FUNC_NAME( layer, PyAny_AsLong(pyDimension) ); \
|
2012-11-16 06:48:38 -06:00
|
|
|
} else { \
|
|
|
|
PyErr_SetString ( ConstructorError \
|
|
|
|
, #SELF_TYPE"."#FUNC_NAME"(): Bad parameters types or numbers." ); \
|
|
|
|
return NULL; \
|
|
|
|
} \
|
|
|
|
HCATCH \
|
|
|
|
\
|
|
|
|
Py_RETURN_NONE; \
|
|
|
|
}
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
2009-01-22 05:37:42 -06:00
|
|
|
static PyObject* PyLayer_getTechnology ( PyLayer *self ) {
|
2016-06-11 14:56:12 -05:00
|
|
|
cdebug_log(20,0) << "PyLayer_getTechnology ()" << endl;
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
Technology* techno = NULL;
|
|
|
|
|
|
|
|
HTRY
|
2008-03-17 08:54:33 -05:00
|
|
|
METHOD_HEAD ( "Layer.getTechnology()" )
|
|
|
|
techno = layer->getTechnology ();
|
2008-03-06 10:46:43 -06:00
|
|
|
HCATCH
|
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
return PyTechnology_Link(techno);
|
2008-03-06 10:46:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
GetNameMethod (Layer, layer)
|
|
|
|
predicateFromLayer ( above ,PyLayer,Layer)
|
|
|
|
predicateFromLayer ( below ,PyLayer,Layer)
|
|
|
|
predicateFromLayer ( contains ,PyLayer,Layer)
|
|
|
|
predicateFromLayer ( intersect ,PyLayer,Layer)
|
|
|
|
predicateFromVoid ( isWorking ,PyLayer,Layer)
|
|
|
|
accessorDbuFromOptBasicLayer( getEnclosure ,PyLayer,Layer)
|
|
|
|
accessorDbuFromOptBasicLayer( getExtentionCap ,PyLayer,Layer)
|
|
|
|
accessorDbuFromOptBasicLayer( getExtentionWidth,PyLayer,Layer)
|
|
|
|
accessorCollectionFromVoid ( getBasicLayers ,PyLayer,Layer,BasicLayer)
|
|
|
|
accessorMaskFromVoid ( getMask ,PyLayer,Layer)
|
|
|
|
accessorMaskFromVoid ( getExtractMask ,PyLayer,Layer)
|
|
|
|
accessorLayerFromVoid ( getBlockageLayer ,PyLayer,Layer)
|
|
|
|
accessorLayerFromVoid ( getTop ,PyLayer,Layer)
|
|
|
|
accessorLayerFromVoid ( getBottom ,PyLayer,Layer)
|
|
|
|
accessorLayerFromLayer ( getOpposite ,PyLayer,Layer)
|
|
|
|
accessorLayerFromOptBool ( getMetalAbove ,PyLayer,Layer)
|
|
|
|
accessorLayerFromOptBool ( getMetalBelow ,PyLayer,Layer)
|
|
|
|
accessorLayerFromOptBool ( getCutAbove ,PyLayer,Layer)
|
|
|
|
accessorLayerFromOptBool ( getCutBelow ,PyLayer,Layer)
|
|
|
|
DirectGetLongAttribute (PyLayer_getMinimalSize ,getMinimalSize ,PyLayer,Layer)
|
|
|
|
DirectGetLongAttribute (PyLayer_getMinimalSpacing,getMinimalSpacing,PyLayer,Layer)
|
2008-03-06 10:46:43 -06:00
|
|
|
|
2008-12-11 06:25:02 -06:00
|
|
|
SetNameMethod(Layer, layer)
|
2012-11-16 06:48:38 -06:00
|
|
|
updatorFromDbu (setMinimalSize ,PyLayer,Layer)
|
|
|
|
updatorFromDbu (setMinimalSpacing,PyLayer,Layer)
|
|
|
|
updatorFromBasicLayerDbu(setEnclosure ,PyLayer,Layer)
|
|
|
|
updatorFromBasicLayerDbu(setExtentionCap ,PyLayer,Layer)
|
|
|
|
updatorFromBasicLayerDbu(setExtentionWidth,PyLayer,Layer)
|
|
|
|
|
|
|
|
// Standart destroy (Attribute).
|
|
|
|
DBoDestroyAttribute(PyLayer_destroy, PyLayer)
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
|
|
|
PyMethodDef PyLayer_Methods[] =
|
2012-11-16 06:48:38 -06:00
|
|
|
{ { "getTechnology" , (PyCFunction)PyLayer_getTechnology , METH_NOARGS
|
|
|
|
, "Returns the technology owning the layer." }
|
|
|
|
, { "getName" , (PyCFunction)PyLayer_getName , METH_NOARGS
|
|
|
|
, "Returns the name of the layer." }
|
|
|
|
, { "getMask" , (PyCFunction)PyLayer_getMask , METH_NOARGS
|
|
|
|
, "Returns the mask (bits) of the layer." }
|
|
|
|
, { "getExtractMask" , (PyCFunction)PyLayer_getExtractMask , METH_NOARGS
|
|
|
|
, "Returns the extract mask of the layer (for GDSII)." }
|
|
|
|
, { "getMinimalSize" , (PyCFunction)PyLayer_getMinimalSize , METH_NOARGS
|
|
|
|
, "Returns the minimum width allowed for the layer." }
|
|
|
|
, { "getMinimalSpacing" , (PyCFunction)PyLayer_getMinimalSpacing , METH_NOARGS
|
|
|
|
, "Returns the spacing allowed for the layer (edge to edge)." }
|
|
|
|
, { "getBasicLayers" , (PyCFunction)PyLayer_getBasicLayers , METH_NOARGS
|
|
|
|
, "Returns the collection of BasicLayer the Layer is built upon." }
|
|
|
|
, { "getBlockageLayer" , (PyCFunction)PyLayer_getBlockageLayer , METH_NOARGS
|
|
|
|
, "Returns the associated connector layer." }
|
|
|
|
, { "getTop" , (PyCFunction)PyLayer_getTop , METH_NOARGS
|
|
|
|
, "Returns the top layer (in case of a muti-layer)." }
|
|
|
|
, { "getBottom" , (PyCFunction)PyLayer_getBottom , METH_NOARGS
|
|
|
|
, "Returns the bottom layer (in case of a muti-layer)." }
|
|
|
|
, { "getOpposite" , (PyCFunction)PyLayer_getOpposite , METH_VARARGS
|
|
|
|
, "Returns the layer opposite the one given." }
|
|
|
|
, { "getMetalAbove" , (PyCFunction)PyLayer_getMetalAbove , METH_VARARGS
|
|
|
|
, "Returns the metal layer above this one." }
|
|
|
|
, { "getMetalBelow" , (PyCFunction)PyLayer_getMetalBelow , METH_VARARGS
|
|
|
|
, "Returns the metal layer below this one." }
|
|
|
|
, { "getCutAbove" , (PyCFunction)PyLayer_getCutAbove , METH_VARARGS
|
|
|
|
, "Returns the cut layer above this one." }
|
|
|
|
, { "getCutBelow" , (PyCFunction)PyLayer_getCutBelow , METH_VARARGS
|
|
|
|
, "Returns the cut layer below this one." }
|
|
|
|
, { "getEnclosure" , (PyCFunction)PyLayer_getEnclosure , METH_VARARGS
|
|
|
|
, "Returns the enclosure (global or for one BasicLayer)." }
|
|
|
|
, { "getExtentionCap" , (PyCFunction)PyLayer_getExtentionCap , METH_VARARGS
|
|
|
|
, "Returns the extention cap (global or for one BasicLayer)." }
|
|
|
|
, { "getExtentionWidth" , (PyCFunction)PyLayer_getExtentionWidth , METH_VARARGS
|
|
|
|
, "Returns the extention width (global or for one BasicLayer)." }
|
|
|
|
, { "above" , (PyCFunction)PyLayer_above , METH_VARARGS
|
|
|
|
, "Tells if the layer is above the one passed as argument." }
|
|
|
|
, { "below" , (PyCFunction)PyLayer_below , METH_VARARGS
|
|
|
|
, "Tells if the layer is below the one passed as argument." }
|
|
|
|
, { "contains" , (PyCFunction)PyLayer_contains , METH_VARARGS
|
|
|
|
, "Tells if the layer fully contains the one passed as argument." }
|
|
|
|
, { "intersect" , (PyCFunction)PyLayer_intersect , METH_VARARGS
|
|
|
|
, "Tells if the layer share some BasicLayer with the one passed as argument." }
|
|
|
|
, { "isWorking" , (PyCFunction)PyLayer_isWorking , METH_NOARGS
|
|
|
|
, "Tells if the layer is the working one for this BasicLayer." }
|
|
|
|
, { "setName" , (PyCFunction)PyLayer_setName , METH_VARARGS
|
|
|
|
, "Allows to change the layer name." }
|
|
|
|
, { "setWorking" , (PyCFunction)PyLayer_setName , METH_VARARGS
|
|
|
|
, "Sets the layer as the working one." }
|
|
|
|
, { "setMinimalSize" , (PyCFunction)PyLayer_setMinimalSize , METH_VARARGS
|
|
|
|
, "Sets the layer minimal size (width)." }
|
|
|
|
, { "setMinimalSpacing" , (PyCFunction)PyLayer_setMinimalSpacing , METH_VARARGS
|
|
|
|
, "Sets the layer minimal spacing (edge to edge)." }
|
|
|
|
, { "setEnclosure" , (PyCFunction)PyLayer_setEnclosure , METH_VARARGS
|
|
|
|
, "Sets the enclosure for the given BasicLayer sub-component." }
|
|
|
|
, { "setExtentionCap" , (PyCFunction)PyLayer_setExtentionCap , METH_VARARGS
|
|
|
|
, "Sets the extention cap for the given BasiLayer sub-component." }
|
|
|
|
, { "setExtentionWidth" , (PyCFunction)PyLayer_setExtentionWidth , METH_VARARGS
|
|
|
|
, "Sets the extention width for the given BasiLayer sub-component." }
|
2008-03-17 08:54:33 -05:00
|
|
|
, { "destroy" , (PyCFunction)PyLayer_destroy , METH_NOARGS
|
|
|
|
, "Destroy associated hurricane object The python object remains." }
|
2012-11-16 06:48:38 -06:00
|
|
|
, {NULL, NULL, 0, NULL} /* sentinel */
|
2008-03-06 10:46:43 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
// ---------------------------------------------------------------
|
|
|
|
// PyLayer Type Methods.
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
|
|
|
DBoDeleteMethod(Layer)
|
|
|
|
PyTypeObjectLinkPyType(Layer)
|
|
|
|
|
|
|
|
|
|
|
|
#else // End of Python Module Code Part.
|
|
|
|
|
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
// +=================================================================+
|
2008-03-06 10:46:43 -06:00
|
|
|
// | "PyLayer" Shared Library Code Part |
|
2012-11-16 06:48:38 -06:00
|
|
|
// +=================================================================+
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
// Link/Creation Method.
|
2008-10-12 08:37:33 -05:00
|
|
|
DBoLinkCreateMethod(Layer)
|
2008-03-06 10:46:43 -06:00
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
PyTypeRootObjectDefinitions(Layer)
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
extern void PyLayer_postModuleInit ()
|
|
|
|
{
|
|
|
|
PyDict_SetItemString ( PyTypeLayer.tp_dict, "Mask", (PyObject*)&PyTypeLayerMask );
|
|
|
|
}
|
2008-03-06 10:46:43 -06:00
|
|
|
|
|
|
|
|
Complete replacement of the Chip placement Python scripts.
Finally get rid of the demonic code from Wu Yifei...
* New: In Isobar, added encapsulation of Interval (don't know how have
forgotten it for so long).
* Change: In Isobar, In PyLayer, new PyLink_LayerDerived() function to
create/link the C++ object to the correct derived class and not the
base one (PyLayer) which then prevent to use the specialized methods.
Must replace PyLink_Layer() througout all the code.
* Change: In Isobar, in PyPoint the "setX()" & "setY()" methods where
still capitalized.
* Change: In Isobar, in PyQuery, complete the exportation of the C++
interface. remove the code belonging to a more "boost" way of
building the Python interface (will do that in a far future).
* New: In CRL Core, In PyAllianceFramework, export isPad() method.
* Change: In Unicorn, in unicornInit.py, protect the loading of each
single plugin by a "try" / "except" clause to the failing of one
plugins do not stop the loading of the next one.
Pass the same dictionnary argument to unicornHook() as for
ScripMain(), this is more uniform this way.
* New: In Cumulus, complete replacement of the chip placement scripts
from Wu Yifei (at last!). The clock-tree integration is still to
be done.
________________________________________________________________________
2014-07-21 06:18:34 -05:00
|
|
|
extern PyObject* PyLayer_LinkDerived ( Layer* object )
|
|
|
|
{
|
|
|
|
if (object == NULL) Py_RETURN_NONE;
|
|
|
|
|
|
|
|
BasicLayer* basicLayer = dynamic_cast<BasicLayer*>(object);
|
|
|
|
if (basicLayer) return PyBasicLayer_Link(basicLayer);
|
|
|
|
|
|
|
|
ContactLayer* contactLayer = dynamic_cast<ContactLayer*>(object);
|
|
|
|
if (contactLayer) return PyContactLayer_Link(contactLayer);
|
|
|
|
|
|
|
|
ViaLayer* viaLayer = dynamic_cast<ViaLayer*>(object);
|
|
|
|
if (viaLayer) return PyViaLayer_Link(viaLayer);
|
|
|
|
|
|
|
|
DiffusionLayer* diffusionLayer = dynamic_cast<DiffusionLayer*>(object);
|
|
|
|
if (diffusionLayer) return PyDiffusionLayer_Link(diffusionLayer);
|
|
|
|
|
|
|
|
RegularLayer* regularLayer = dynamic_cast<RegularLayer*>(object);
|
|
|
|
if (regularLayer) return PyRegularLayer_Link(regularLayer);
|
|
|
|
|
|
|
|
TransistorLayer* transistorLayer = dynamic_cast<TransistorLayer*>(object);
|
|
|
|
if (transistorLayer) return PyTransistorLayer_Link(transistorLayer);
|
|
|
|
|
|
|
|
Py_RETURN_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-03-06 10:46:43 -06:00
|
|
|
#endif // End of Shared Library Code Part.
|
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
} // extern "C".
|
2008-03-06 10:46:43 -06:00
|
|
|
|
2012-11-16 06:48:38 -06:00
|
|
|
} // Isobar namespace.
|