From 23975c541de26c3e520ebb7c21d9bbcd169886cf Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 8 Jun 2023 18:45:19 +0200 Subject: [PATCH] Remove unused datastructures in EtesianEngine --- etesian/src/EtesianEngine.cpp | 86 ++++++++--------------------- etesian/src/etesian/EtesianEngine.h | 9 +-- 2 files changed, 25 insertions(+), 70 deletions(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index aa234684..a476b160 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -317,11 +317,8 @@ namespace Etesian { , _circuit (NULL) , _placementLB (NULL) , _placementUB (NULL) - //, _densityLimits(NULL) - , _netsToIds () , _instsToIds () , _idsToInsts () - , _idsToNets () , _viewer (NULL) , _diodeCell (NULL) , _feedCells (this) @@ -456,10 +453,6 @@ namespace Etesian { delete _circuit; delete _placementLB; delete _placementUB; - //delete _densityLimits; - - NetsToIds emptyNetsToIds; - _netsToIds.swap( emptyNetsToIds ); InstancesToIds emptyInstsToIds; _instsToIds.swap( emptyInstsToIds ); @@ -467,14 +460,10 @@ namespace Etesian { vector emptyIdsToInsts; _idsToInsts.swap( emptyIdsToInsts ); - vector emptyIdsToNets; - _idsToNets.swap( emptyIdsToNets ); - _surface = NULL; _circuit = NULL; _placementLB = NULL; _placementUB = NULL; - //_densityLimits = NULL; _diodeCount = 0; } @@ -721,6 +710,8 @@ 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 ); @@ -794,18 +785,18 @@ namespace Etesian { Instance* instance = static_cast(occurrence.getEntity()); Box instanceAb = instance->getAbutmentBox(); string masterName = getString( instance->getMasterCell()->getName() ); + DbU::Unit length = (instanceAb.getHeight()/sliceHeight) * instanceAb.getWidth(); if (af->isRegister(masterName)) { ++registerNb; - registerLength += instanceAb.getWidth(); + registerLength += length; } if (instance->getPlacementStatus() == Instance::PlacementStatus::FIXED) { ++fixedNb; - totalLength -= (instanceAb.getHeight()/sliceHeight) * instanceAb.getWidth(); + totalLength -= length; } else if (instance->getPlacementStatus() == Instance::PlacementStatus::PLACED) { cerr << "PLACED " << instance << endl; } else { - usedLength += (instanceAb.getHeight()/sliceHeight) * instanceAb.getWidth(); - //cerr << DbU::getValueString(usedLength) << " " << instance << endl; + usedLength += length; } } if (instancesNb <= fixedNb) { @@ -819,19 +810,6 @@ namespace Etesian { cmess1 << ::Dots::asPercentage( " - Effective space margin" , (float)(totalLength-usedLength)/(float)totalLength ) << endl; - // Coloquinte circuit description data-structures. - // One dummy fixed instance at the end - - _circuit = new coloquinte::Circuit( instancesNb+1 ); - vector cellX( instancesNb+1 ); - vector cellY( instancesNb+1 ); - vector orient( instancesNb+1 ); - vector cellWidth( instancesNb+1 ); - vector cellHeight( instancesNb+1 ); - vector cellIsFixed( instancesNb+1 ); - vector cellIsObstruction( instancesNb+1 ); - vector cellRowPolarity( instancesNb+1, coloquinte::CellRowPolarity::SAME ); - cmess1 << ::Dots::asUInt( " - Number of instances ", instancesNb ) << endl; if (instancesNb) { float ratio = ((float)registerNb / (float)instancesNb) * 100.0; @@ -847,6 +825,19 @@ namespace Etesian { } cout.flush(); + // Coloquinte circuit description data-structures. + // One dummy fixed instance at the end + + _circuit = new coloquinte::Circuit( instancesNb+1 ); + vector cellX( instancesNb+1 ); + vector cellY( instancesNb+1 ); + vector orient( instancesNb+1 ); + vector cellWidth( instancesNb+1 ); + vector cellHeight( instancesNb+1 ); + vector cellIsFixed( instancesNb+1 ); + vector cellIsObstruction( instancesNb+1 ); + vector cellRowPolarity( instancesNb+1, coloquinte::CellRowPolarity::SAME ); + cmess1 << " - Building RoutingPads (transhierarchical)" << endl; //getCell()->flattenNets( Cell::Flags::BuildRings|Cell::Flags::NoClockFlatten ); //getCell()->flattenNets( getBlockInstance(), Cell::Flags::NoClockFlatten ); @@ -1018,9 +1009,6 @@ namespace Etesian { cmess1 << " - Converting " << netsNb << " nets" << endl; - _idsToNets.resize( netsNb ); - - unsigned int netId = 0; for ( Net* net : getCell()->getNets() ) { const char* excludedType = NULL; @@ -1032,9 +1020,6 @@ namespace Etesian { if (af->isBLOCKAGE(net->getName())) continue; dots.dot(); - - _netsToIds.insert( make_pair(net,netId) ); - _idsToNets[netId] = make_tuple( net, _instsToIds.size(), 0 ); string topCellInstancePin = getString(getCell()->getName()) + ":C"; vector netCells, pinX, pinY; @@ -1089,19 +1074,9 @@ namespace Etesian { pinX.push_back(xpin); pinY.push_back(ypin); netCells.push_back((*iid).second); - Net* rpNet = NULL; - Plug* plug = dynamic_cast( rp->getPlugOccurrence().getEntity() ); - if (plug) { - rpNet = plug->getMasterNet(); - if (rpNet->getDirection() & Net::Direction::DirOut) { - std::get<1>( _idsToNets[netId] ) = (*iid).second; - } - } } } _circuit->addNet(netCells, pinX, pinY); - - netId++; } dots.finish( Dots::Reset ); @@ -1182,7 +1157,7 @@ namespace Etesian { } } - void EtesianEngine::globalPlace ( unsigned options ) + void EtesianEngine::globalPlace () { coloquinte::ColoquinteParameters params(getPlaceEffort()); coloquinte::PlacementCallback callback =std::bind(&EtesianEngine::_coloquinteCallback, this, std::placeholders::_1); @@ -1192,7 +1167,7 @@ namespace Etesian { } - void EtesianEngine::detailedPlace ( unsigned options ) + void EtesianEngine::detailedPlace () { coloquinte::ColoquinteParameters params(getPlaceEffort()); coloquinte::PlacementCallback callback =std::bind(&EtesianEngine::_coloquinteCallback, this, std::placeholders::_1); @@ -1235,31 +1210,16 @@ namespace Etesian { //findYSpin(); if (not toColoquinte()) return; - GraphicUpdate placementUpdate = getUpdateConf(); - Density densityConf = getSpreadingConf(); - cmess1 << " o Running Coloquinte." << endl; startMeasures(); - unsigned globalOptions=0, detailedOptions=0; - - if (placementUpdate == UpdateAll) { - globalOptions |= (UpdateUB | UpdateLB); - detailedOptions |= UpdateDetailed; - } - else if (placementUpdate == LowerBound) { - globalOptions |= UpdateLB; - } - - if (densityConf == ForceUniform) - globalOptions |= ForceUniformDensity; cmess1 << _circuit->report() << std::endl; cmess1 << " o Global placement." << endl; - globalPlace(globalOptions); + globalPlace(); cmess1 << " o Detailed Placement." << endl; - detailedPlace(detailedOptions); + detailedPlace(); //toHurricane(); //addFeeds(); diff --git a/etesian/src/etesian/EtesianEngine.h b/etesian/src/etesian/EtesianEngine.h index 609e1fa3..22533497 100644 --- a/etesian/src/etesian/EtesianEngine.h +++ b/etesian/src/etesian/EtesianEngine.h @@ -70,7 +70,6 @@ namespace Etesian { typedef std::tuple NetInfos; typedef std::tuple > InstanceInfos; typedef std::map InstancesToIds; - typedef std::map NetsToIds; typedef std::set NetNameSet; public: static const Name& staticGetName (); @@ -130,8 +129,8 @@ namespace Etesian { inline Transformation toBlock ( const Transformation& ) const; void setPlaceArea ( const Box& ); size_t toColoquinte (); - void globalPlace ( unsigned options=0 ); - void detailedPlace ( unsigned options=0 ); + void globalPlace (); + void detailedPlace (); void place (); uint32_t doHFNS (); inline void useFeed ( Cell* ); @@ -160,12 +159,8 @@ namespace Etesian { coloquinte::Circuit* _circuit; coloquinte::PlacementSolution* _placementLB; coloquinte::PlacementSolution* _placementUB; - // TODO - // coloquinte::density_restrictions* _densityLimits; - NetsToIds _netsToIds; InstancesToIds _instsToIds; std::vector _idsToInsts; - std::vector _idsToNets; Hurricane::CellViewer* _viewer; Cell* _diodeCell; FeedCells _feedCells;