diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 7cb82de3..7827956f 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -451,7 +451,8 @@ namespace Etesian { DbU::Unit pitch = getPitch(); 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. size_t instancesNb = getCell()->getLeafInstanceOccurrences().getSize(); @@ -728,8 +729,8 @@ namespace Etesian { penaltyIncrease = std::min(maxInc, std::max(minInc, penaltyIncrease * std::sqrt( targetImprovement / (optRatio - prevOptRatio) ) ) ); - cparanoid << " L/U ratio: " << 100*optRatio << "% (previous: " << 100*prevOptRatio << "%)\n" - << " Pulling force: " << pullingForce << " Increase: " << penaltyIncrease << endl; + cparanoid << " L/U ratio: " << 100*optRatio << "% (previous: " << 100*prevOptRatio << "%)\n" + << " Pulling force: " << pullingForce << " Increase: " << penaltyIncrease << endl; pullingForce += penaltyIncrease; prevOptRatio = optRatio; @@ -738,7 +739,7 @@ namespace Etesian { ++i; // First way to exit the loop: UB and LB difference is <10% // Second way to exit the loop: the legalization is close enough to the previous result - }while(linearDisruption > minDisruption and prevOptRatio <= 0.9); + } while (linearDisruption > minDisruption and prevOptRatio <= 0.9); _updatePlacement( _placementUB ); } @@ -939,8 +940,8 @@ namespace Etesian { << " RMST:" << setw(11) << coloquinte::gp::get_RSMT_wirelength( _circuit, _placementUB ) << endl; cparanoid << indent - << " Linear Disrupt.:" << setw(11) << coloquinte::gp::get_mean_linear_disruption ( _circuit, _placementLB, _placementUB ) - << " Quad Disrupt.:" << setw(11) << coloquinte::gp::get_mean_quadratic_disruption( _circuit, _placementLB, _placementUB ) + << " L-Dsrpt:" << setw(8) << coloquinte::gp::get_mean_linear_disruption ( _circuit, _placementLB, _placementUB ) + << " Q-Dsrpt:" << setw(8) << coloquinte::gp::get_mean_quadratic_disruption( _circuit, _placementLB, _placementUB ) << endl; } diff --git a/hurricane/src/hurricane/Cell.cpp b/hurricane/src/hurricane/Cell.cpp index a831f98d..3b95e5fa 100644 --- a/hurricane/src/hurricane/Cell.cpp +++ b/hurricane/src/hurricane/Cell.cpp @@ -295,6 +295,7 @@ DeepNet* Cell::getDeepNet ( Path path, const Net* leafNet ) const return NULL; } + void Cell::flattenNets(unsigned int flags) // *************************************** { @@ -307,23 +308,23 @@ void Cell::flattenNets(unsigned int flags) vector hyperNets; vector topHyperNets; - forEach ( Occurrence, ioccurrence, getHyperNetRootNetOccurrences() ) { - Net* net = static_cast((*ioccurrence).getEntity()); + for ( Occurrence occurrence : getHyperNetRootNetOccurrences() ) { + Net* net = static_cast(occurrence.getEntity()); if (net->isClock() and (flags & Flags::NoClockFlatten)) continue; - HyperNet hyperNet ( *ioccurrence ); - if ( not (*ioccurrence).getPath().isEmpty() ) { - Net* duplicate = getNet( (*ioccurrence).getName() ); + HyperNet hyperNet ( occurrence ); + if ( not occurrence.getPath().isEmpty() ) { + Net* duplicate = getNet( occurrence.getName() ); if (not duplicate) { - hyperNets.push_back( HyperNet(*ioccurrence) ); + hyperNets.push_back( HyperNet(occurrence) ); } else { trace << "Found " << duplicate << " in " << duplicate->getCell() << endl; } } else { bool hasRoutingPads = false; - forEach ( Component*, icomponent, net->getComponents() ) { - RoutingPad* rp = dynamic_cast( *icomponent ); + for ( Component* component : net->getComponents() ) { + RoutingPad* rp = dynamic_cast( component ); if (rp) { // At least one RoutingPad is present: assumes that the net is already // flattened (completly). @@ -334,7 +335,7 @@ void Cell::flattenNets(unsigned int flags) } if (hasRoutingPads) continue; - topHyperNets.push_back( HyperNet(*ioccurrence) ); + topHyperNets.push_back( HyperNet(occurrence) ); } } @@ -344,9 +345,37 @@ void Cell::flattenNets(unsigned int flags) } for ( size_t i=0 ; i(topHyperNets[i].getNetOccurrence().getEntity()); + Net* net = static_cast(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( 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* currentRp = NULL; bool buildRing = false; if (net->isGlobal()) { @@ -356,8 +385,10 @@ void Cell::flattenNets(unsigned int flags) buildRing = flags & Cell::Flags::BuildRings; } - forEach ( Component*, icomponent, net->getComponents() ) { - Plug* primaryPlug = dynamic_cast( *icomponent ); + if (not buildRing) continue; + + for ( Component* component : net->getComponents() ) { + Plug* primaryPlug = dynamic_cast( component ); if (primaryPlug) { if (not primaryPlug->getBodyHook()->getSlaveHooks().isEmpty()) { cerr << "[ERROR] " << primaryPlug << "\n" @@ -368,39 +399,13 @@ void Cell::flattenNets(unsigned int flags) } } - forEach ( Occurrence, iplugOccurrence, topHyperNets[i].getLeafPlugOccurrences() ) { - currentRp = RoutingPad::create( net, *iplugOccurrence, RoutingPad::BiggestArea ); - currentRp->materialize(); - - if (flags & Flags::WarnOnUnplacedInstances) - currentRp->isPlacedOccurrence( RoutingPad::ShowWarning ); - - if (buildRing) { - if (previousRp) { - currentRp->getBodyHook()->attach( previousRp->getBodyHook() ); - } - Plug* plug = static_cast( (*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( *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; + for ( RoutingPad* rp : net->getRoutingPads() ) { + if ( previousRp + and ( not rp ->getBodyHook()->isAttached() + or not previousRp->getBodyHook()->isAttached()) ) { + rp->getBodyHook()->attach( previousRp->getBodyHook() ); } + previousRp = rp; } } diff --git a/hurricane/src/hurricane/DeepNet.cpp b/hurricane/src/hurricane/DeepNet.cpp index 7a2f5f4f..fab040f0 100644 --- a/hurricane/src/hurricane/DeepNet.cpp +++ b/hurricane/src/hurricane/DeepNet.cpp @@ -83,7 +83,6 @@ namespace Hurricane { HyperNet hyperNet ( _netOccurrence ); RoutingPad* previousRp = NULL; RoutingPad* currentRp = NULL; - bool buildRing = false; forEach ( Occurrence, ioccurrence, hyperNet.getLeafPlugOccurrences() ) { nbRoutingPads++; @@ -93,39 +92,25 @@ namespace Hurricane { currentRp->isPlacedOccurrence ( RoutingPad::ShowWarning ); if (nbRoutingPads == 1) { - 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; - } - + //Net* net = + currentRp->getNet(); //cerr << "_createRoutingPads on " << net->getName() << " buildRing:" << buildRing << endl; } - - if (buildRing) { - if (previousRp) { - currentRp->getBodyHook()->attach( previousRp->getBodyHook() ); - } - previousRp = currentRp; - } } return nbRoutingPads; } -Net* getDeepNet ( HyperNet& hypernet ) -{ - Occurrence rootNetOccurrence = getHyperNetRootNetOccurrence( hypernet.getNetOccurrence() ); - -//if ( rootNetOccurrence.getMasterCell()->IsFlattenLeaf() ) return NULL; -//if ( rootNetOccurrence.getPath().isEmpty() ) return NULL; - - return rootNetOccurrence.getOwnerCell()->getNet(rootNetOccurrence.getName()); -} + Net* getDeepNet ( HyperNet& hypernet ) + { + Occurrence rootNetOccurrence = getHyperNetRootNetOccurrence( hypernet.getNetOccurrence() ); + + //if ( rootNetOccurrence.getMasterCell()->IsFlattenLeaf() ) return NULL; + //if ( rootNetOccurrence.getPath().isEmpty() ) return NULL; + + return rootNetOccurrence.getOwnerCell()->getNet(rootNetOccurrence.getName()); + } Record* DeepNet::_getRecord () const diff --git a/hurricane/src/hurricane/Net.cpp b/hurricane/src/hurricane/Net.cpp index 26f385ef..56e75993 100644 --- a/hurricane/src/hurricane/Net.cpp +++ b/hurricane/src/hurricane/Net.cpp @@ -1,7 +1,7 @@ // **************************************************************************************************** // File: ./Net.cpp // 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. // @@ -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 // **************************************************************************************************** diff --git a/hurricane/src/hurricane/hurricane/Cell.h b/hurricane/src/hurricane/hurricane/Cell.h index 4afc0713..efc39899 100644 --- a/hurricane/src/hurricane/hurricane/Cell.h +++ b/hurricane/src/hurricane/hurricane/Cell.h @@ -80,6 +80,7 @@ class Cell : public Entity { , BuildSupplyRings = 0x00000004 , NoClockFlatten = 0x00000008 , WarnOnUnplacedInstances = 0x00000010 + , MaskRings = BuildRings|BuildClockRings|BuildSupplyRings // Flags set for Observers. , CellAboutToChange = 0x00000100 , CellChanged = 0x00000200 @@ -393,6 +394,7 @@ class Cell : public Entity { public: void setFlattenLeaf(bool isFlattenLeaf) {_flags.set(Flags::FlattenLeaf,isFlattenLeaf);}; public: void setPad(bool isPad) {_flags.set(Flags::Pad,isPad);}; 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 resetFlags(unsigned int flags) { _flags &= ~flags; } public: void materialize(); diff --git a/hurricane/src/hurricane/hurricane/Rubber.h b/hurricane/src/hurricane/hurricane/Rubber.h index 50de18c0..53b1007a 100644 --- a/hurricane/src/hurricane/hurricane/Rubber.h +++ b/hurricane/src/hurricane/hurricane/Rubber.h @@ -1,7 +1,7 @@ // **************************************************************************************************** // File: ./hurricane/Rubber.h // 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. // @@ -17,8 +17,8 @@ // not, see . // **************************************************************************************************** -#ifndef HURRICANE_RUBBER -#define HURRICANE_RUBBER +#ifndef HURRICANE_RUBBER_H +#define HURRICANE_RUBBER_H #include "hurricane/Go.h" #include "hurricane/Hooks.h" @@ -29,7 +29,6 @@ namespace Hurricane { class Net; - // **************************************************************************************************** // Rubber declaration // **************************************************************************************************** @@ -112,9 +111,9 @@ class Rubber : public Go { 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 // **************************************************************************************************** diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 6b69c312..42aed0f5 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -320,6 +320,7 @@ namespace Kite { flags |= (mode & KtBuildGlobalRouting) ? Cell::Flags::BuildRings : 0; //if (not cell->isFlattenedNets()) cell->flattenNets( flags ); cell->flattenNets( flags ); + cell->createRoutingPadRings( Cell::Flags::BuildRings ); // Test signals from . //DebugSession::addToTrace( getCell(), "core.snx_inst.a2_x2_8_sig" );