Introduce a new parameter to handle uniform density

This commit is contained in:
Gabriel Gouvine 2023-06-10 13:29:56 +02:00
parent 4731e30bb3
commit 052df5d1c8
6 changed files with 52 additions and 18 deletions

View File

@ -20,6 +20,7 @@ param = Cfg.getParamDouble( 'etesian.aspectRatio' )
param.setDouble( 1.0 )
Cfg.getParamDouble ( 'etesian.spaceMargin' ).setPercentage( 0.05 )
Cfg.getParamDouble ( 'etesian.spreadMargin' ).setPercentage( 0.05 )
Cfg.getParamBool ( 'etesian.uniformDensity' ).setBool ( False )
Cfg.getParamBool ( 'etesian.routingDriven' ).setBool ( False )
Cfg.getParamString ( 'etesian.feedNames' ).setString ( 'tie_x0,rowend_x0' )
@ -45,6 +46,7 @@ layout.addTab ( 'Etesian', 'etesian' )
layout.addTitle ( 'Etesian', 'Placement area' )
layout.addParameter( 'Etesian', 'etesian.aspectRatio' , 'Aspect Ratio, X/Y (%)', 0 )
layout.addParameter( 'Etesian', 'etesian.spaceMargin' , 'Space Margin' , 1 )
layout.addParameter( 'Etesian', 'etesian.spreadMargin' , 'Threshold before spreading', 1 )
layout.addRule ( 'Etesian' )
layout.addTitle ( 'Etesian', 'Etesian - Placer')
layout.addParameter( 'Etesian', 'etesian.uniformDensity', 'Uniform density' , 0 )

View File

