From 809a91c9c1672ef4ec057296385c57508d4747da Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 18 Aug 2017 18:16:43 +0200 Subject: [PATCH] Added Routing Gauge for 2-Metal technologies only. * New: In CRL Core, etc/cmos/kite.conf new routing gauge "sxlib-2M" for two metals only technologies. * New: In CRL Core, python/helpers/kite.py, new parameter to set the routing gauge to be used: "kite.routingGauge" (default: "sxlib"). * Change: In CRL/AllianceFramework.cpp, forgot to put the Cell gauges and RoutingGauges in the object Records (Inspector). * New: In pyCRL/PyAllianceFramework.cpp, export the setRoutingGauge() function. --- crlcore/etc/cmos/kite.conf | 6 ++++ crlcore/python/helpers/kite.py | 3 ++ crlcore/src/ccore/AllianceFramework.cpp | 8 ++--- crlcore/src/ccore/crlcore/AllianceFramework.h | 28 ++++++++-------- crlcore/src/ccore/crlcore/RoutingLayerGauge.h | 32 +++++++++++-------- crlcore/src/pyCRL/PyAllianceFramework.cpp | 25 +++++++++++++++ 6 files changed, 69 insertions(+), 33 deletions(-) diff --git a/crlcore/etc/cmos/kite.conf b/crlcore/etc/cmos/kite.conf index f746b1e1..39606153 100644 --- a/crlcore/etc/cmos/kite.conf +++ b/crlcore/etc/cmos/kite.conf @@ -11,6 +11,7 @@ parametersTable = \ , ("katabatic.saturateRatio" ,TypePercentage,80 ) , ("katabatic.saturateRp" ,TypeInt ,8 ) , ('katabatic.topRoutingLayer' ,TypeString , 'METAL5') + , ('anabatic.routingGauge' ,TypeString , 'sxlib' ) # Kite parameters. , ("kite.hTracksReservedLocal" ,TypeInt ,3 , { 'min':0, 'max':20 } ) , ("kite.vTracksReservedLocal" ,TypeInt ,3 , { 'min':0, 'max':20 } ) @@ -48,6 +49,11 @@ routingGaugesTable['sxlib'] = \ #, ( 'METAL7', ( Gauge.Vertical , Gauge.Default, 6, 0.0, 0, 5, 2, 1, 4 ) ) ) +routingGaugesTable['sxlib-2M'] = \ + ( ( 'METAL1', ( Gauge.Horizontal, Gauge.Default, 0, 0.0, 0, 5, 2, 1, 4 ) ) + , ( 'METAL2', ( Gauge.Vertical , Gauge.Default, 1, 0.0, 0, 5, 2, 1, 4 ) ) + ) + # Format of cellGaugesTable (dictionary): # A list of entry of the form: diff --git a/crlcore/python/helpers/kite.py b/crlcore/python/helpers/kite.py index 3e150e61..60f9291e 100644 --- a/crlcore/python/helpers/kite.py +++ b/crlcore/python/helpers/kite.py @@ -9,6 +9,9 @@ Cfg.getParamPercentage("katabatic.saturateRatio" ).setPercentage(80 ) Cfg.getParamInt ("katabatic.saturateRp" ).setInt (8 ) Cfg.getParamInt ("kite.borderRipupLimit" ).setInt (26 ) +# Alliance parameters. +Cfg.getParamString ("kite.routingGauge" ).setString ('sxlib') + # Kite parameters. Cfg.getParamPercentage("kite.edgeCapacity" ).setPercentage(65 ) Cfg.getParamPercentage("kite.edgeCapacity" ).setMin (0 ) diff --git a/crlcore/src/ccore/AllianceFramework.cpp b/crlcore/src/ccore/AllianceFramework.cpp index f7701e36..65ec28b8 100644 --- a/crlcore/src/ccore/AllianceFramework.cpp +++ b/crlcore/src/ccore/AllianceFramework.cpp @@ -692,7 +692,7 @@ namespace CRL { { if ( name.isEmpty() ) return _defaultRoutingGauge; - map::iterator igauge = _routingGauges.find ( name ); + map::iterator igauge = _routingGauges.find ( name ); if ( igauge != _routingGauges.end() ) return igauge->second; @@ -735,7 +735,7 @@ namespace CRL { { if ( name.isEmpty() ) return _defaultCellGauge; - map::iterator igauge = _cellGauges.find ( name ); + map::iterator igauge = _cellGauges.find ( name ); if ( igauge != _cellGauges.end() ) return igauge->second; @@ -796,9 +796,9 @@ namespace CRL { record->add ( getSlot ( "_libraries" , &_libraries ) ); record->add ( getSlot ( "_catalog" , &_catalog ) ); record->add ( getSlot ( "_defaultRoutingGauge", _defaultRoutingGauge ) ); - record->add ( getSlot ( "_routingGauges" , _routingGauges ) ); + record->add ( getSlot ( "_routingGauges" , &_routingGauges ) ); record->add ( getSlot ( "_defaultCellGauge" , _defaultCellGauge ) ); - record->add ( getSlot ( "_cellGauges" , _cellGauges ) ); + record->add ( getSlot ( "_cellGauges" , &_cellGauges ) ); return record; } diff --git a/crlcore/src/ccore/crlcore/AllianceFramework.h b/crlcore/src/ccore/crlcore/AllianceFramework.h index d30eda09..9639aee8 100644 --- a/crlcore/src/ccore/crlcore/AllianceFramework.h +++ b/crlcore/src/ccore/crlcore/AllianceFramework.h @@ -123,21 +123,19 @@ namespace CRL { // Internals - Attributes. protected: - static const Name _parentLibraryName; - static AllianceFramework* _singleton; - Observable _observers; - Environment _environment; - ParsersMap _parsers; - DriversMap _drivers; - Catalog _catalog; - AllianceLibraries _libraries; - Library* _parentLibrary; - map - _routingGauges; - RoutingGauge* _defaultRoutingGauge; - map - _cellGauges; - CellGauge* _defaultCellGauge; + static const Name _parentLibraryName; + static AllianceFramework* _singleton; + Observable _observers; + Environment _environment; + ParsersMap _parsers; + DriversMap _drivers; + Catalog _catalog; + AllianceLibraries _libraries; + Library* _parentLibrary; + map _routingGauges; + RoutingGauge* _defaultRoutingGauge; + map _cellGauges; + CellGauge* _defaultCellGauge; // Internals - Constructors. AllianceFramework (); diff --git a/crlcore/src/ccore/crlcore/RoutingLayerGauge.h b/crlcore/src/ccore/crlcore/RoutingLayerGauge.h index b3c10386..8287ec3f 100644 --- a/crlcore/src/ccore/crlcore/RoutingLayerGauge.h +++ b/crlcore/src/ccore/crlcore/RoutingLayerGauge.h @@ -90,6 +90,8 @@ namespace CRL { , DbU::Unit obsDw ); virtual void destroy (); // Accessors. + inline bool isHorizontal () const; + inline bool isVertical () const; inline const Layer* getLayer () const; inline const Layer* getBlockageLayer () const; inline unsigned int getDepth () const; @@ -163,20 +165,22 @@ namespace CRL { // ------------------------------------------------------------------- // Inline Functions. - inline const Layer* RoutingLayerGauge::getLayer () const { return ( _layer ); } - inline const Layer* RoutingLayerGauge::getBlockageLayer () const { return ( _blockageLayer ); } - inline Constant::Direction RoutingLayerGauge::getDirection () const { return ( _direction ); } - inline Constant::LayerGaugeType RoutingLayerGauge::getType () const { return ( _type ); } - inline unsigned int RoutingLayerGauge::getDepth () const { return ( _depth ); } - inline double RoutingLayerGauge::getDensity () const { return ( _density ); } - inline DbU::Unit RoutingLayerGauge::getOffset () const { return ( _offset ); } - inline DbU::Unit RoutingLayerGauge::getPitch () const { return ( _pitch ); } - inline DbU::Unit RoutingLayerGauge::getHalfPitch () const { return ( _pitch>>1 ); } - inline DbU::Unit RoutingLayerGauge::getWireWidth () const { return ( _wireWidth ); } - inline DbU::Unit RoutingLayerGauge::getHalfWireWidth () const { return ( _wireWidth>>1 ); } - inline DbU::Unit RoutingLayerGauge::getViaWidth () const { return ( _viaWidth ); } - inline DbU::Unit RoutingLayerGauge::getHalfViaWidth () const { return ( _viaWidth>>1 ); } - inline DbU::Unit RoutingLayerGauge::getObstacleDw () const { return ( _obstacleDw ); } + inline bool RoutingLayerGauge::isHorizontal () const { return (_direction == Constant::Direction::Horizontal); } + inline bool RoutingLayerGauge::isVertical () const { return (_direction == Constant::Direction::Vertical); } + inline const Layer* RoutingLayerGauge::getLayer () const { return _layer; } + inline const Layer* RoutingLayerGauge::getBlockageLayer () const { return _blockageLayer; } + inline Constant::Direction RoutingLayerGauge::getDirection () const { return _direction; } + inline Constant::LayerGaugeType RoutingLayerGauge::getType () const { return _type; } + inline unsigned int RoutingLayerGauge::getDepth () const { return _depth; } + inline double RoutingLayerGauge::getDensity () const { return _density; } + inline DbU::Unit RoutingLayerGauge::getOffset () const { return _offset; } + inline DbU::Unit RoutingLayerGauge::getPitch () const { return _pitch; } + inline DbU::Unit RoutingLayerGauge::getHalfPitch () const { return _pitch>>1; } + inline DbU::Unit RoutingLayerGauge::getWireWidth () const { return _wireWidth; } + inline DbU::Unit RoutingLayerGauge::getHalfWireWidth () const { return _wireWidth>>1; } + inline DbU::Unit RoutingLayerGauge::getViaWidth () const { return _viaWidth; } + inline DbU::Unit RoutingLayerGauge::getHalfViaWidth () const { return _viaWidth>>1; } + inline DbU::Unit RoutingLayerGauge::getObstacleDw () const { return _obstacleDw; } // ------------------------------------------------------------------- diff --git a/crlcore/src/pyCRL/PyAllianceFramework.cpp b/crlcore/src/pyCRL/PyAllianceFramework.cpp index 85d3bc9e..dfdaeab3 100644 --- a/crlcore/src/pyCRL/PyAllianceFramework.cpp +++ b/crlcore/src/pyCRL/PyAllianceFramework.cpp @@ -363,6 +363,29 @@ extern "C" { } + static PyObject* PyAllianceFramework_setRoutingGauge ( PyAllianceFramework* self, PyObject* args ) + { + cdebug_log(30,0) << "PyAllianceFramework_setRoutingGauge()" << endl; + + HTRY + METHOD_HEAD("AllianceFramework.setRoutingGauge()") + PyObject* arg0; + __cs.init ("AllianceFramework.setRoutingGauge"); + if (not PyArg_ParseTuple( args, "O&:AllianceFramework.setRoutingGauge", Converter, &arg0 )) { + PyErr_SetString( ConstructorError, "Invalid number of parameters for AllianceFramework.setRoutingGauge()." ); + return NULL; + } + if (__cs.getObjectIds() == ":string") af->setRoutingGauge( Name(PyString_AsString(arg0)) ); + else { + PyErr_SetString( ConstructorError, "Bad parameter type for AllianceFramework.setRoutingGauge()." ); + return NULL; + } + HCATCH + + Py_RETURN_NONE; + } + + static PyObject* PyAllianceFramework_addCellGauge ( PyAllianceFramework* self, PyObject* args ) { cdebug_log(30,0) << "PyAllianceFramework_addCellGauge ()" << endl; @@ -470,6 +493,8 @@ extern "C" { , "Add a new routing gauge." } , { "getRoutingGauge" , (PyCFunction)PyAllianceFramework_getRoutingGauge , METH_VARARGS , "Get a routing gauge (whithout a name, return the default)." } + , { "setRoutingGauge" , (PyCFunction)PyAllianceFramework_setRoutingGauge , METH_VARARGS + , "Select the default routing gauge." } //, { "destroy" , (PyCFunction)PyAllianceFramework_destroy , METH_NOARGS // , "Destroy the associated hurricane object. The python object remains." } , {NULL, NULL, 0, NULL} /* sentinel */