diff --git a/bootstrap/builder/Configuration.py b/bootstrap/builder/Configuration.py index 070877f6..ca574de7 100644 --- a/bootstrap/builder/Configuration.py +++ b/bootstrap/builder/Configuration.py @@ -167,7 +167,8 @@ class Configuration ( object ): elif self._osFedora .match(lines[0]): self._osType = "Linux.fc" elif self._osLinux_64 .match(lines[0]): self._osType = "Linux.x86_64" - self._libSuffix = "64" + if os.path.exists("/usr/lib64/"): + self._libSuffix = "64" elif self._osLinux .match(lines[0]): self._osType = "Linux.i386" elif self._osDarwin .match(lines[0]): self._osType = "Darwin" elif self._osFreeBSD8x_amd64.match(lines[0]): diff --git a/bootstrap/coriolisEnv.py b/bootstrap/coriolisEnv.py index 2a4d8ba3..c3bc83ce 100755 --- a/bootstrap/coriolisEnv.py +++ b/bootstrap/coriolisEnv.py @@ -84,7 +84,8 @@ def guessOs (): libDir = "lib64" elif osLinux_64.match(lines[0]): osType = "Linux.x86_64" - libDir = "lib64" + if(os.path.exists("/usr/lib64/")): + libDir = "lib64" elif osLinux.match(lines[0]): osType = "Linux.i386" elif osFreeBSD8x_64.match(lines[0]): diff --git a/coloquinte/src/coloquinte/circuit_helper.hxx b/coloquinte/src/coloquinte/circuit_helper.hxx index e19994c6..53187393 100644 --- a/coloquinte/src/coloquinte/circuit_helper.hxx +++ b/coloquinte/src/coloquinte/circuit_helper.hxx @@ -82,6 +82,7 @@ std::int64_t get_HPWL_length(netlist const & circuit, placement_t const & pl, in std::int64_t get_RSMT_length(netlist const & circuit, placement_t const & pl, index_t net_ind); std::vector > get_MST_topology(std::vector > const & pins); +std::vector > get_RSMT_horizontal_topology(std::vector > const & pins, index_t exactitude_limits); point > > get_RSMT_topology(std::vector > const & pins, index_t exactitude_limit); } // namespace coloquinte diff --git a/coloquinte/src/topologies.cxx b/coloquinte/src/topologies.cxx index 3a2d67b8..7bb4790a 100644 --- a/coloquinte/src/topologies.cxx +++ b/coloquinte/src/topologies.cxx @@ -343,9 +343,55 @@ std::vector get_big_horizontal_topology_from_sorted(std::vector get_RSMT_horizontal_topology(std::vector > const & pins, index_t exactitude_limit){ + if(pins.size() <= 1) + return std::vector(); + else if(pins.size() == 2) + return std::vector(1, edge_t(0, 1)); + else if(pins.size() == 3){ + std::vector ipoints(pins.size()); + for(index_t i=0; i{{xpoints[0].index, xpoints[1].index}, {xpoints[1].index, xpoints[2].index}}; + } + else{ + std::vector horizontal_topology; + + // Sort the pins by x coordinate + std::vector ipoints(pins.size()); + for(index_t i=0; i > sorted_pins(pins.size()); + for(index_t i=0; i > get_MST_topology(std::vector > const & pins){ std::vector edges; @@ -478,34 +524,8 @@ point > > get_RSMT_topology(std::vector< return point >{{{xpoints[0].index, xpoints[1].index}, {xpoints[1].index, xpoints[2].index}}, {{ypoints[0].index, ypoints[1].index}, {ypoints[1].index, ypoints[2].index}}}; } else{ - std::vector horizontal_topology; - - // Sort the pins by x coordinate - std::vector ipoints(pins.size()); - for(index_t i=0; i > sorted_pins(pins.size()); - for(index_t i=0; i >(horizontal_topology, get_vertical_topology(sorted_pins, horizontal_topology)); + std::vector horizontal_topology = get_RSMT_horizontal_topology(pins, exactitude_limit); + return point >(horizontal_topology, get_vertical_topology(pins, horizontal_topology)); } } diff --git a/crlcore/src/ccore/alliance/ap/ApParser.cpp b/crlcore/src/ccore/alliance/ap/ApParser.cpp index 2965e727..d36de617 100644 --- a/crlcore/src/ccore/alliance/ap/ApParser.cpp +++ b/crlcore/src/ccore/alliance/ap/ApParser.cpp @@ -249,6 +249,7 @@ namespace { _layerInformations.add ( "CONT_POLY" , "CONT_POLY" , false, false ); _layerInformations.add ( "CONT_POLY2" , "CONT_POLY2" , false, false ); _layerInformations.add ( "CONT_VIA" , "VIA12" , false, false ); + _layerInformations.add ( "CONT_VIA1" , "VIA12" , false, false ); _layerInformations.add ( "CONT_VIA2" , "VIA23" , false, false ); _layerInformations.add ( "CONT_VIA3" , "VIA34" , false, false ); _layerInformations.add ( "CONT_VIA4" , "VIA45" , false, false ); diff --git a/crlcore/src/ccore/blif/BlifParser.cpp b/crlcore/src/ccore/blif/BlifParser.cpp index 44efbe5e..16d31761 100644 --- a/crlcore/src/ccore/blif/BlifParser.cpp +++ b/crlcore/src/ccore/blif/BlifParser.cpp @@ -338,8 +338,10 @@ namespace { void Model::connectModels () { - for ( Model* blifModel : _blifOrder ) + for ( Model* blifModel : _blifOrder ){ + cmess2 << "Handling model <" << blifModel->getCell()->getName() << ">" << endl; blifModel->connectSubckts(); + } } @@ -480,20 +482,62 @@ namespace { for ( auto connection : subckt->getConnections() ) { string masterNetName = connection.first; string netName = connection.second; + //cparanoid << "\tConnection " + // << "plug: <" << masterNetName << ">, " + // << "external: <" << netName << ">." + // << endl; Net* net = _cell->getNet( netName ); - Plug* plug = instance->getPlug( instance->getMasterCell()->getNet(masterNetName) ); - Net* plugNet = plug->getNet(); - if (not plugNet) { - if (not net) net = Net::create( _cell, netName ); - plug->setNet( net ); - continue; + Net* masterNet = instance->getMasterCell()->getNet(masterNetName); + if(not masterNet) { + ostringstream tmes; + tmes << "The master net <" << masterNetName << "> hasn't been found " + << "for instance <" << subckt->getInstanceName() << "> " + << "of model <" << subckt->getModelName() << ">" + << "in model <" << getCell()->getName() << ">" + << endl; + throw Error(tmes.str()); } - if (not net) { plugNet->addAlias( netName ); continue; } - if (plugNet == net) continue; + Plug* plug = instance->getPlug( masterNet ); + if(not plug) { + ostringstream tmes; + tmes << "The plug in net <" << netName << "> " + << "and master net <" << masterNetName << "> hasn't been found " + << "for instance <" << subckt->getInstanceName() << "> " + << "of model <" << subckt->getModelName() << ">" + << "in model <" << getCell()->getName() << ">" + << endl; + throw Error(tmes.str()); + } - plugNet->merge( net ); + + Net* plugNet = plug->getNet(); + + if (not plugNet) { // Plug not connected yet + if (not net) net = Net::create( _cell, netName ); + plug->setNet( net ); + plugNet = net; + } + else if (not net) { // Net doesn't exist yet + plugNet->addAlias( netName ); + } + else if (plugNet != net){ // Plus already connected to another net + plugNet->merge( net ); + } + + if( plugNet->getType() == Net::Type::POWER or plugNet->getType() == Net::Type::GROUND ){ + ostringstream tmes; + string powType = plugNet->getType() == Net::Type::POWER ? "power" : "ground"; + string plugName = plugNet->getName()._getString(); // Name of the original net + tmes << "Connecting instance <" << subckt->getInstanceName() << "> " + << "of <" << subckt->getModelName() << "> " + << "to the " << powType << " net <" << plugName << "> "; + if(netName != plugName) + tmes << "with the alias <" << netName << ">. "; + tmes << "Maybe you should use tie cells?"; + cerr << Warning(tmes.str()) << endl; + } } } } @@ -602,7 +646,23 @@ namespace CRL { if (tokenize.state() & Tokenize::CoverAlias) { blifModel->mergeAlias( blifLine[1], blifLine[2] ); } else if (tokenize.state() & Tokenize::CoverZero) { + cerr << Warning( "Blif::load() Definition of an alias <%s> of VSS in a \".names\". Maybe you should use tie cells?\n" + " File %s.blif at line %u." + , blifLine[1].c_str() + , blifFile.c_str() + , tokenize.lineno() + ) << endl; + //blifModel->mergeAlias( blifLine[1], "vss" ); + blifModel->getCell()->getNet( "vss" )->addAlias( blifLine[1] ); } else if (tokenize.state() & Tokenize::CoverOne ) { + cerr << Warning( "Blif::load() Definition of an alias <%s> of VDD in a \".names\". Maybe you should use tie cells?\n" + " File %s.blif at line %u." + , blifLine[1].c_str() + , blifFile.c_str() + , tokenize.lineno() + ) << endl; + //blifModel->mergeAlias( blifLine[1], "vdd" ); + blifModel->getCell()->getNet( "vdd" )->addAlias( blifLine[1] ); } else { cerr << Error( "Blif::load() Unsupported \".names\" cover construct.\n" " File %s.blif at line %u." diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 7f021b2f..f7a84630 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -353,17 +353,17 @@ namespace Etesian { double cellLength = 0; vector feedOccurrences; - forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() ) + for( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() ) { - Instance* instance = static_cast((*ioccurrence).getEntity()); + Instance* instance = static_cast(occurrence.getEntity()); Cell* masterCell = instance->getMasterCell(); - string instanceName = (*ioccurrence).getCompactString(); + string instanceName = occurrence.getCompactString(); if (CatalogExtension::isFeed(masterCell)) { cerr << Warning( "Found a feedcell %s in an unplaced design, removing." , instanceName.c_str() ) << endl; - feedOccurrences.push_back( *ioccurrence ); + feedOccurrences.push_back( occurrence ); continue; } @@ -409,19 +409,19 @@ namespace Etesian { UpdateSession::open(); vector feedOccurrences; - forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() ) + for( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() ) { dots.dot(); - if ( _flatDesign and not (*ioccurrence).getPath().getTailPath().isEmpty()) + if ( _flatDesign and not occurrence.getPath().getTailPath().isEmpty()) _flatDesign = true; - Instance* instance = static_cast((*ioccurrence).getEntity()); + Instance* instance = static_cast(occurrence.getEntity()); Cell* masterCell = instance->getMasterCell(); - string instanceName = (*ioccurrence).getCompactString(); + string instanceName = occurrence.getCompactString(); if (CatalogExtension::isFeed(masterCell)) { - feedOccurrences.push_back( *ioccurrence ); + feedOccurrences.push_back( occurrence ); } } @@ -466,9 +466,9 @@ namespace Etesian { Box topAb = getCell()->getAbutmentBox(); UpdateSession::open(); - forEach ( Occurrence, ioccurrence, getCell()->getNonLeafInstanceOccurrences() ) + for ( Occurrence occurrence : getCell()->getNonLeafInstanceOccurrences() ) { - Instance* instance = static_cast((*ioccurrence).getEntity()); + Instance* instance = static_cast(occurrence.getEntity()); Cell* masterCell = instance->getMasterCell(); if (masterCell->getAbutmentBox().isEmpty()) { @@ -481,11 +481,11 @@ namespace Etesian { UpdateSession::close(); index_t instanceId = 0; - forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() ) + for ( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() ) { - Instance* instance = static_cast((*ioccurrence).getEntity()); + Instance* instance = static_cast(occurrence.getEntity()); Cell* masterCell = instance->getMasterCell(); - string instanceName = (*ioccurrence).getCompactString(); + string instanceName = occurrence.getCompactString(); // Remove the enclosing brackets... instanceName.erase( 0, 1 ); instanceName.erase( instanceName.size()-1 ); @@ -498,7 +498,7 @@ namespace Etesian { Box instanceAb = masterCell->getAbutmentBox(); Transformation instanceTransf = instance->getTransformation(); - (*ioccurrence).getPath().getTransformation().applyOn( instanceTransf ); + occurrence.getPath().getTransformation().applyOn( instanceTransf ); instanceTransf.applyOn( instanceAb ); // Upper rounded @@ -536,26 +536,26 @@ namespace Etesian { vector pins; unsigned int netId = 0; - forEach ( Net*, inet, getCell()->getNets() ) + for ( Net* net : getCell()->getNets() ) { const char* excludedType = NULL; - if ((*inet)->getType() == Net::Type::POWER ) excludedType = "POWER"; - if ((*inet)->getType() == Net::Type::GROUND) excludedType = "GROUND"; - if ((*inet)->getType() == Net::Type::CLOCK ) excludedType = "CLOCK"; + if (net->getType() == Net::Type::POWER ) excludedType = "POWER"; + if (net->getType() == Net::Type::GROUND) excludedType = "GROUND"; + if (net->getType() == Net::Type::CLOCK ) excludedType = "CLOCK"; if (excludedType) { cparanoid << Warning( "%s is not a routable net (%s,excluded)." - , getString(*inet).c_str(), excludedType ) << endl; + , getString(net).c_str(), excludedType ) << endl; continue; } - if (af->isBLOCKAGE((*inet)->getName())) continue; + if (af->isBLOCKAGE(net->getName())) continue; dots.dot(); nets[netId] = temporary_net( netId, 1 ); - forEach ( RoutingPad*, irp, (*inet)->getRoutingPads() ) { - string insName = extractInstanceName( *irp ); - Point offset = extractRpOffset ( *irp ); + for ( RoutingPad* rp : net->getRoutingPads() ) { + string insName = extractInstanceName( rp ); + Point offset = extractRpOffset ( rp ); int_t xpin = offset.getX() / pitch; int_t ypin = offset.getY() / pitch; @@ -651,16 +651,16 @@ namespace Etesian { // Create different densities _densityLimits.clear(); - forEach(GCell*, gc, grid->getGCells()){ - float density = (*gc)->getMaxHVDensity(); + for(GCell* gc : grid->getGCells()){ + float density = gc->getMaxHVDensity(); if(density >= densityThreshold){ coloquinte::density_limit cur; cur.box_ = coloquinte::box( - (*gc)->getX() / pitch, - (*gc)->getXMax() / pitch, - (*gc)->getY() / pitch, - (*gc)->getYMax() / pitch + gc->getX() / pitch, + gc->getXMax() / pitch, + gc->getY() / pitch, + gc->getYMax() / pitch ); cur.density_ = densityThreshold/density; _densityLimits.push_back(cur); @@ -804,6 +804,10 @@ namespace Etesian { void EtesianEngine::place () { + if(getCell()->isPlaced()){ + cmess2 << Warning("The cell is already placed; returning") << std::endl; + return; + } getCell()->uniquify(); getConfiguration()->print( getCell() ); @@ -964,11 +968,11 @@ namespace Etesian { { UpdateSession::open(); - forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() ) + for ( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() ) { Point instancePosition; - Instance* instance = static_cast((*ioccurrence).getEntity()); - string instanceName = (*ioccurrence).getCompactString(); + Instance* instance = static_cast(occurrence.getEntity()); + string instanceName = occurrence.getCompactString(); // Remove the enclosing brackets... instanceName.erase( 0, 1 ); instanceName.erase( instanceName.size()-1 ); diff --git a/hurricane/src/hurricane/hurricane/Collection.h b/hurricane/src/hurricane/hurricane/Collection.h index 94465beb..58c30ea1 100644 --- a/hurricane/src/hurricane/hurricane/Collection.h +++ b/hurricane/src/hurricane/hurricane/Collection.h @@ -195,6 +195,24 @@ template class Collection { return record; } + public: + class iterator{ + Locator* _locator; + + public: iterator(Locator* l) : _locator(l) {} + public: bool operator!=(iterator const & o) const { + bool invalidA = ( _locator == NULL) or not( _locator->isValid()); + bool invalidB = (o._locator == NULL) or not(o._locator->isValid()); + return invalidA != invalidB or (not invalidA and not invalidB and _locator != o._locator); + } + public: bool operator==(iterator const & o) const { return not(*this != o); } + public: iterator& operator++(){ _locator->progress(); return *this; } + public: Type operator*() { return _locator->getElement(); } + }; + + public: iterator begin() { return iterator(getLocator()); } + public: iterator end() { return iterator(NULL); } + public: bool empty() { return begin() == end(); } }; diff --git a/kite/src/BuildPowerRails.cpp b/kite/src/BuildPowerRails.cpp index af9bebd4..6a6a377b 100644 --- a/kite/src/BuildPowerRails.cpp +++ b/kite/src/BuildPowerRails.cpp @@ -87,16 +87,16 @@ namespace { void destroyRing ( Net* net ) { - forEach ( RoutingPad*, irp, net->getRoutingPads() ) { + for( RoutingPad* rp : net->getRoutingPads() ) { bool allMasters = true; vector ring; - forEach ( Hook*, ihook, irp->getBodyHook()->getHooks() ) { - if (not ihook->isMaster()) { allMasters = false; break; } - ring.push_back( *ihook ); + for( Hook* hook : rp->getBodyHook()->getHooks() ) { + if (not hook->isMaster()) { allMasters = false; break; } + ring.push_back( hook ); } if (allMasters) { - for ( auto ihook : ring ) { - ihook->_setNextHook( ihook ); + for ( auto hook : ring ) { + hook->_setNextHook( hook ); } } } @@ -183,27 +183,27 @@ namespace { AllianceFramework* af = AllianceFramework::get(); bool hasPad = false; - forEach ( Instance*, iinstance, _topCell->getInstances() ) { - if (af->isPad(iinstance->getMasterCell())) { + for( Instance* instance : _topCell->getInstances() ) { + if (af->isPad(instance->getMasterCell())) { if (not hasPad) { cmess1 << " o Design has pads, assuming complete chip top structure." << endl; hasPad = true; } - string padName = getString( iinstance->getMasterCell()->getName() ); + string padName = getString( instance->getMasterCell()->getName() ); if (padName.substr(0,8) == "pvddeck_") { - cmess1 << " o Reference power pad: " << iinstance->getName() - << "(model:" << iinstance->getMasterCell()->getName() << ")." << endl; + cmess1 << " o Reference power pad: " << instance->getName() + << "(model:" << instance->getMasterCell()->getName() << ")." << endl; // Guessing the power, ground and clock nets from *this* pad connexions. - forEach ( Plug*, iplug, iinstance->getPlugs() ) { - Net* masterNet = iplug->getMasterNet(); + for( Plug* plug : instance->getPlugs() ) { + Net* masterNet = plug->getMasterNet(); Net::Type netType = masterNet->getType(); if ( (netType != Net::Type::POWER ) and (netType != Net::Type::GROUND) and (netType != Net::Type::CLOCK ) ) continue; - Net* net = iplug->getNet(); + Net* net = plug->getNet(); if (not net) { net = _topCell->getNet( masterNet->getName() ); if (not net) { @@ -216,15 +216,15 @@ namespace { } } - padName = getString( iinstance->getMasterCell()->getName() ); + padName = getString( instance->getMasterCell()->getName() ); if (padName.substr(0,4) == "pck_") { - cmess1 << " o Reference clock pad: " << iinstance->getName() - << "(model:" << iinstance->getMasterCell()->getName() << ")." << endl; + cmess1 << " o Reference clock pad: " << instance->getName() + << "(model:" << instance->getMasterCell()->getName() << ")." << endl; // Guessing external clock net *only* from *this* pad connexions. - forEach ( Plug*, iplug, iinstance->getPlugs() ) { - Net* masterNet = iplug->getMasterNet(); - Net* net = iplug->getNet(); + for( Plug* plug : instance->getPlugs() ) { + Net* masterNet = plug->getMasterNet(); + Net* net = plug->getNet(); if (not net) { net = _topCell->getNet( masterNet->getName() ); if (not net) { @@ -259,17 +259,17 @@ namespace { _vssiPadNetName = ""; _ckoPadNetName = ""; - forEach ( Net*, inet, _topCell->getNets() ) { - Net::Type netType = inet->getType(); + for( Net* net : _topCell->getNets() ) { + Net::Type netType = net->getType(); if (netType == Net::Type::CLOCK) { - if (not inet->isExternal()) continue; + if (not net->isExternal()) continue; if (_ckoPadNetName.isEmpty()) { - cmess1 << " - Using <" << inet->getName() << "> as internal (core) clock net." << endl; - _ckoPadNetName = inet->getName(); - _cko = *inet; - if (NetRoutingExtension::isMixedPreRoute(*inet)) { + cmess1 << " - Using <" << net->getName() << "> as internal (core) clock net." << endl; + _ckoPadNetName = net->getName(); + _cko = net; + if (NetRoutingExtension::isMixedPreRoute(net)) { cmess1 << " (core clock net is already routed)" << endl; _flags |= ClockIsRouted; } else { @@ -278,22 +278,22 @@ namespace { } else { cerr << Error("Second clock net <%s> net at top block level will be ignored.\n" " (will consider only <%s>)" - , getString(inet ->getName()).c_str() + , getString(net ->getName()).c_str() , getString(_cko->getName()).c_str() ) << endl; } } - if (NetRoutingExtension::isManualGlobalRoute(*inet)) continue; + if (NetRoutingExtension::isManualGlobalRoute(net)) continue; if (netType == Net::Type::POWER) { if (_vddiPadNetName.isEmpty()) { - _vddiPadNetName = inet->getName(); - _vddi = *inet; + _vddiPadNetName = net->getName(); + _vddi = net; } else { cerr << Error("Second power supply net <%s> net at top block level will be ignored.\n" " (will consider only <%s>)" - , getString(inet ->getName()).c_str() + , getString(net ->getName()).c_str() , getString(_vddi->getName()).c_str() ) << endl; } @@ -301,12 +301,12 @@ namespace { if (netType == Net::Type::GROUND) { if (_vssiPadNetName.isEmpty()) { - _vssiPadNetName = inet->getName(); - _vssi = *inet; + _vssiPadNetName = net->getName(); + _vssi = net; } else { cerr << Error("Second power ground net <%s> net at top block level will be ignored.\n" " (will consider only <%s>)" - , getString(inet ->getName()).c_str() + , getString(net ->getName()).c_str() , getString(_vssi->getName()).c_str() ) << endl; } @@ -943,8 +943,8 @@ namespace { Technology* technology = DataBase::getDB()->getTechnology(); RoutingGauge* rg = _kite->getConfiguration()->getRoutingGauge(); - forEach ( Layer*, iLayer, technology->getLayers() ) { - RegularLayer* regular = dynamic_cast(*iLayer); + for( Layer* layer : technology->getLayers() ) { + RegularLayer* regular = dynamic_cast(layer); if ( not regular or (regular->getBasicLayer()->getMaterial() != BasicLayer::Material::metal) ) continue; @@ -1300,14 +1300,14 @@ namespace Kite { QueryPowerRails query ( this ); Technology* technology = DataBase::getDB()->getTechnology(); - forEach ( BasicLayer*, iLayer, technology->getBasicLayers() ) { - if ( (iLayer->getMaterial() != BasicLayer::Material::metal) - and (iLayer->getMaterial() != BasicLayer::Material::blockage) ) + for( BasicLayer* layer : technology->getBasicLayers() ) { + if ( (layer->getMaterial() != BasicLayer::Material::metal) + and (layer->getMaterial() != BasicLayer::Material::blockage) ) continue; - if (_configuration->isGMetal(*iLayer)) continue; - if (not query.hasBasicLayer(*iLayer)) continue; + if (_configuration->isGMetal(layer)) continue; + if (not query.hasBasicLayer(layer)) continue; - query.setBasicLayer( *iLayer ); + query.setBasicLayer( layer ); query.doQuery (); } query.ringAddToPowerRails(); diff --git a/kite/src/BuildPreRouteds.cpp b/kite/src/BuildPreRouteds.cpp index 2b639830..5e024a4e 100644 --- a/kite/src/BuildPreRouteds.cpp +++ b/kite/src/BuildPreRouteds.cpp @@ -91,10 +91,10 @@ namespace Kite { { cmess1 << " o Looking for fixed or manually global routed nets." << endl; - forEach ( Net*, inet, getCell()->getNets() ) { - if (*inet == _blockageNet) continue; - if (inet->getType() == Net::Type::POWER ) continue; - if (inet->getType() == Net::Type::GROUND) continue; + for( Net* net : getCell()->getNets() ) { + if (net == _blockageNet) continue; + if (net->getType() == Net::Type::POWER ) continue; + if (net->getType() == Net::Type::GROUND) continue; // Don't skip the clock. vector segments; @@ -104,39 +104,39 @@ namespace Kite { bool isFixed = false; size_t rpCount = 0; - if (inet->isDeepNet()) { + if (net->isDeepNet()) { rpCount = 2; Net* rootNet = dynamic_cast( - dynamic_cast(*inet)->getRootNetOccurrence().getEntity() ); - forEach ( Component*, icomponent, rootNet->getComponents() ) { - if (dynamic_cast(*icomponent)) { isFixed = true; break; } - if (dynamic_cast (*icomponent)) { isFixed = true; break; } - if (dynamic_cast (*icomponent)) { isFixed = true; break; } + dynamic_cast(net)->getRootNetOccurrence().getEntity() ); + for( Component* component : rootNet->getComponents() ) { + if (dynamic_cast(component)) { isFixed = true; break; } + if (dynamic_cast (component)) { isFixed = true; break; } + if (dynamic_cast (component)) { isFixed = true; break; } } } else { - forEach ( Component*, icomponent, inet->getComponents() ) { - if (dynamic_cast(*icomponent)) continue; + for( Component* component : net->getComponents() ) { + if (dynamic_cast(component)) continue; - const RegularLayer* layer = dynamic_cast(icomponent->getLayer()); + const RegularLayer* layer = dynamic_cast(component->getLayer()); if (layer and (layer->getBasicLayer()->getMaterial() == BasicLayer::Material::blockage)) continue; - Horizontal* horizontal = dynamic_cast(*icomponent); + Horizontal* horizontal = dynamic_cast(component); if (horizontal) { segments.push_back( horizontal ); isPreRouted = true; if (horizontal->getWidth() != Session::getWireWidth(horizontal->getLayer())) isFixed = true; } else { - Vertical* vertical = dynamic_cast(*icomponent); + Vertical* vertical = dynamic_cast(component); if (vertical) { isPreRouted = true; segments.push_back( vertical ); if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer())) isFixed = true; } else { - Contact* contact = dynamic_cast(*icomponent); + Contact* contact = dynamic_cast(component); if (contact) { isPreRouted = true; contacts.push_back( contact ); @@ -144,11 +144,11 @@ namespace Kite { or (contact->getHeight() != Session::getViaWidth(contact->getLayer())) ) isFixed = true; } else { - RoutingPad* rp = dynamic_cast(*icomponent); + RoutingPad* rp = dynamic_cast(component); if (rp) { ++rpCount; } else { - // Plug* plug = dynamic_cast(*icomponent); + // Plug* plug = dynamic_cast(component); // if (plug) { // cerr << "buildPreRouteds(): " << plug << endl; // ++rpCount; @@ -161,19 +161,19 @@ namespace Kite { } if (isFixed or isPreRouted or (rpCount < 2)) { - NetRoutingState* state = getRoutingState( *inet, Katabatic::KbCreate ); + NetRoutingState* state = getRoutingState( net, Katabatic::KbCreate ); state->unsetFlags( NetRoutingState::AutomaticGlobalRoute ); state->setFlags ( NetRoutingState::ManualGlobalRoute ); if (rpCount < 2) state->setFlags ( NetRoutingState::Unconnected ); if (isFixed) { - cmess2 << " - <" << (*inet)->getName() << "> is fixed." << endl; + cmess2 << " - <" << net->getName() << "> is fixed." << endl; state->unsetFlags( NetRoutingState::ManualGlobalRoute ); state->setFlags ( NetRoutingState::Fixed ); } else { if (rpCount > 1) { - cmess2 << " - <" << (*inet)->getName() << "> is manually global routed." << endl; + cmess2 << " - <" << net->getName() << "> is manually global routed." << endl; for ( auto icontact : contacts ) { AutoContact::createFrom( icontact ); } diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 79540cb5..a691f1ec 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -216,13 +216,13 @@ namespace Kite { throw Error("Trying to wipe out a routing with a routing engine\n"); using namespace Hurricane; UpdateSession::open(); - forEach(Net*, inet, cell->getNets()){ - if(NetRoutingExtension::isManualGlobalRoute(*inet)) + for(Net* net : cell->getNets()){ + if(NetRoutingExtension::isManualGlobalRoute(net)) continue; // First pass: destroy the contacts std::vector contactPointers; - forEach(Component*, icom, (*inet)->getComponents()){ - Contact * contact = dynamic_cast(*icom); + for(Component* com : net->getComponents()){ + Contact * contact = dynamic_cast(com); if(contact){ contactPointers.push_back(contact); } @@ -231,12 +231,12 @@ namespace Kite { contact->destroy(); // Second pass: destroy unconnected segments added by Knik as blockages std::vector compPointers; - forEach(Component*, icom, (*inet)->getComponents()){ - Horizontal * h = dynamic_cast(*icom); + for(Component* com : net->getComponents()){ + Horizontal * h = dynamic_cast(com); if(h){ compPointers.push_back(h); } - Vertical * v = dynamic_cast(*icom); + Vertical * v = dynamic_cast(com); if(v){ compPointers.push_back(v); } @@ -348,12 +348,12 @@ namespace Kite { size_t coreReserved = 0; size_t coronaReserved = 4; - forEach ( Knik::Vertex*, ivertex, _knik->getRoutingGraph()->getVertexes() ) { + for( Knik::Vertex* vertex : _knik->getRoutingGraph()->getVertexes() ) { for ( int i=0 ; i<2 ; ++i ) { Knik::Edge* edge = NULL; if (i==0) { - edge = ivertex->getHEdgeOut(); + edge = vertex->getHEdgeOut(); if (not edge) continue; if (chipTools.hPadsEnclosed(edge->getBoundingBox())) { @@ -362,7 +362,7 @@ namespace Kite { } coreReserved = getHTracksReservedLocal(); } else { - edge = ivertex->getVEdgeOut(); + edge = vertex->getVEdgeOut(); if (not edge) continue; if (chipTools.vPadsEnclosed(edge->getBoundingBox())) { @@ -782,13 +782,13 @@ namespace Kite { coherency = _routingPlanes[i]->_check(overlap) and coherency; Katabatic::Session* ktbtSession = Session::base (); - forEach ( Net*, inet, getCell()->getNets() ) { - forEach ( Segment*, isegment, inet->getComponents().getSubSet() ) { - AutoSegment* autoSegment = ktbtSession->lookup( *isegment ); + for( Net* net : getCell()->getNets() ) { + for( Segment* segment : net->getComponents().getSubSet() ) { + AutoSegment* autoSegment = ktbtSession->lookup( segment ); if (not autoSegment) continue; if (not autoSegment->isCanonical()) continue; - TrackElement* trackSegment = Session::lookup( *isegment ); + TrackElement* trackSegment = Session::lookup( segment ); if (not trackSegment) { coherency = false; cerr << Bug( "%p %s without Track Segment" @@ -857,8 +857,8 @@ namespace Kite { { cerr << " o Checking " << net << endl; - forEach ( Segment*, isegment, net->getComponents().getSubSet() ) { - TrackElement* trackSegment = _lookup( *isegment ); + for( Segment* segment : net->getComponents().getSubSet() ) { + TrackElement* trackSegment = _lookup( segment ); if (trackSegment) { trackSegment->_check(); diff --git a/kite/src/Manipulator.cpp b/kite/src/Manipulator.cpp index 7c95b2fc..47b26354 100644 --- a/kite/src/Manipulator.cpp +++ b/kite/src/Manipulator.cpp @@ -716,24 +716,24 @@ namespace Kite { continue; canonicals.clear (); - forEach ( TrackElement*, isegment3 - , segment2->getPerpandiculars().getSubSet(TrackElements_UniqCanonical(canonicals)) ) { - DataNegociate* data3 = isegment3->getDataNegociate(); + for( TrackElement* segment3 + : segment2->getPerpandiculars().getSubSet(TrackElements_UniqCanonical(canonicals)) ) { + DataNegociate* data3 = segment3->getDataNegociate(); if ( not data3 ) continue; RoutingEvent* event3 = data3->getRoutingEvent(); if ( not event3 ) continue; if ( not toFree.intersect(event3->getConstraints()) ) { - ltrace(200) << " . " << *isegment3 << endl; + ltrace(200) << " . " << segment3 << endl; continue; } - ltrace(200) << " | " << *isegment3 << endl; + ltrace(200) << " | " << segment3 << endl; if ( shrinkRight xor shrinkLeft ) { if ( shrinkRight ) { - if ( not (success=Manipulator(*isegment3,_fsm) + if ( not (success=Manipulator(segment3,_fsm) .ripup( SegmentAction::OtherRipupPerpandAndPushAside , toFree.getVMin() - getPPitch()/2 )) ) @@ -741,28 +741,28 @@ namespace Kite { if ( event3->getTracksFree() == 1 ) { ltrace(200) << "Potential left intrication with other perpandicular." << endl; - if ( isegment3->getAxis() == segment2->getTargetU() - Session::getExtensionCap(getLayer()) ) { + if ( segment3->getAxis() == segment2->getTargetU() - Session::getExtensionCap(getLayer()) ) { leftIntrication = true; - leftAxisHint = isegment3->getAxis(); + leftAxisHint = segment3->getAxis(); } } } if ( shrinkLeft ) { - if ( not (success=Manipulator(*isegment3,_fsm) + if ( not (success=Manipulator(segment3,_fsm) .ripup( SegmentAction::OtherRipupPerpandAndPushAside , toFree.getVMax() + getPPitch()/2 )) ) break; if ( event3->getTracksFree() == 1 ) { ltrace(200) << "Potential right intrication with other perpandicular." << endl; - if ( isegment3->getAxis() == segment2->getSourceU() + Session::getExtensionCap(getLayer()) ) { + if ( segment3->getAxis() == segment2->getSourceU() + Session::getExtensionCap(getLayer()) ) { rightIntrication = true; - rightAxisHint = isegment3->getAxis(); + rightAxisHint = segment3->getAxis(); } } } } else { - if ( not (success=Manipulator(*isegment3,_fsm).ripup( SegmentAction::OtherRipup + if ( not (success=Manipulator(segment3,_fsm).ripup( SegmentAction::OtherRipup | SegmentAction::EventLevel3 )) ) break; @@ -828,16 +828,16 @@ namespace Kite { continue; canonicals.clear(); - forEach ( TrackElement*, isegment3 - , segment2->getPerpandiculars().getSubSet(TrackElements_UniqCanonical(canonicals)) ) { - DataNegociate* data3 = isegment3->getDataNegociate(); + for( TrackElement* segment3 + : segment2->getPerpandiculars().getSubSet(TrackElements_UniqCanonical(canonicals)) ) { + DataNegociate* data3 = segment3->getDataNegociate(); if (not data3) continue; RoutingEvent* event3 = data3->getRoutingEvent(); if (not event3) continue; - if (Manipulator(*isegment3,_fsm).canRipup()) - _fsm.addAction( *isegment3, SegmentAction::OtherRipup ); + if (Manipulator(segment3,_fsm).canRipup()) + _fsm.addAction( segment3, SegmentAction::OtherRipup ); } } @@ -1008,13 +1008,13 @@ namespace Kite { RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(_segment->getLayer()); ltracein(200); - forEach ( Track*, itrack, Tracks_Range::get(plane,uside)) { + for( Track* track : Tracks_Range::get(plane,uside)) { size_t begin; size_t end; - itrack->getOverlapBounds( _segment->getCanonicalInterval(), begin, end ); + track->getOverlapBounds( _segment->getCanonicalInterval(), begin, end ); for ( ; begin < end ; begin++ ) { - TrackElement* other = itrack->getSegment(begin); + TrackElement* other = track->getSegment(begin); ltrace(200) << "| " << other << endl; if (other->getNet() == net) continue; diff --git a/kite/src/NegociateWindow.cpp b/kite/src/NegociateWindow.cpp index 3427bdd7..7d07e08b 100644 --- a/kite/src/NegociateWindow.cpp +++ b/kite/src/NegociateWindow.cpp @@ -117,17 +117,17 @@ namespace { AllianceFramework* af = AllianceFramework::get (); RoutingGauge* rg = nw->getKiteEngine()->getRoutingGauge(); - forEach ( Net*, inet, nw->getCell()->getNets() ) { - if (inet->getType() == Net::Type::POWER ) continue; - if (inet->getType() == Net::Type::GROUND) continue; - if (inet->getType() == Net::Type::CLOCK ) continue; - if (af->isBLOCKAGE(inet->getName())) continue; + for( Net* net : nw->getCell()->getNets() ) { + if (net->getType() == Net::Type::POWER ) continue; + if (net->getType() == Net::Type::GROUND) continue; + if (net->getType() == Net::Type::CLOCK ) continue; + if (af->isBLOCKAGE(net->getName())) continue; - forEach ( RoutingPad*, irp, inet->getRoutingPads() ) { - size_t depth = rg->getLayerDepth(irp->getLayer()); + for( RoutingPad* rp : net->getRoutingPads() ) { + size_t depth = rg->getLayerDepth(rp->getLayer()); if (depth > 0) continue; if (depth == 0) - TrackMarker::create( *irp, 1 ); + TrackMarker::create( rp, 1 ); } } } @@ -326,8 +326,8 @@ namespace Kite { const vector& contacts = _gcells[igcell]->getContacts(); for ( size_t i=0 ; igetBodyHook()->getSlaveHooks() ) { - Hook* sourceHook = dynamic_cast(*ihook); + for( Hook* hook : contacts[i]->getBodyHook()->getSlaveHooks() ) { + Hook* sourceHook = dynamic_cast(hook); if (not sourceHook) continue; segment = dynamic_cast(sourceHook->getComponent()); @@ -360,8 +360,8 @@ namespace Kite { ltrace(149) << "AutoSegments from AutoContacts" << endl; const vector& contacts = gcell->getContacts(); for ( size_t i=0 ; igetSlaveComponents() ) { - segment = dynamic_cast(*component); + for( Component* component : contacts[i]->getSlaveComponents() ) { + segment = dynamic_cast(component); autoSegment = Session::base()->lookup( segment ); ltrace(149) << autoSegment << endl; if (autoSegment and autoSegment->isCanonical()) { diff --git a/kite/src/PreProcess.cpp b/kite/src/PreProcess.cpp index cc8245e1..e367bc2e 100644 --- a/kite/src/PreProcess.cpp +++ b/kite/src/PreProcess.cpp @@ -49,8 +49,8 @@ namespace { ) { TrackElement* perpandicular; - forEach ( Segment*, isegment, segment->base()->getAutoSource()->getSlaveComponents().getSubSet() ) { - perpandicular = Session::lookup ( *isegment ); + for( Segment* osegment : segment->base()->getAutoSource()->getSlaveComponents().getSubSet() ) { + perpandicular = Session::lookup ( osegment ); ltrace(200) << "S " << perpandicular << endl; if ( not perpandicular or (perpandicular->getDirection() == direction) ) continue; @@ -58,8 +58,8 @@ namespace { perpandiculars.push_back ( perpandicular ); } - forEach ( Segment*, isegment, segment->base()->getAutoTarget()->getSlaveComponents().getSubSet() ) { - perpandicular = Session::lookup ( *isegment ); + for( Segment* osegment : segment->base()->getAutoTarget()->getSlaveComponents().getSubSet() ) { + perpandicular = Session::lookup ( osegment ); ltrace(200) << "T " << perpandicular << endl; if ( not perpandicular or (perpandicular->getDirection() == direction) ) continue; @@ -74,8 +74,8 @@ namespace { ltrace(200) << "Find failed caging: " << rp << endl; TrackElement* parallel; - forEach ( Segment*, isegment, rp->getSlaveComponents().getSubSet() ) { - parallel = Session::lookup ( *isegment ); + for( Segment* osegment : rp->getSlaveComponents().getSubSet() ) { + parallel = Session::lookup ( osegment ); ltrace(200) << "* " << parallel << endl; if ( parallel->isFixed () ) continue; @@ -156,8 +156,8 @@ namespace { rp = dynamic_cast(source->getAnchor()); if (rp) { TrackElement* parallel; - forEach ( Segment*, isegment, rp->getSlaveComponents().getSubSet() ) { - parallel = Session::lookup( *isegment ); + for( Segment* osegment : rp->getSlaveComponents().getSubSet() ) { + parallel = Session::lookup( osegment ); ltrace(200) << "* " << parallel << endl; if (parallel->isFixed ()) continue; @@ -207,8 +207,8 @@ namespace { Katabatic::AutoContact* support = segment->base()->getAutoSource(); RoutingPad* rp = dynamic_cast(support->getAnchor()); - forEach( Component*, icomponent, rp->getSlaveComponents() ) { - Horizontal* baseSegment = dynamic_cast( *icomponent ); + for( Component* component : rp->getSlaveComponents() ) { + Horizontal* baseSegment = dynamic_cast( component ); TrackElement* accessSegment = Session::lookup( baseSegment ); if (accessSegment and not accessSegment->isFixed()) { diff --git a/kite/src/ProtectRoutingPads.cpp b/kite/src/ProtectRoutingPads.cpp index 8ebc89dc..309db737 100644 --- a/kite/src/ProtectRoutingPads.cpp +++ b/kite/src/ProtectRoutingPads.cpp @@ -80,16 +80,16 @@ namespace { vector segments; - forEach ( Segment*, isegment, masterNet->getSegments() ) { - RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(isegment->getLayer()); + for( Segment* segment : masterNet->getSegments() ) { + RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(segment->getLayer()); if ( plane == NULL ) continue; - if ( usedComponent == dynamic_cast(*isegment) ) continue; - if ( not NetExternalComponents::isExternal(*isegment) ) continue; + if ( usedComponent == dynamic_cast(segment) ) continue; + if ( not NetExternalComponents::isExternal(segment) ) continue; //cerr << "Looking " << (void*)*isegment << ":" << *isegment << endl; - segments.push_back ( *isegment ); + segments.push_back ( segment ); } for ( size_t i=0 ; igetNets() ) { - if ( (*inet)->isSupply() ) continue; + for( Net* net : getCell()->getNets() ) { + if ( net->isSupply() ) continue; - NetRoutingState* state = getRoutingState( *inet ); + NetRoutingState* state = getRoutingState( net ); if (state and state->isFixed()) continue; vector rps; - forEach ( RoutingPad*, irp, (*inet)->getRoutingPads() ) { - rps.push_back ( *irp ); + for( RoutingPad* rp : net->getRoutingPads() ) { + rps.push_back ( rp ); } for ( size_t i=0 ; ibase()->getAutoSource()->getGCell()->getGlobalsCount(depth) >= 9.0); RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(segment->getLayer()); - forEach ( Track*, itrack, Tracks_Range::get(plane,_constraint)) { + for( Track* track : Tracks_Range::get(plane,_constraint)) { unsigned int costflags = 0; costflags |= (segment->isLocal() and (depth >= 3)) ? TrackCost::LocalAndTopDepth : 0; - _costs.push_back ( itrack->getOverlapCost(segment,costflags) ); - _costs.back().setAxisWeight ( _event->getAxisWeight(itrack->getAxis()) ); - _costs.back().incDeltaPerpand ( _data->getWiringDelta(itrack->getAxis()) ); + _costs.push_back ( track->getOverlapCost(segment,costflags) ); + _costs.back().setAxisWeight ( _event->getAxisWeight(track->getAxis()) ); + _costs.back().incDeltaPerpand ( _data->getWiringDelta(track->getAxis()) ); if (segment->isGlobal()) { - ltrace(500) << "Deter| setForGlobal() on " << *itrack << endl; + ltrace(500) << "Deter| setForGlobal() on " << track << endl; _costs.back().setForGlobal(); } @@ -528,7 +528,7 @@ namespace Kite { if ( _fullBlocked and (not _costs.back().isBlockage() and not _costs.back().isFixed()) ) _fullBlocked = false; - ltrace(149) << "| " << _costs.back() << ((_fullBlocked)?" FB ": " -- ") << (*itrack) << endl; + ltrace(149) << "| " << _costs.back() << ((_fullBlocked)?" FB ": " -- ") << track << endl; } ltraceout(148); diff --git a/kite/src/TrackSegment.cpp b/kite/src/TrackSegment.cpp index 06e22900..cbbcea47 100644 --- a/kite/src/TrackSegment.cpp +++ b/kite/src/TrackSegment.cpp @@ -216,16 +216,16 @@ namespace Kite { ltrace(148) << "getGCells(): sourceGCell: " << sourceGCell << endl; ltrace(148) << "getGCells(): targetGCell: " << targetGCell << endl; - forEach ( AutoSegment*, isegment, base()->getAligneds() ) { - ltrace(148) << "| " << *isegment << endl; + for( AutoSegment* segment : base()->getAligneds() ) { + ltrace(148) << "| " << segment << endl; - Katabatic::GCell* gcell = isegment->getAutoSource()->getGCell(); + Katabatic::GCell* gcell = segment->getAutoSource()->getGCell(); if (gcell->getIndex() < sourceGCell->getIndex()) { sourceGCell = gcell; ltrace(148) << "getGCells(): new sourceGCell: " << sourceGCell << endl; } - gcell = isegment->getAutoTarget()->getGCell(); + gcell = segment->getAutoTarget()->getGCell(); if (gcell->getIndex() > targetGCell->getIndex()) { targetGCell = gcell; ltrace(148) << "getGCells(): new targetGCell: " << targetGCell << endl; @@ -502,8 +502,8 @@ namespace Kite { unsigned int direction = perpandicularTo( getDirection() ); TrackElement* dogleg = NULL; - forEach ( Segment*, isegment, base()->getAutoSource()->getSlaveComponents().getSubSet() ) { - dogleg = Session::lookup( *isegment ); + for( Segment* segment : base()->getAutoSource()->getSlaveComponents().getSubSet() ) { + dogleg = Session::lookup( segment ); if (dogleg and (dogleg->getDirection() == direction)) { ltrace(200) << "Source dogleg: " << dogleg << endl; return dogleg; @@ -519,8 +519,8 @@ namespace Kite { unsigned int direction = perpandicularTo( getDirection() ); TrackElement* dogleg = NULL; - forEach ( Segment*, isegment, base()->getAutoTarget()->getSlaveComponents().getSubSet() ) { - dogleg = Session::lookup( *isegment ); + for( Segment* segment : base()->getAutoTarget()->getSlaveComponents().getSubSet() ) { + dogleg = Session::lookup( segment ); if (dogleg and (dogleg->getDirection() == direction)) { ltrace(200) << "Target dogleg: " << dogleg << endl; return dogleg; diff --git a/unicorn/src/UnicornGui.cpp b/unicorn/src/UnicornGui.cpp index 3f76ad2d..ccdb0c75 100644 --- a/unicorn/src/UnicornGui.cpp +++ b/unicorn/src/UnicornGui.cpp @@ -89,10 +89,10 @@ namespace Unicorn { _runUnicornInit(); _importCell.setDialog( _importDialog ); + _importCell.addImporter( "BLIF (Yosys/ABC)" , std::bind( &Blif::load , placeholders::_1 ) ); _importCell.addImporter( "ACM/SIGDA (aka MCNC, .bench)", std::bind( &AcmSigda::load , placeholders::_1 ) ); _importCell.addImporter( "ISPD'04 (Bookshelf)" , std::bind( &Ispd04::load , placeholders::_1 ) ); _importCell.addImporter( "ISPD'05 (Bookshelf)" , std::bind( &Ispd05::load , placeholders::_1 ) ); - _importCell.addImporter( "BLIF (Yosys/ABC)" , std::bind( &Blif::load , placeholders::_1 ) ); _importCell.addImporter( "ICCAD'04 (LEF/DEF)" , std::bind( &Iccad04Lefdef::load, placeholders::_1, 0 ) ); _importCell.addImporter( "Alliance compliant DEF" , std::bind( &DefImport::load , placeholders::_1, DefImport::FitAbOnCells) );