Add a new RoutingLayerGauge type "PowerSupply".
* New: In CRL::RoutingLayerGauge, add a new kind of gauge "PowerSupply" to flag a layer which is dedicated to routing power supplies. * New: In AllianceFramework, add management of PowerSupply gauge kind. Exported in the Python interface.
This commit is contained in:
parent
a6492f6edc
commit
63a03bf11b
|
@ -126,6 +126,19 @@ namespace CRL {
|
||||||
{ return (getLayerGauge(layer) != NULL) or (getViaDepth(layer) != nlayerdepth); }
|
{ return (getLayerGauge(layer) != NULL) or (getViaDepth(layer) != nlayerdepth); }
|
||||||
|
|
||||||
|
|
||||||
|
RoutingLayerGauge* RoutingGauge::getPowerSupplyGauge () const
|
||||||
|
{
|
||||||
|
size_t i = _layerGauges.size();
|
||||||
|
if (i == 0) return NULL;
|
||||||
|
do {
|
||||||
|
--i;
|
||||||
|
if (_layerGauges[i]->getType() == Constant::PowerSupply)
|
||||||
|
return _layerGauges[i];
|
||||||
|
} while ( i > 0);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
RoutingLayerGauge* RoutingGauge::getHorizontalGauge () const
|
RoutingLayerGauge* RoutingGauge::getHorizontalGauge () const
|
||||||
{
|
{
|
||||||
RoutingLayerGauge* pinOnly = NULL;
|
RoutingLayerGauge* pinOnly = NULL;
|
||||||
|
|
|
@ -58,6 +58,7 @@ namespace CRL {
|
||||||
inline bool isTwoMetals () const;
|
inline bool isTwoMetals () const;
|
||||||
inline bool isHV () const;
|
inline bool isHV () const;
|
||||||
inline bool isVH () const;
|
inline bool isVH () const;
|
||||||
|
inline bool hasPowerSupply () const;
|
||||||
bool hasLayer ( const Layer* ) const;
|
bool hasLayer ( const Layer* ) const;
|
||||||
// Accessors.
|
// Accessors.
|
||||||
RoutingGauge* getClone () const;
|
RoutingGauge* getClone () const;
|
||||||
|
@ -68,6 +69,7 @@ namespace CRL {
|
||||||
inline DbU::Unit getVerticalPitch () const;
|
inline DbU::Unit getVerticalPitch () const;
|
||||||
RoutingLayerGauge* getHorizontalGauge () const;
|
RoutingLayerGauge* getHorizontalGauge () const;
|
||||||
RoutingLayerGauge* getVerticalGauge () const;
|
RoutingLayerGauge* getVerticalGauge () const;
|
||||||
|
RoutingLayerGauge* getPowerSupplyGauge () const;
|
||||||
RoutingLayerGauge* getLayerGauge ( const Layer* ) const;
|
RoutingLayerGauge* getLayerGauge ( const Layer* ) const;
|
||||||
size_t getViaDepth ( const Layer* ) const;
|
size_t getViaDepth ( const Layer* ) const;
|
||||||
size_t getLayerDepth ( const Layer* ) const;
|
size_t getLayerDepth ( const Layer* ) const;
|
||||||
|
@ -121,6 +123,7 @@ namespace CRL {
|
||||||
inline bool RoutingGauge::isTwoMetals () const { return (getDepth() < 3); }
|
inline bool RoutingGauge::isTwoMetals () const { return (getDepth() < 3); }
|
||||||
inline bool RoutingGauge::isHV () const { return not isTwoMetals() and (getLayerGauge(1)->isHorizontal()); }
|
inline bool RoutingGauge::isHV () const { return not isTwoMetals() and (getLayerGauge(1)->isHorizontal()); }
|
||||||
inline bool RoutingGauge::isVH () const { return not isTwoMetals() and (getLayerGauge(1)->isVertical()); }
|
inline bool RoutingGauge::isVH () const { return not isTwoMetals() and (getLayerGauge(1)->isVertical()); }
|
||||||
|
inline bool RoutingGauge::hasPowerSupply () const { return (getPowerSupplyGauge() != NULL); }
|
||||||
inline const Name RoutingGauge::getName () const { return _name; }
|
inline const Name RoutingGauge::getName () const { return _name; }
|
||||||
inline size_t RoutingGauge::getDepth () const { return _layerGauges.size(); }
|
inline size_t RoutingGauge::getDepth () const { return _layerGauges.size(); }
|
||||||
inline Technology* RoutingGauge::getTechnology () const { return _technology; }
|
inline Technology* RoutingGauge::getTechnology () const { return _technology; }
|
||||||
|
|
|
@ -14,10 +14,7 @@
|
||||||
// +-----------------------------------------------------------------+
|
// +-----------------------------------------------------------------+
|
||||||
|
|
||||||
|
|
||||||
#ifndef CRL_ROUTING_LAYER_GAUGE_H
|
#pragma once
|
||||||
#define CRL_ROUTING_LAYER_GAUGE_H
|
|
||||||
|
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include "hurricane/Commons.h"
|
#include "hurricane/Commons.h"
|
||||||
#include "hurricane/Error.h"
|
#include "hurricane/Error.h"
|
||||||
|
@ -39,6 +36,7 @@ namespace Constant {
|
||||||
|
|
||||||
enum LayerGaugeType { Default = (1<<0)
|
enum LayerGaugeType { Default = (1<<0)
|
||||||
, PinOnly = (1<<1)
|
, PinOnly = (1<<1)
|
||||||
|
, PowerSupply = (1<<2)
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Round { Superior = (1<<2)
|
enum Round { Superior = (1<<2)
|
||||||
|
@ -279,6 +277,7 @@ inline std::string getString<const Constant::LayerGaugeType*>
|
||||||
switch ( *layerGaugeType ) {
|
switch ( *layerGaugeType ) {
|
||||||
case Constant::Default: return "Default";
|
case Constant::Default: return "Default";
|
||||||
case Constant::PinOnly: return "PinOnly";
|
case Constant::PinOnly: return "PinOnly";
|
||||||
|
case Constant::PowerSupply: return "PowerSupply";
|
||||||
}
|
}
|
||||||
return "Unknown Constant::LayerGaugeType";
|
return "Unknown Constant::LayerGaugeType";
|
||||||
}
|
}
|
||||||
|
@ -297,6 +296,7 @@ inline std::string getString<const Constant::LayerGaugeType>
|
||||||
switch ( layerGaugeType ) {
|
switch ( layerGaugeType ) {
|
||||||
case Constant::Default: return "Default";
|
case Constant::Default: return "Default";
|
||||||
case Constant::PinOnly: return "PinOnly";
|
case Constant::PinOnly: return "PinOnly";
|
||||||
|
case Constant::PowerSupply: return "PowerSupply";
|
||||||
}
|
}
|
||||||
return "Unknown Constant::LayerGaugeType";
|
return "Unknown Constant::LayerGaugeType";
|
||||||
}
|
}
|
||||||
|
@ -309,6 +309,3 @@ inline std::string getString<Constant::LayerGaugeType>
|
||||||
|
|
||||||
|
|
||||||
IOSTREAM_POINTER_SUPPORT(Constant::LayerGaugeType);
|
IOSTREAM_POINTER_SUPPORT(Constant::LayerGaugeType);
|
||||||
|
|
||||||
|
|
||||||
#endif // CRL_ROUTING_LAYER_GAUGE_H
|
|
||||||
|
|
|
@ -212,6 +212,7 @@ extern "C" {
|
||||||
|
|
||||||
PyCatalog_postModuleInit ();
|
PyCatalog_postModuleInit ();
|
||||||
PyEnvironment_postModuleInit ();
|
PyEnvironment_postModuleInit ();
|
||||||
|
PyRoutingGauge_postModuleInit ();
|
||||||
PyRoutingLayerGauge_postModuleInit ();
|
PyRoutingLayerGauge_postModuleInit ();
|
||||||
PyAllianceFramework_postModuleInit ();
|
PyAllianceFramework_postModuleInit ();
|
||||||
|
|
||||||
|
|
|
@ -402,6 +402,19 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject* PyRoutingGauge_getPowerSupplyGauge ( PyRoutingGauge* self )
|
||||||
|
{
|
||||||
|
cdebug_log(30,0) << "PyRoutingGauge_getPowerSupplyGauge()" << endl;
|
||||||
|
RoutingLayerGauge* rlg = NULL;
|
||||||
|
HTRY
|
||||||
|
METHOD_HEAD("RoutingGauge.getPowerSupplyGauge()")
|
||||||
|
rlg = rg->getPowerSupplyGauge();
|
||||||
|
if (not rlg) Py_RETURN_NONE;
|
||||||
|
HCATCH
|
||||||
|
return PyRoutingLayerGauge_Link( rlg );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static PyObject* PyRoutingGauge_getRoutingLayer ( PyRoutingGauge* self, PyObject* args )
|
static PyObject* PyRoutingGauge_getRoutingLayer ( PyRoutingGauge* self, PyObject* args )
|
||||||
{
|
{
|
||||||
cdebug_log(30,0) << "PyRoutingGauge_getRoutingLayer()" << endl;
|
cdebug_log(30,0) << "PyRoutingGauge_getRoutingLayer()" << endl;
|
||||||
|
@ -494,6 +507,7 @@ extern "C" {
|
||||||
DirectSetBoolAttribute(PyRoutingGauge_setSymbolic ,setSymbolic ,PyRoutingGauge,RoutingGauge)
|
DirectSetBoolAttribute(PyRoutingGauge_setSymbolic ,setSymbolic ,PyRoutingGauge,RoutingGauge)
|
||||||
DirectGetBoolAttribute(PyRoutingGauge_isHV ,isHV ,PyRoutingGauge,RoutingGauge)
|
DirectGetBoolAttribute(PyRoutingGauge_isHV ,isHV ,PyRoutingGauge,RoutingGauge)
|
||||||
DirectGetBoolAttribute(PyRoutingGauge_isVH ,isVH ,PyRoutingGauge,RoutingGauge)
|
DirectGetBoolAttribute(PyRoutingGauge_isVH ,isVH ,PyRoutingGauge,RoutingGauge)
|
||||||
|
DirectGetBoolAttribute(PyRoutingGauge_hasPowerSupply,hasPowerSupply,PyRoutingGauge,RoutingGauge)
|
||||||
|
|
||||||
|
|
||||||
// Standart Destroy (Attribute).
|
// Standart Destroy (Attribute).
|
||||||
|
@ -508,6 +522,8 @@ extern "C" {
|
||||||
, "The first routing layer (metal2) is horizontal." }
|
, "The first routing layer (metal2) is horizontal." }
|
||||||
, { "isVH" , (PyCFunction)PyRoutingGauge_isVH , METH_NOARGS
|
, { "isVH" , (PyCFunction)PyRoutingGauge_isVH , METH_NOARGS
|
||||||
, "The first routing layer (metal2) is vertical." }
|
, "The first routing layer (metal2) is vertical." }
|
||||||
|
, { "hasPowerSupply" , (PyCFunction)PyRoutingGauge_hasPowerSupply , METH_NOARGS
|
||||||
|
, "Is there a dedicated layer for power supplies." }
|
||||||
, { "getName" , (PyCFunction)PyRoutingGauge_getName , METH_NOARGS
|
, { "getName" , (PyCFunction)PyRoutingGauge_getName , METH_NOARGS
|
||||||
, "Return the maximum depth of the RoutingGauge." }
|
, "Return the maximum depth of the RoutingGauge." }
|
||||||
, { "getTechnology" , (PyCFunction)PyRoutingGauge_getTechnology , METH_NOARGS
|
, { "getTechnology" , (PyCFunction)PyRoutingGauge_getTechnology , METH_NOARGS
|
||||||
|
@ -528,6 +544,8 @@ extern "C" {
|
||||||
, "Return the default wire width of the given layer." }
|
, "Return the default wire width of the given layer." }
|
||||||
, { "getViaWidth" , (PyCFunction)PyRoutingGauge_getViaWidth , METH_VARARGS
|
, { "getViaWidth" , (PyCFunction)PyRoutingGauge_getViaWidth , METH_VARARGS
|
||||||
, "Return the default via width of the given layer." }
|
, "Return the default via width of the given layer." }
|
||||||
|
, { "getPowerSupplyGauge" , (PyCFunction)PyRoutingGauge_getPowerSupplyGauge, METH_NOARGS
|
||||||
|
, "Return the power supply gauge (None if there isn't)." }
|
||||||
, { "getLayerGauge" , (PyCFunction)PyRoutingGauge_getLayerGauge , METH_VARARGS
|
, { "getLayerGauge" , (PyCFunction)PyRoutingGauge_getLayerGauge , METH_VARARGS
|
||||||
, "Return the RoutingLayerGauge of the given layer/depth." }
|
, "Return the RoutingLayerGauge of the given layer/depth." }
|
||||||
, { "getLayerDirection" , (PyCFunction)PyRoutingGauge_getLayerDirection , METH_VARARGS
|
, { "getLayerDirection" , (PyCFunction)PyRoutingGauge_getLayerDirection , METH_VARARGS
|
||||||
|
@ -558,6 +576,14 @@ extern "C" {
|
||||||
VectorMethods (RoutingLayerGauge)
|
VectorMethods (RoutingLayerGauge)
|
||||||
|
|
||||||
|
|
||||||
|
extern void PyRoutingGauge_postModuleInit ()
|
||||||
|
{
|
||||||
|
PyObject* constant;
|
||||||
|
|
||||||
|
LoadObjectConstant(PyTypeRoutingGauge.tp_dict,RoutingGauge::nlayerdepth,"nlayerdepth");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#else // End of Python Module Code Part.
|
#else // End of Python Module Code Part.
|
||||||
|
|
||||||
// +=================================================================+
|
// +=================================================================+
|
||||||
|
|
|
@ -108,7 +108,8 @@ extern "C" {
|
||||||
}
|
}
|
||||||
switch( type ) {
|
switch( type ) {
|
||||||
case Constant::Default:
|
case Constant::Default:
|
||||||
case Constant::PinOnly: break;
|
case Constant::PinOnly:
|
||||||
|
case Constant::PowerSupply: break;
|
||||||
default:
|
default:
|
||||||
PyErr_SetString ( ConstructorError, "Bad value for type argument of RoutingLayerGauge.create()." );
|
PyErr_SetString ( ConstructorError, "Bad value for type argument of RoutingLayerGauge.create()." );
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -351,6 +352,7 @@ extern "C" {
|
||||||
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::Vertical ,"Vertical" );
|
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::Vertical ,"Vertical" );
|
||||||
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::Default ,"Default" );
|
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::Default ,"Default" );
|
||||||
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::PinOnly ,"PinOnly" );
|
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::PinOnly ,"PinOnly" );
|
||||||
|
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::PowerSupply,"PowerSupply" );
|
||||||
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::Superior ,"Superior" );
|
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::Superior ,"Superior" );
|
||||||
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::Inferior ,"Inferior" );
|
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::Inferior ,"Inferior" );
|
||||||
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::Nearest ,"Nearest" );
|
LoadObjectConstant(PyTypeRoutingLayerGauge.tp_dict,Constant::Nearest ,"Nearest" );
|
||||||
|
|
|
@ -15,9 +15,7 @@
|
||||||
// +-----------------------------------------------------------------+
|
// +-----------------------------------------------------------------+
|
||||||
|
|
||||||
|
|
||||||
#ifndef __CRL_PY_ROUTINGGAUGE__
|
#pragma once
|
||||||
#define __CRL_PY_ROUTINGGAUGE__
|
|
||||||
|
|
||||||
#include "hurricane/isobar/PyHurricane.h"
|
#include "hurricane/isobar/PyHurricane.h"
|
||||||
#include "crlcore/RoutingGauge.h"
|
#include "crlcore/RoutingGauge.h"
|
||||||
|
|
||||||
|
@ -63,6 +61,3 @@ declareVectorObject(RoutingLayerGauge);
|
||||||
|
|
||||||
|
|
||||||
} // Hurricane namespace.
|
} // Hurricane namespace.
|
||||||
|
|
||||||
|
|
||||||
#endif // __CRL_PY_ROUTINGGAUGE__
|
|
||||||
|
|
Loading…
Reference in New Issue