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.
|
|
|
|
// Copyright (c) UPMC 2006-2014, 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 ) \
|
|
|
|
{ \
|
|
|
|
trace << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
|
|
|
\
|
|
|
|
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 \
|
|
|
|
\
|
|
|
|
return Py_BuildValue("l",rvalue); \
|
|
|
|
}
|
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 ) \
|
|
|
|
{ \
|
|
|
|
trace << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
|
|
|
\
|
|
|
|
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 ) \
|
|
|
|
{ \
|
|
|
|
trace << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
|
|
|
\
|
|
|
|
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 ) \
|
|
|
|
{ \
|
|
|
|
trace << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
|
|
|
\
|
|
|
|
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 ) \
|
|
|
|
{ \
|
|
|
|
trace << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
|
|
|
\
|
|
|
|
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 ) \
|
|
|
|
{ \
|
|
|
|
trace << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
|
|
|
\
|
|
|
|
HTRY \
|
|
|
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,#SELF_TYPE"."#FUNC_NAME"()") \
|
|
|
|
\
|
|
|
|
long dimension = 0; \
|
|
|
|
\
|
|
|
|
if (PyArg_ParseTuple( args, "l:"#SELF_TYPE"."#FUNC_NAME"()", &dimension)) { \
|
|
|
|
cobject->FUNC_NAME( dimension ); \
|
|
|
|
} 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 ) \
|
|
|
|
{ \
|
|
|
|
trace << #PY_SELF_TYPE "_" #FUNC_NAME "()" << endl; \
|
|
|
|
\
|
|
|
|
HTRY \
|
|
|
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,#SELF_TYPE"."#FUNC_NAME"()") \
|
|
|
|
\
|
|
|
|
PyObject* pyBasicLayer = NULL; \
|
|
|
|
long dimension = 0; \
|
|
|
|
\
|
|
|
|
if (PyArg_ParseTuple( args, "Ol:"#SELF_TYPE"."#FUNC_NAME"()", &pyBasicLayer, &dimension)) { \
|
|
|
|
BasicLayer* layer = PYBASICLAYER_O(pyBasicLayer); \
|
|
|
|
if (layer == NULL) { \
|
|
|
|
PyErr_SetString ( ConstructorError \
|
|
|
|
, #SELF_TYPE"."#FUNC_NAME"(): First parameter is not of BasicLayer type" ); \
|
|
|
|
return NULL; \
|
|
|
|
} \
|
|
|
|
cobject->FUNC_NAME( layer, dimension ); \
|
|
|
|
} 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 ) {
|
2008-03-17 08:54:33 -05:00
|
|
|
trace << "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.
|