In Cell, separate flattenNets() and createRoutingPadRings().

* New: In Hurricane, in Cell, no longer create rings of RoutingPads when
    flattening the nets. Put that functionnality into a separate method
    ::createRoutingPadRings().
      This allow to perform the Net flattening in Etesian *without*
    the rings, which slow it down. Then the rings are created by
    Knik/Kite. This also solves the double ring creation when doing
    P&R of a complete chip (rings where created twice: in the core
    block for Etesian and at chip level for Kite).
* Change: In Etesian, slight beautification of the printed informations.
    (psychorigid me)
This commit is contained in:
Jean-Paul Chaput 2015-06-21 17:47:28 +02:00
parent fcb4acadad
commit 09d4e488ba
7 changed files with 78 additions and 85 deletions

View File

@ -451,7 +451,8 @@ namespace Etesian {
DbU::Unit pitch = getPitch(); DbU::Unit pitch = getPitch();
cmess1 << " - Building RoutingPads (transhierarchical) ..." << endl; cmess1 << " - Building RoutingPads (transhierarchical) ..." << endl;
getCell()->flattenNets( Cell::Flags::BuildRings|Cell::Flags::NoClockFlatten ); //getCell()->flattenNets( Cell::Flags::BuildRings|Cell::Flags::NoClockFlatten );
getCell()->flattenNets( Cell::Flags::NoClockFlatten );
// Coloquinte circuit description data-structures. // Coloquinte circuit description data-structures.
size_t instancesNb = getCell()->getLeafInstanceOccurrences().getSize(); size_t instancesNb = getCell()->getLeafInstanceOccurrences().getSize();
@ -939,8 +940,8 @@ namespace Etesian {
<< " RMST:" << setw(11) << coloquinte::gp::get_RSMT_wirelength( _circuit, _placementUB ) << " RMST:" << setw(11) << coloquinte::gp::get_RSMT_wirelength( _circuit, _placementUB )
<< endl; << endl;
cparanoid << indent cparanoid << indent
<< " Linear Disrupt.:" << setw(11) << coloquinte::gp::get_mean_linear_disruption ( _circuit, _placementLB, _placementUB ) << " L-Dsrpt:" << setw(8) << coloquinte::gp::get_mean_linear_disruption ( _circuit, _placementLB, _placementUB )
<< " Quad Disrupt.:" << setw(11) << coloquinte::gp::get_mean_quadratic_disruption( _circuit, _placementLB, _placementUB ) << " Q-Dsrpt:" << setw(8) << coloquinte::gp::get_mean_quadratic_disruption( _circuit, _placementLB, _placementUB )
<< endl; << endl;
} }

View File

