Remove unused datastructures in EtesianEngine

This commit is contained in:
Gabriel Gouvine 2023-06-08 18:45:19 +02:00
parent 011b32d1ed
commit 093a4161ef
2 changed files with 25 additions and 70 deletions

View File

@ -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<InstanceInfos> emptyIdsToInsts;
_idsToInsts.swap( emptyIdsToInsts );
vector<NetInfos> 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<Instance*>(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<int> cellX( instancesNb+1 );
vector<int> cellY( instancesNb+1 );
vector<coloquinte::CellOrientation> orient( instancesNb+1 );
vector<int> cellWidth( instancesNb+1 );
vector<int> cellHeight( instancesNb+1 );
vector<bool> cellIsFixed( instancesNb+1 );
vector<bool> cellIsObstruction( instancesNb+1 );
vector<coloquinte::CellRowPolarity> 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<int> cellX( instancesNb+1 );
vector<int> cellY( instancesNb+1 );
vector<coloquinte::CellOrientation> orient( instancesNb+1 );
vector<int> cellWidth( instancesNb+1 );
vector<int> cellHeight( instancesNb+1 );
vector<bool> cellIsFixed( instancesNb+1 );
vector<bool> cellIsObstruction( instancesNb+1 );
vector<coloquinte::CellRowPolarity> 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;
@ -1033,9 +1021,6 @@ namespace Etesian {
dots.dot();
_netsToIds.insert( make_pair(net,netId) );
_idsToNets[netId] = make_tuple( net, _instsToIds.size(), 0 );
string topCellInstancePin = getString(getCell()->getName()) + ":C";
vector<int> 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<Plug*>( 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();

View File

@ -70,7 +70,6 @@ namespace Etesian {
typedef std::tuple<Net*,int32_t,uint32_t> NetInfos;
typedef std::tuple<Instance*, std::vector<RoutingPad*> > InstanceInfos;
typedef std::map<Instance*,size_t,DBo::CompareById> InstancesToIds;
typedef std::map<Net*,size_t,DBo::CompareById> NetsToIds;
typedef std::set<std::string> 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<InstanceInfos> _idsToInsts;
std::vector<NetInfos> _idsToNets;
Hurricane::CellViewer* _viewer;
Cell* _diodeCell;
FeedCells _feedCells;