@ -60,6 +60,7 @@ namespace Etesian {
, _spreadingConf ( Cfg::getParamBool ("etesian.uniformDensity" , false )->asBool()? ForceUniform : MaxDensity )
, _routingDriven ( Cfg::getParamBool ("etesian.routingDriven" , false )->asBool())
, _spaceMargin ( Cfg::getParamPercentage("etesian.spaceMargin" , 5.0)->asDouble() )
, _spreadMargin ( Cfg::getParamPercentage("etesian.spreadMargin" , 5.0)->asDouble() )
, _aspectRatio ( Cfg::getParamPercentage("etesian.aspectRatio" ,100.0)->asDouble() )
, _tieName ( Cfg::getParamString ("etesian.tieName" ,"tie_x0" )->asString() )
, _feedNames ( Cfg::getParamString ("etesian.feedNames" ,"tie_x0,rowend_x0")->asString() )
@ -107,6 +108,7 @@ namespace Etesian {
, _updateConf ( other._updateConf )
, _spreadingConf ( other._spreadingConf )
, _spaceMargin ( other._spaceMargin )
, _spreadMargin ( other._spreadMargin )
, _aspectRatio ( other._aspectRatio )
, _tieName ( other._tieName )
, _feedNames ( other._feedNames )
@ -141,6 +143,7 @@ namespace Etesian {
cmess1 << Dots::asInt (" - Spreading Conf" ,_spreadingConf ) << endl;
cmess1 << Dots::asBool (" - Routing driven" ,_routingDriven ) << endl;
cmess1 << Dots::asPercentage(" - Space Margin" ,_spaceMargin ) << endl;
cmess1 << Dots::asPercentage(" - Spread Margin" ,_spreadMargin ) << endl;
cmess1 << Dots::asPercentage(" - Aspect Ratio" ,_aspectRatio ) << endl;
cmess1 << Dots::asString (" - Bloat model" ,_bloat ) << endl;
cmess1 << Dots::asString (" - Antenna gate Max. WL" ,DbU::getValueString(_antennaGateMaxWL )) << endl;
@ -172,6 +175,7 @@ namespace Etesian {
record->add ( getSlot( "_updateConf" , (int)_updateConf ) );
record->add ( getSlot( "_spreadingConf" , (int)_spreadingConf ) );
record->add ( getSlot( "_spaceMargin" , _spaceMargin ) );
record->add ( getSlot( "_spreadMargin" , _spreadMargin ) );
record->add ( getSlot( "_aspectRatio" , _aspectRatio ) );
record->add ( getSlot( "_tieName" , _tieName ) );
record->add ( getSlot( "_feedNames" , _feedNames ) );

View File

@ -539,7 +539,7 @@ namespace Etesian {
if (masterCell->getAbutmentBox().getHeight() != getSliceHeight()) {
cmess2 << " - Using as block: " << occurrence.getCompactString() << "." << endl;
// TODO: block instances and multi-row cells are manageable in Coloquinte now
cerr << Error( "EtesianEngine::setDefaultAb(): Block instances are not managed, \"%s\"."
, getString(instance->getName()).c_str() ) << endl;
}
@ -710,8 +710,6 @@ namespace Etesian {
DbU::Unit sliceHeight = getSliceHeight();
bool isFlexLib = (getGauge()->getName() == "FlexLib");
// TODO: Density densityConf = getSpreadingConf();
CRL::Histogram stdCellSizes ( 0.0, 1.0, 2 );
stdCellSizes.setTitle ( "Width" , 0 );
stdCellSizes.setColor ( "green" , 0 );
@ -872,27 +870,26 @@ namespace Etesian {
}
}
double spaceMargin = getSpaceMargin();
double spreadMargin = getSpreadMargin();
Density densityConf = getSpreadingConf();
double bloatFactor = 1.0;
if (densityConf == Density::ForceUniform) {
bloatFactor += std::max(spaceMargin - spreadMargin, 0.0);
cmess1 << " - Cells inflated by " << bloatFactor << endl;
}
for ( Occurrence occurrence : getCell()->getTerminalNetlistInstanceOccurrences(getBlockInstance()) )
{
if (instanceId >= instancesNb) {
// This will be an error
++instanceId;
continue;
}
_checkNotAFeed(occurrence);
Instance* instance = static_cast<Instance*>(occurrence.getEntity());
Cell* masterCell = instance->getMasterCell();
if (CatalogExtension::isFeed(masterCell)) {
string feedName = getString( instance->getName() );
if ( (feedName.substr(0,11) != "spare_feed_")
or (not instance->isFixed())) {
string instanceName = occurrence.getCompactString();
// Remove the enclosing brackets...
instanceName.erase( 0, 1 );
instanceName.erase( instanceName.size()-1 );
throw Error( "EtesianEngine::toColoquinte(): Feed instance \"%s\" found."
, instanceName.c_str() );
}
}
stdCellSizes.addSample( (float)(masterCell->getAbutmentBox().getWidth() / hpitch), 0 );
Box instanceAb = _bloatCells.getAb( occurrence );
@ -913,6 +910,9 @@ namespace Etesian {
if (isFlexLib and not instance->isFixed() and (masterName == "buf_x8"))
++xsize;
// Take bloat into account to compute the size
xsize *= bloatFactor;
cellX[instanceId] = xpos;
cellY[instanceId] = ypos;
cellWidth[instanceId] = xsize;
@ -1336,6 +1336,23 @@ namespace Etesian {
return os.str();
}
void EtesianEngine::_checkNotAFeed( Occurrence occurrence ) const {
Instance* instance = static_cast<Instance*>(occurrence.getEntity());
Cell* masterCell = instance->getMasterCell();
if (CatalogExtension::isFeed(masterCell)) {
string feedName = getString( instance->getName() );
if ( (feedName.substr(0,11) != "spare_feed_")
or (not instance->isFixed())) {
string instanceName = occurrence.getCompactString();
// Remove the enclosing brackets...
instanceName.erase( 0, 1 );
instanceName.erase( instanceName.size()-1 );
throw Error( "EtesianEngine::toColoquinte(): Feed instance \"%s\" found."
, instanceName.c_str() );
}
}
}
string EtesianEngine::_getTypeName () const
{ return "Etesian::EtesianEngine"; }

View File

@ -81,6 +81,7 @@ extern "C" {
DirectSetLongAttribute (PyEtesianEngine_setFixedAbHeight,setFixedAbHeight,PyEtesianEngine,EtesianEngine)
DirectSetLongAttribute (PyEtesianEngine_setFixedAbWidth ,setFixedAbWidth ,PyEtesianEngine,EtesianEngine)
DirectSetDoubleAttribute (PyEtesianEngine_setSpaceMargin ,setSpaceMargin ,PyEtesianEngine,EtesianEngine)
DirectSetDoubleAttribute (PyEtesianEngine_setSpreadMargin ,setSpreadMargin ,PyEtesianEngine,EtesianEngine)
DirectSetDoubleAttribute (PyEtesianEngine_setAspectRatio ,setAspectRatio ,PyEtesianEngine,EtesianEngine)
DirectGetLongAttribute (PyEtesianEngine_getFixedAbHeight,getFixedAbHeight,PyEtesianEngine,EtesianEngine)
DirectGetLongAttribute (PyEtesianEngine_getFixedAbWidth ,getFixedAbWidth ,PyEtesianEngine,EtesianEngine)
@ -273,6 +274,8 @@ extern "C" {
, "Use this width when computing the size of the default abutment box (disable aspect ratio)." }
, { "setSpaceMargin" , (PyCFunction)PyEtesianEngine_setSpaceMargin , METH_VARARGS
, "Override the configuration space margin parameter value." }
, { "setSpreadMargin" , (PyCFunction)PyEtesianEngine_setSpreadMargin , METH_VARARGS
, "Override the configuration spread margin parameter value." }
, { "setAspectRatio" , (PyCFunction)PyEtesianEngine_setAspectRatio , METH_VARARGS
, "Override the configuration aspect ratio parameter value." }
, { "resetPlacement" , (PyCFunction)PyEtesianEngine_resetPlacement , METH_NOARGS

View File

@ -66,6 +66,7 @@ namespace Etesian {
inline Density getSpreadingConf () const;
inline bool getRoutingDriven () const;
inline double getSpaceMargin () const;
inline double getSpreadMargin () const;
inline double getAspectRatio () const;
inline string getTieName () const;
inline string getFeedNames () const;
@ -76,6 +77,7 @@ namespace Etesian {
inline DbU::Unit getAntennaGateMaxWL () const;
inline DbU::Unit getAntennaDiodeMaxWL () const;
inline void setSpaceMargin ( double );
inline void setSpreadMargin ( double );
inline void setAspectRatio ( double );
void print ( Cell* ) const;
Record* _getRecord () const;
@ -90,6 +92,7 @@ namespace Etesian {
Density _spreadingConf;
bool _routingDriven;
double _spaceMargin;
double _spreadMargin;
double _aspectRatio;
string _tieName;
string _feedNames;
@ -112,6 +115,7 @@ namespace Etesian {
inline Density Configuration::getSpreadingConf () const { return _spreadingConf; }
inline bool Configuration::getRoutingDriven () const { return _routingDriven; }
inline double Configuration::getSpaceMargin () const { return _spaceMargin; }
inline double Configuration::getSpreadMargin () const { return _spreadMargin; }
inline double Configuration::getAspectRatio () const { return _aspectRatio; }
inline string Configuration::getTieName () const { return _tieName; }
inline string Configuration::getFeedNames () const { return _feedNames; }
@ -122,6 +126,7 @@ namespace Etesian {
inline DbU::Unit Configuration::getAntennaGateMaxWL () const { return _antennaGateMaxWL; }
inline DbU::Unit Configuration::getAntennaDiodeMaxWL () const { return _antennaDiodeMaxWL; }
inline void Configuration::setSpaceMargin ( double margin ) { _spaceMargin = margin; }
inline void Configuration::setSpreadMargin ( double margin ) { _spreadMargin = margin; }
inline void Configuration::setAspectRatio ( double ratio ) { _aspectRatio = ratio; }

View File

@ -92,6 +92,7 @@ namespace Etesian {
inline GraphicUpdate getUpdateConf () const;
inline Density getSpreadingConf () const;
inline double getSpaceMargin () const;
inline double getSpreadMargin () const;
inline double getAspectRatio () const;
inline DbU::Unit getAntennaGateMaxWL () const;
inline DbU::Unit getAntennaDiodeMaxWL () const;
@ -112,6 +113,7 @@ namespace Etesian {
inline void setFixedAbHeight ( DbU::Unit );
inline void setFixedAbWidth ( DbU::Unit );
inline void setSpaceMargin ( double );
inline void setSpreadMargin ( double );
inline void setAspectRatio ( double );
void setDefaultAb ();
void adjustSliceHeight ();
@ -189,8 +191,7 @@ namespace Etesian {
Instance* _createDiode ( Cell* );
void _updatePlacement ( const coloquinte::PlacementSolution*, uint32_t flags=0 );
void _coloquinteCallback(coloquinte::PlacementStep step);
void _progressReport1 ( string label ) const;
void _progressReport2 ( string label ) const;
void _checkNotAFeed ( Occurrence occurrence ) const;
};
@ -209,6 +210,7 @@ namespace Etesian {
inline GraphicUpdate EtesianEngine::getUpdateConf () const { return getConfiguration()->getUpdateConf(); }
inline Density EtesianEngine::getSpreadingConf () const { return getConfiguration()->getSpreadingConf(); }
inline double EtesianEngine::getSpaceMargin () const { return getConfiguration()->getSpaceMargin(); }
inline double EtesianEngine::getSpreadMargin () const { return getConfiguration()->getSpreadMargin(); }
inline double EtesianEngine::getAspectRatio () const { return getConfiguration()->getAspectRatio(); }
inline DbU::Unit EtesianEngine::getAntennaGateMaxWL () const { return getConfiguration()->getAntennaGateMaxWL(); }
inline DbU::Unit EtesianEngine::getAntennaDiodeMaxWL () const { return getConfiguration()->getAntennaDiodeMaxWL(); }
@ -224,6 +226,7 @@ namespace Etesian {
inline void EtesianEngine::setFixedAbHeight ( DbU::Unit abHeight ) { _fixedAbHeight = abHeight; }
inline void EtesianEngine::setFixedAbWidth ( DbU::Unit abWidth ) { _fixedAbWidth = abWidth; }
inline void EtesianEngine::setSpaceMargin ( double margin ) { getConfiguration()->setSpaceMargin(margin); }
inline void EtesianEngine::setSpreadMargin ( double margin ) { getConfiguration()->setSpreadMargin(margin); }
inline void EtesianEngine::setAspectRatio ( double ratio ) { getConfiguration()->setAspectRatio(ratio); }
inline DbU::Unit EtesianEngine::toDbU ( int64_t v ) const { return v*getSliceStep(); }
inline uint32_t EtesianEngine::_getNewDiodeId () { return _diodeCount++; }