@ -295,6 +295,7 @@ DeepNet* Cell::getDeepNet ( Path path, const Net* leafNet ) const
return NULL; return NULL;
} }
void Cell::flattenNets(unsigned int flags) void Cell::flattenNets(unsigned int flags)
// *************************************** // ***************************************
{ {
@ -307,23 +308,23 @@ void Cell::flattenNets(unsigned int flags)
vector<HyperNet> hyperNets; vector<HyperNet> hyperNets;
vector<HyperNet> topHyperNets; vector<HyperNet> topHyperNets;
forEach ( Occurrence, ioccurrence, getHyperNetRootNetOccurrences() ) { for ( Occurrence occurrence : getHyperNetRootNetOccurrences() ) {
Net* net = static_cast<Net*>((*ioccurrence).getEntity()); Net* net = static_cast<Net*>(occurrence.getEntity());
if (net->isClock() and (flags & Flags::NoClockFlatten)) continue; if (net->isClock() and (flags & Flags::NoClockFlatten)) continue;
HyperNet hyperNet ( *ioccurrence ); HyperNet hyperNet ( occurrence );
if ( not (*ioccurrence).getPath().isEmpty() ) { if ( not occurrence.getPath().isEmpty() ) {
Net* duplicate = getNet( (*ioccurrence).getName() ); Net* duplicate = getNet( occurrence.getName() );
if (not duplicate) { if (not duplicate) {
hyperNets.push_back( HyperNet(*ioccurrence) ); hyperNets.push_back( HyperNet(occurrence) );
} else { } else {
trace << "Found " << duplicate << " in " << duplicate->getCell() << endl; trace << "Found " << duplicate << " in " << duplicate->getCell() << endl;
} }
} else { } else {
bool hasRoutingPads = false; bool hasRoutingPads = false;
forEach ( Component*, icomponent, net->getComponents() ) { for ( Component* component : net->getComponents() ) {
RoutingPad* rp = dynamic_cast<RoutingPad*>( *icomponent ); RoutingPad* rp = dynamic_cast<RoutingPad*>( component );
if (rp) { if (rp) {
// At least one RoutingPad is present: assumes that the net is already // At least one RoutingPad is present: assumes that the net is already
// flattened (completly). // flattened (completly).
@ -334,7 +335,7 @@ void Cell::flattenNets(unsigned int flags)
} }
if (hasRoutingPads) continue; if (hasRoutingPads) continue;
topHyperNets.push_back( HyperNet(*ioccurrence) ); topHyperNets.push_back( HyperNet(occurrence) );
} }
} }
@ -345,8 +346,36 @@ void Cell::flattenNets(unsigned int flags)
for ( size_t i=0 ; i<topHyperNets.size() ; ++i ) { for ( size_t i=0 ; i<topHyperNets.size() ; ++i ) {
Net* net = static_cast<Net*>(topHyperNets[i].getNetOccurrence().getEntity()); Net* net = static_cast<Net*>(topHyperNets[i].getNetOccurrence().getEntity());
for ( Occurrence plugOccurrence : topHyperNets[i].getLeafPlugOccurrences() ) {
RoutingPad* rp = RoutingPad::create( net, plugOccurrence, RoutingPad::BiggestArea );
rp->materialize();
if (flags & Flags::WarnOnUnplacedInstances)
rp->isPlacedOccurrence( RoutingPad::ShowWarning );
}
for ( Component* component : net->getComponents() ) {
Pin* pin = dynamic_cast<Pin*>( component );
if (pin) {
RoutingPad::create( pin );
}
}
}
UpdateSession::close();
}
void Cell::createRoutingPadRings(unsigned int flags)
// *************************************************
{
flags &= Flags::MaskRings;
UpdateSession::open();
for ( Net* net : getNets() ) {
RoutingPad* previousRp = NULL; RoutingPad* previousRp = NULL;
RoutingPad* currentRp = NULL;
bool buildRing = false; bool buildRing = false;
if (net->isGlobal()) { if (net->isGlobal()) {
@ -356,8 +385,10 @@ void Cell::flattenNets(unsigned int flags)
buildRing = flags & Cell::Flags::BuildRings; buildRing = flags & Cell::Flags::BuildRings;
} }
forEach ( Component*, icomponent, net->getComponents() ) { if (not buildRing) continue;
Plug* primaryPlug = dynamic_cast<Plug*>( *icomponent );
for ( Component* component : net->getComponents() ) {
Plug* primaryPlug = dynamic_cast<Plug*>( component );
if (primaryPlug) { if (primaryPlug) {
if (not primaryPlug->getBodyHook()->getSlaveHooks().isEmpty()) { if (not primaryPlug->getBodyHook()->getSlaveHooks().isEmpty()) {
cerr << "[ERROR] " << primaryPlug << "\n" cerr << "[ERROR] " << primaryPlug << "\n"
@ -368,39 +399,13 @@ void Cell::flattenNets(unsigned int flags)
} }
} }
forEach ( Occurrence, iplugOccurrence, topHyperNets[i].getLeafPlugOccurrences() ) { for ( RoutingPad* rp : net->getRoutingPads() ) {
currentRp = RoutingPad::create( net, *iplugOccurrence, RoutingPad::BiggestArea ); if ( previousRp
currentRp->materialize(); and ( not rp ->getBodyHook()->isAttached()
or not previousRp->getBodyHook()->isAttached()) ) {
if (flags & Flags::WarnOnUnplacedInstances) rp->getBodyHook()->attach( previousRp->getBodyHook() );
currentRp->isPlacedOccurrence( RoutingPad::ShowWarning );
if (buildRing) {
if (previousRp) {
currentRp->getBodyHook()->attach( previousRp->getBodyHook() );
}
Plug* plug = static_cast<Plug*>( (*iplugOccurrence).getEntity() );
if ( (*iplugOccurrence).getPath().isEmpty() ) {
plug->getBodyHook()->attach( currentRp->getBodyHook() );
plug->getBodyHook()->detach();
}
previousRp = currentRp;
}
}
forEach ( Component*, icomponent, net->getComponents() ) {
Pin* pin = dynamic_cast<Pin*>( *icomponent );
if (pin) {
currentRp = RoutingPad::create( pin );
if (buildRing) {
if (previousRp) {
currentRp->getBodyHook()->attach( previousRp->getBodyHook() );
}
pin->getBodyHook()->attach( currentRp->getBodyHook() );
pin->getBodyHook()->detach();
}
previousRp = currentRp;
} }
previousRp = rp;
} }
} }

View File

@ -83,7 +83,6 @@ namespace Hurricane {
HyperNet hyperNet ( _netOccurrence ); HyperNet hyperNet ( _netOccurrence );
RoutingPad* previousRp = NULL; RoutingPad* previousRp = NULL;
RoutingPad* currentRp = NULL; RoutingPad* currentRp = NULL;
bool buildRing = false;
forEach ( Occurrence, ioccurrence, hyperNet.getLeafPlugOccurrences() ) { forEach ( Occurrence, ioccurrence, hyperNet.getLeafPlugOccurrences() ) {
nbRoutingPads++; nbRoutingPads++;
@ -93,24 +92,10 @@ namespace Hurricane {
currentRp->isPlacedOccurrence ( RoutingPad::ShowWarning ); currentRp->isPlacedOccurrence ( RoutingPad::ShowWarning );
if (nbRoutingPads == 1) { if (nbRoutingPads == 1) {
Net* net = currentRp->getNet(); //Net* net =
currentRp->getNet();
if (net->isGlobal()) {
if ( (flags & Cell::Flags::BuildClockRings ) and net->isClock () ) buildRing = true;
else if ( (flags & Cell::Flags::BuildSupplyRings) and net->isSupply() ) buildRing = true;
} else {
buildRing = flags & Cell::Flags::BuildRings;
}
//cerr << "_createRoutingPads on " << net->getName() << " buildRing:" << buildRing << endl; //cerr << "_createRoutingPads on " << net->getName() << " buildRing:" << buildRing << endl;
} }
if (buildRing) {
if (previousRp) {
currentRp->getBodyHook()->attach( previousRp->getBodyHook() );
}
previousRp = currentRp;
}
} }
return nbRoutingPads; return nbRoutingPads;

View File

@ -1,7 +1,7 @@
// **************************************************************************************************** // ****************************************************************************************************
// File: ./Net.cpp // File: ./Net.cpp
// Authors: R. Escassut // Authors: R. Escassut
// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved // Copyright (c) BULL S.A. 2000-2015, All Rights Reserved
// //
// This file is part of Hurricane. // This file is part of Hurricane.
// //
@ -1012,5 +1012,5 @@ string Net_SlavePlugs::Locator::_getString() const
// **************************************************************************************************** // ****************************************************************************************************
// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved // Copyright (c) BULL S.A. 2000-2015, All Rights Reserved
// **************************************************************************************************** // ****************************************************************************************************

View File

@ -80,6 +80,7 @@ class Cell : public Entity {
, BuildSupplyRings = 0x00000004 , BuildSupplyRings = 0x00000004
, NoClockFlatten = 0x00000008 , NoClockFlatten = 0x00000008
, WarnOnUnplacedInstances = 0x00000010 , WarnOnUnplacedInstances = 0x00000010
, MaskRings = BuildRings|BuildClockRings|BuildSupplyRings
// Flags set for Observers. // Flags set for Observers.
, CellAboutToChange = 0x00000100 , CellAboutToChange = 0x00000100
, CellChanged = 0x00000200 , CellChanged = 0x00000200
@ -393,6 +394,7 @@ class Cell : public Entity {
public: void setFlattenLeaf(bool isFlattenLeaf) {_flags.set(Flags::FlattenLeaf,isFlattenLeaf);}; public: void setFlattenLeaf(bool isFlattenLeaf) {_flags.set(Flags::FlattenLeaf,isFlattenLeaf);};
public: void setPad(bool isPad) {_flags.set(Flags::Pad,isPad);}; public: void setPad(bool isPad) {_flags.set(Flags::Pad,isPad);};
public: void flattenNets(unsigned int flags=Flags::BuildRings); public: void flattenNets(unsigned int flags=Flags::BuildRings);
public: void createRoutingPadRings(unsigned int flags=Flags::BuildRings);
public: void setFlags(unsigned int flags) { _flags |= flags; } public: void setFlags(unsigned int flags) { _flags |= flags; }
public: void resetFlags(unsigned int flags) { _flags &= ~flags; } public: void resetFlags(unsigned int flags) { _flags &= ~flags; }
public: void materialize(); public: void materialize();

View File

@ -1,7 +1,7 @@
// **************************************************************************************************** // ****************************************************************************************************
// File: ./hurricane/Rubber.h // File: ./hurricane/Rubber.h
// Authors: R. Escassut // Authors: R. Escassut
// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved // Copyright (c) BULL S.A. 2000-2015, All Rights Reserved
// //
// This file is part of Hurricane. // This file is part of Hurricane.
// //
@ -17,8 +17,8 @@
// not, see <http://www.gnu.org/licenses/>. // not, see <http://www.gnu.org/licenses/>.
// **************************************************************************************************** // ****************************************************************************************************
#ifndef HURRICANE_RUBBER #ifndef HURRICANE_RUBBER_H
#define HURRICANE_RUBBER #define HURRICANE_RUBBER_H
#include "hurricane/Go.h" #include "hurricane/Go.h"
#include "hurricane/Hooks.h" #include "hurricane/Hooks.h"
@ -29,7 +29,6 @@ namespace Hurricane {
class Net; class Net;
// **************************************************************************************************** // ****************************************************************************************************
// Rubber declaration // Rubber declaration
// **************************************************************************************************** // ****************************************************************************************************
@ -112,9 +111,9 @@ class Rubber : public Go {
INSPECTOR_P_SUPPORT(Hurricane::Rubber); INSPECTOR_P_SUPPORT(Hurricane::Rubber);
#endif // HURRICANE_RUBBER #endif // HURRICANE_RUBBER_H
// **************************************************************************************************** // ****************************************************************************************************
// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved // Copyright (c) BULL S.A. 2000-2015, All Rights Reserved
// **************************************************************************************************** // ****************************************************************************************************

View File

@ -320,6 +320,7 @@ namespace Kite {
flags |= (mode & KtBuildGlobalRouting) ? Cell::Flags::BuildRings : 0; flags |= (mode & KtBuildGlobalRouting) ? Cell::Flags::BuildRings : 0;
//if (not cell->isFlattenedNets()) cell->flattenNets( flags ); //if (not cell->isFlattenedNets()) cell->flattenNets( flags );
cell->flattenNets( flags ); cell->flattenNets( flags );
cell->createRoutingPadRings( Cell::Flags::BuildRings );
// Test signals from <snx2013>. // Test signals from <snx2013>.
//DebugSession::addToTrace( getCell(), "core.snx_inst.a2_x2_8_sig" ); //DebugSession::addToTrace( getCell(), "core.snx_inst.a2_x2_8_sig" );