Skip to content

Commit

Permalink
Added support for windowed extraction in Tramontana, reduce memory fo…
Browse files Browse the repository at this point in the history
…otprint.

The number of windows is computed from the total (flat) number of
instances of the Cell. With a ratio supplied through the configuration
parameter:

   cfg.tramontana.instancesPerWindows = 10000

Default value is 10000.
  • Loading branch information
jpc-lip6 committed Aug 22, 2024
1 parent b12c861 commit 31b2630
Show file tree
Hide file tree
Showing 12 changed files with 283 additions and 261 deletions.
2 changes: 2 additions & 0 deletions hurricane/src/hurricane/hurricane/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ namespace Hurricane {
inline Cell::Flags getStopCellFlags () const;
inline size_t getDepth () const;
inline const Transformation& getTransformation () const;
inline const Box& getTopArea () const;
inline const Box& getArea () const;
inline DbU::Unit getThreshold () const;
inline const BasicLayer* getBasicLayer () const;
Expand Down Expand Up @@ -403,6 +404,7 @@ namespace Hurricane {
inline unsigned int Query::getStopLevel () const { return _stack.getStopLevel(); }
inline Cell::Flags Query::getStopCellFlags () const { return _stack.getStopCellFlags(); }
inline size_t Query::getDepth () const { return _stack.size(); }
inline const Box& Query::getTopArea () const { return _stack.getTopArea(); }
inline const Box& Query::getArea () const { return _stack.getArea(); }
inline const Transformation& Query::getTransformation () const { return _stack.getTransformation(); }
inline Path Query::getPath () const { return _stack.getPath(); }
Expand Down
6 changes: 4 additions & 2 deletions tramontana/src/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ namespace Tramontana {
// Class : "Tramontana::Configuration".

Configuration::Configuration ()
: _mergeSupplies( Cfg::getParamBool("tramontana.mergeSupplies", false)->asBool() )
: _mergeSupplies ( Cfg::getParamBool("tramontana.mergeSupplies" , false)->asBool() )
, _instancesPerWindows( Cfg::getParamInt ("tramontana.instancesPerWindows", 10000)->asInt () )
{ }


Expand Down Expand Up @@ -88,7 +89,8 @@ namespace Tramontana {
Record* Configuration::_getRecord () const
{
Record* record = new Record ( _getString() );
record->add( getSlot( "_mergeSupplies", _mergeSupplies ) );
record->add( getSlot( "_mergeSupplies" , _mergeSupplies ) );
record->add( getSlot( "_instancesPerWindows", _instancesPerWindows ) );
return record;
}

Expand Down
5 changes: 4 additions & 1 deletion tramontana/src/Equipotential.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ namespace Tramontana {

bool Equipotential::add ( Occurrence occ, const Box& boundingBox )
{
cdebug_log(160,0) << "Equipotential::add(): " << this << endl;
cdebug_log(160,0) << " " << occ << endl;
if (occ.getPath().isEmpty()) {
Contact* contact = dynamic_cast<Contact*>( occ.getEntity() );
if ((_components.find(occ) != _components.end())) {
Expand All @@ -254,7 +256,7 @@ namespace Tramontana {
) << endl;
return false;
}
cdebug_log(160,0) << "Equipotential::add(): " << occ << endl;
cdebug_log(160,0) << " Is top component: " << occ << endl;
_components.insert( occ );
NetMap::iterator inet = _nets.find( comp->getNet() );
if (inet != _nets.end()) {
Expand Down Expand Up @@ -300,6 +302,7 @@ namespace Tramontana {
) << endl;
return false;
}
cdebug_log(160,0) << " Is child equi: " << occ << endl;
_childs.insert( occ );
}
_boundingBox.merge( boundingBox );
Expand Down
37 changes: 37 additions & 0 deletions tramontana/src/QueryTiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ namespace Tramontana {
return component->getLayer()->getMask().intersect( fullyProcesseds );
}

bool QueryTiles::isLeftMostWindow () const
{ return _sweepLine->isLeftMostWindow(); }


bool QueryTiles::isRightMostWindow () const
{ return _sweepLine->isRightMostWindow(); }


void QueryTiles::masterCellCallback ()
{ }
Expand All @@ -77,6 +84,24 @@ namespace Tramontana {
if (not component) return;
if (component->getNet()->isBlockage()) return;
if (isProcessed(component)) return;

Box bb = component->getBoundingBox();
// if (bb.getXMax() <= getArea().getXMin()) {
// cerr << "Outside, on the left, of area window " << bb << " vs. " << getArea() << endl;
// cerr << " getPath() " << getPath() << endl;
// cerr << " go " << go << endl;
// return;
// }
if (not isLeftMostWindow() and (bb.getXMin() < getArea().getXMin())) {
return;
}
if (not isRightMostWindow() and (bb.getXMin() >= getArea().getXMax())) {
cerr << "Outside, on the right, of area window " << bb << " vs. " << getArea() << endl;
cerr << " getPath() " << getPath() << endl;
cerr << " go " << go << endl;
return;
}

Occurrence occurrence = Occurrence( go, getPath() );
for ( const BasicLayer* layer : _sweepLine->getExtracteds() ) {
if (not component->getLayer()->getMask().intersect(layer->getMask())) continue;
Expand Down Expand Up @@ -106,4 +131,16 @@ namespace Tramontana {
}


uint32_t QueryTiles::doAreaQuery ( SweepLine* sweepLine, const Box& area )
{
QueryTiles query ( sweepLine );
query.setArea( area );
for ( const BasicLayer* layer : sweepLine->getExtracteds() ) {
query.setBasicLayer( layer );
query.doQuery();
}
return query.getGoMatchCount();
}


} // Tramontana namespace.
Loading

0 comments on commit 31b2630

Please sign in to comment.