Basic STL-compliant collections

Ported etesian and kite to use them
This commit is contained in:
Gabriel Gouvine 2015-05-26 14:31:38 +02:00
parent 20ac9080d6
commit 63b1f5abb0
11 changed files with 198 additions and 180 deletions

View File

@ -353,17 +353,17 @@ namespace Etesian {
double cellLength = 0; double cellLength = 0;
vector<Occurrence> feedOccurrences; vector<Occurrence> feedOccurrences;
forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() ) for( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() )
{ {
Instance* instance = static_cast<Instance*>((*ioccurrence).getEntity()); Instance* instance = static_cast<Instance*>(occurrence.getEntity());
Cell* masterCell = instance->getMasterCell(); Cell* masterCell = instance->getMasterCell();
string instanceName = (*ioccurrence).getCompactString(); string instanceName = occurrence.getCompactString();
if (CatalogExtension::isFeed(masterCell)) { if (CatalogExtension::isFeed(masterCell)) {
cerr << Warning( "Found a feedcell %s in an unplaced design, removing." cerr << Warning( "Found a feedcell %s in an unplaced design, removing."
, instanceName.c_str() , instanceName.c_str()
) << endl; ) << endl;
feedOccurrences.push_back( *ioccurrence ); feedOccurrences.push_back( occurrence );
continue; continue;
} }
@ -409,19 +409,19 @@ namespace Etesian {
UpdateSession::open(); UpdateSession::open();
vector<Occurrence> feedOccurrences; vector<Occurrence> feedOccurrences;
forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() ) for( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() )
{ {
dots.dot(); dots.dot();
if ( _flatDesign and not (*ioccurrence).getPath().getTailPath().isEmpty()) if ( _flatDesign and not occurrence.getPath().getTailPath().isEmpty())
_flatDesign = true; _flatDesign = true;
Instance* instance = static_cast<Instance*>((*ioccurrence).getEntity()); Instance* instance = static_cast<Instance*>(occurrence.getEntity());
Cell* masterCell = instance->getMasterCell(); Cell* masterCell = instance->getMasterCell();
string instanceName = (*ioccurrence).getCompactString(); string instanceName = occurrence.getCompactString();
if (CatalogExtension::isFeed(masterCell)) { if (CatalogExtension::isFeed(masterCell)) {
feedOccurrences.push_back( *ioccurrence ); feedOccurrences.push_back( occurrence );
} }
} }
@ -466,9 +466,9 @@ namespace Etesian {
Box topAb = getCell()->getAbutmentBox(); Box topAb = getCell()->getAbutmentBox();
UpdateSession::open(); UpdateSession::open();
forEach ( Occurrence, ioccurrence, getCell()->getNonLeafInstanceOccurrences() ) for ( Occurrence occurrence : getCell()->getNonLeafInstanceOccurrences() )
{ {
Instance* instance = static_cast<Instance*>((*ioccurrence).getEntity()); Instance* instance = static_cast<Instance*>(occurrence.getEntity());
Cell* masterCell = instance->getMasterCell(); Cell* masterCell = instance->getMasterCell();
if (masterCell->getAbutmentBox().isEmpty()) { if (masterCell->getAbutmentBox().isEmpty()) {
@ -481,11 +481,11 @@ namespace Etesian {
UpdateSession::close(); UpdateSession::close();
index_t instanceId = 0; index_t instanceId = 0;
forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() ) for ( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() )
{ {
Instance* instance = static_cast<Instance*>((*ioccurrence).getEntity()); Instance* instance = static_cast<Instance*>(occurrence.getEntity());
Cell* masterCell = instance->getMasterCell(); Cell* masterCell = instance->getMasterCell();
string instanceName = (*ioccurrence).getCompactString(); string instanceName = occurrence.getCompactString();
// Remove the enclosing brackets... // Remove the enclosing brackets...
instanceName.erase( 0, 1 ); instanceName.erase( 0, 1 );
instanceName.erase( instanceName.size()-1 ); instanceName.erase( instanceName.size()-1 );
@ -498,7 +498,7 @@ namespace Etesian {
Box instanceAb = masterCell->getAbutmentBox(); Box instanceAb = masterCell->getAbutmentBox();
Transformation instanceTransf = instance->getTransformation(); Transformation instanceTransf = instance->getTransformation();
(*ioccurrence).getPath().getTransformation().applyOn( instanceTransf ); occurrence.getPath().getTransformation().applyOn( instanceTransf );
instanceTransf.applyOn( instanceAb ); instanceTransf.applyOn( instanceAb );
// Upper rounded // Upper rounded
@ -536,26 +536,26 @@ namespace Etesian {
vector<temporary_pin> pins; vector<temporary_pin> pins;
unsigned int netId = 0; unsigned int netId = 0;
forEach ( Net*, inet, getCell()->getNets() ) for ( Net* net : getCell()->getNets() )
{ {
const char* excludedType = NULL; const char* excludedType = NULL;
if ((*inet)->getType() == Net::Type::POWER ) excludedType = "POWER"; if (net->getType() == Net::Type::POWER ) excludedType = "POWER";
if ((*inet)->getType() == Net::Type::GROUND) excludedType = "GROUND"; if (net->getType() == Net::Type::GROUND) excludedType = "GROUND";
if ((*inet)->getType() == Net::Type::CLOCK ) excludedType = "CLOCK"; if (net->getType() == Net::Type::CLOCK ) excludedType = "CLOCK";
if (excludedType) { if (excludedType) {
cparanoid << Warning( "%s is not a routable net (%s,excluded)." cparanoid << Warning( "%s is not a routable net (%s,excluded)."
, getString(*inet).c_str(), excludedType ) << endl; , getString(net).c_str(), excludedType ) << endl;
continue; continue;
} }
if (af->isBLOCKAGE((*inet)->getName())) continue; if (af->isBLOCKAGE(net->getName())) continue;
dots.dot(); dots.dot();
nets[netId] = temporary_net( netId, 1 ); nets[netId] = temporary_net( netId, 1 );
forEach ( RoutingPad*, irp, (*inet)->getRoutingPads() ) { for ( RoutingPad* rp : net->getRoutingPads() ) {
string insName = extractInstanceName( *irp ); string insName = extractInstanceName( rp );
Point offset = extractRpOffset ( *irp ); Point offset = extractRpOffset ( rp );
int_t xpin = offset.getX() / pitch; int_t xpin = offset.getX() / pitch;
int_t ypin = offset.getY() / pitch; int_t ypin = offset.getY() / pitch;
@ -651,16 +651,16 @@ namespace Etesian {
// Create different densities // Create different densities
_densityLimits.clear(); _densityLimits.clear();
forEach(GCell*, gc, grid->getGCells()){ for(GCell* gc : grid->getGCells()){
float density = (*gc)->getMaxHVDensity(); float density = gc->getMaxHVDensity();
if(density >= densityThreshold){ if(density >= densityThreshold){
coloquinte::density_limit cur; coloquinte::density_limit cur;
cur.box_ = coloquinte::box<int_t>( cur.box_ = coloquinte::box<int_t>(
(*gc)->getX() / pitch, gc->getX() / pitch,
(*gc)->getXMax() / pitch, gc->getXMax() / pitch,
(*gc)->getY() / pitch, gc->getY() / pitch,
(*gc)->getYMax() / pitch gc->getYMax() / pitch
); );
cur.density_ = densityThreshold/density; cur.density_ = densityThreshold/density;
_densityLimits.push_back(cur); _densityLimits.push_back(cur);
@ -964,11 +964,11 @@ namespace Etesian {
{ {
UpdateSession::open(); UpdateSession::open();
forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() ) for ( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() )
{ {
Point instancePosition; Point instancePosition;
Instance* instance = static_cast<Instance*>((*ioccurrence).getEntity()); Instance* instance = static_cast<Instance*>(occurrence.getEntity());
string instanceName = (*ioccurrence).getCompactString(); string instanceName = occurrence.getCompactString();
// Remove the enclosing brackets... // Remove the enclosing brackets...
instanceName.erase( 0, 1 ); instanceName.erase( 0, 1 );
instanceName.erase( instanceName.size()-1 ); instanceName.erase( instanceName.size()-1 );

View File

@ -195,6 +195,24 @@ template<class Type> class Collection {
return record; return record;
} }
public:
class iterator{
Locator<Type>* _locator;
public: iterator(Locator<Type>* 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(); }
}; };

View File

@ -84,16 +84,16 @@ namespace {
void destroyRing ( Net* net ) void destroyRing ( Net* net )
{ {
forEach ( RoutingPad*, irp, net->getRoutingPads() ) { for( RoutingPad* rp : net->getRoutingPads() ) {
bool allMasters = true; bool allMasters = true;
vector<Hook*> ring; vector<Hook*> ring;
forEach ( Hook*, ihook, irp->getBodyHook()->getHooks() ) { for( Hook* hook : rp->getBodyHook()->getHooks() ) {
if (not ihook->isMaster()) { allMasters = false; break; } if (not hook->isMaster()) { allMasters = false; break; }
ring.push_back( *ihook ); ring.push_back( hook );
} }
if (allMasters) { if (allMasters) {
for ( auto ihook : ring ) { for ( auto hook : ring ) {
ihook->_setNextHook( ihook ); hook->_setNextHook( hook );
} }
} }
} }
@ -180,27 +180,27 @@ namespace {
AllianceFramework* af = AllianceFramework::get(); AllianceFramework* af = AllianceFramework::get();
bool hasPad = false; bool hasPad = false;
forEach ( Instance*, iinstance, _topCell->getInstances() ) { for( Instance* instance : _topCell->getInstances() ) {
if (af->isPad(iinstance->getMasterCell())) { if (af->isPad(instance->getMasterCell())) {
if (not hasPad) { if (not hasPad) {
cmess1 << " o Design has pads, assuming complete chip top structure." << endl; cmess1 << " o Design has pads, assuming complete chip top structure." << endl;
hasPad = true; hasPad = true;
} }
string padName = getString( iinstance->getMasterCell()->getName() ); string padName = getString( instance->getMasterCell()->getName() );
if (padName.substr(0,8) == "pvddeck_") { if (padName.substr(0,8) == "pvddeck_") {
cmess1 << " o Reference power pad: " << iinstance->getName() cmess1 << " o Reference power pad: " << instance->getName()
<< "(model:" << iinstance->getMasterCell()->getName() << ")." << endl; << "(model:" << instance->getMasterCell()->getName() << ")." << endl;
// Guessing the power, ground and clock nets from *this* pad connexions. // Guessing the power, ground and clock nets from *this* pad connexions.
forEach ( Plug*, iplug, iinstance->getPlugs() ) { for( Plug* plug : instance->getPlugs() ) {
Net* masterNet = iplug->getMasterNet(); Net* masterNet = plug->getMasterNet();
Net::Type netType = masterNet->getType(); Net::Type netType = masterNet->getType();
if ( (netType != Net::Type::POWER ) if ( (netType != Net::Type::POWER )
and (netType != Net::Type::GROUND) and (netType != Net::Type::GROUND)
and (netType != Net::Type::CLOCK ) ) continue; and (netType != Net::Type::CLOCK ) ) continue;
Net* net = iplug->getNet(); Net* net = plug->getNet();
if (not net) { if (not net) {
net = _topCell->getNet( masterNet->getName() ); net = _topCell->getNet( masterNet->getName() );
if (not net) { if (not net) {
@ -213,15 +213,15 @@ namespace {
} }
} }
padName = getString( iinstance->getMasterCell()->getName() ); padName = getString( instance->getMasterCell()->getName() );
if (padName.substr(0,4) == "pck_") { if (padName.substr(0,4) == "pck_") {
cmess1 << " o Reference clock pad: " << iinstance->getName() cmess1 << " o Reference clock pad: " << instance->getName()
<< "(model:" << iinstance->getMasterCell()->getName() << ")." << endl; << "(model:" << instance->getMasterCell()->getName() << ")." << endl;
// Guessing external clock net *only* from *this* pad connexions. // Guessing external clock net *only* from *this* pad connexions.
forEach ( Plug*, iplug, iinstance->getPlugs() ) { for( Plug* plug : instance->getPlugs() ) {
Net* masterNet = iplug->getMasterNet(); Net* masterNet = plug->getMasterNet();
Net* net = iplug->getNet(); Net* net = plug->getNet();
if (not net) { if (not net) {
net = _topCell->getNet( masterNet->getName() ); net = _topCell->getNet( masterNet->getName() );
if (not net) { if (not net) {
@ -256,17 +256,17 @@ namespace {
_vssiPadNetName = ""; _vssiPadNetName = "";
_ckoPadNetName = ""; _ckoPadNetName = "";
forEach ( Net*, inet, _topCell->getNets() ) { for( Net* net : _topCell->getNets() ) {
Net::Type netType = inet->getType(); Net::Type netType = net->getType();
if (netType == Net::Type::CLOCK) { if (netType == Net::Type::CLOCK) {
if (not inet->isExternal()) continue; if (not net->isExternal()) continue;
if (_ckoPadNetName.isEmpty()) { if (_ckoPadNetName.isEmpty()) {
cmess1 << " - Using <" << inet->getName() << "> as internal (core) clock net." << endl; cmess1 << " - Using <" << net->getName() << "> as internal (core) clock net." << endl;
_ckoPadNetName = inet->getName(); _ckoPadNetName = net->getName();
_cko = *inet; _cko = net;
if (NetRoutingExtension::isMixedPreRoute(*inet)) { if (NetRoutingExtension::isMixedPreRoute(net)) {
cmess1 << " (core clock net is already routed)" << endl; cmess1 << " (core clock net is already routed)" << endl;
_flags |= ClockIsRouted; _flags |= ClockIsRouted;
} else { } else {
@ -275,23 +275,23 @@ namespace {
} else { } else {
cerr << Error("Second clock net <%s> net at top block level will be ignored.\n" cerr << Error("Second clock net <%s> net at top block level will be ignored.\n"
" (will consider only <%s>)" " (will consider only <%s>)"
, getString(inet ->getName()).c_str() , getString(net ->getName()).c_str()
, getString(_cko->getName()).c_str() , getString(_cko->getName()).c_str()
) << endl; ) << endl;
cerr << inet->isExternal() << endl; cerr << net->isExternal() << endl;
} }
} }
if (NetRoutingExtension::isManualGlobalRoute(*inet)) continue; if (NetRoutingExtension::isManualGlobalRoute(net)) continue;
if (netType == Net::Type::POWER) { if (netType == Net::Type::POWER) {
if (_vddiPadNetName.isEmpty()) { if (_vddiPadNetName.isEmpty()) {
_vddiPadNetName = inet->getName(); _vddiPadNetName = net->getName();
_vddi = *inet; _vddi = net;
} else { } else {
cerr << Error("Second power supply net <%s> net at top block level will be ignored.\n" cerr << Error("Second power supply net <%s> net at top block level will be ignored.\n"
" (will consider only <%s>)" " (will consider only <%s>)"
, getString(inet ->getName()).c_str() , getString(net ->getName()).c_str()
, getString(_vddi->getName()).c_str() , getString(_vddi->getName()).c_str()
) << endl; ) << endl;
} }
@ -299,12 +299,12 @@ namespace {
if (netType == Net::Type::GROUND) { if (netType == Net::Type::GROUND) {
if (_vssiPadNetName.isEmpty()) { if (_vssiPadNetName.isEmpty()) {
_vssiPadNetName = inet->getName(); _vssiPadNetName = net->getName();
_vssi = *inet; _vssi = net;
} else { } else {
cerr << Error("Second power ground net <%s> net at top block level will be ignored.\n" cerr << Error("Second power ground net <%s> net at top block level will be ignored.\n"
" (will consider only <%s>)" " (will consider only <%s>)"
, getString(inet ->getName()).c_str() , getString(net ->getName()).c_str()
, getString(_vssi->getName()).c_str() , getString(_vssi->getName()).c_str()
) << endl; ) << endl;
} }
@ -926,8 +926,8 @@ namespace {
Technology* technology = DataBase::getDB()->getTechnology(); Technology* technology = DataBase::getDB()->getTechnology();
RoutingGauge* rg = _kite->getConfiguration()->getRoutingGauge(); RoutingGauge* rg = _kite->getConfiguration()->getRoutingGauge();
forEach ( Layer*, iLayer, technology->getLayers() ) { for( Layer* layer : technology->getLayers() ) {
RegularLayer* regular = dynamic_cast<RegularLayer*>(*iLayer); RegularLayer* regular = dynamic_cast<RegularLayer*>(layer);
if ( not regular if ( not regular
or (regular->getBasicLayer()->getMaterial() != BasicLayer::Material::metal) ) continue; or (regular->getBasicLayer()->getMaterial() != BasicLayer::Material::metal) ) continue;
@ -1283,14 +1283,14 @@ namespace Kite {
QueryPowerRails query ( this ); QueryPowerRails query ( this );
Technology* technology = DataBase::getDB()->getTechnology(); Technology* technology = DataBase::getDB()->getTechnology();
forEach ( BasicLayer*, iLayer, technology->getBasicLayers() ) { for( BasicLayer* layer : technology->getBasicLayers() ) {
if ( (iLayer->getMaterial() != BasicLayer::Material::metal) if ( (layer->getMaterial() != BasicLayer::Material::metal)
and (iLayer->getMaterial() != BasicLayer::Material::blockage) ) and (layer->getMaterial() != BasicLayer::Material::blockage) )
continue; continue;
if (_configuration->isGMetal(*iLayer)) continue; if (_configuration->isGMetal(layer)) continue;
if (not query.hasBasicLayer(*iLayer)) continue; if (not query.hasBasicLayer(layer)) continue;
query.setBasicLayer( *iLayer ); query.setBasicLayer( layer );
query.doQuery (); query.doQuery ();
} }
query.ringAddToPowerRails(); query.ringAddToPowerRails();

View File

@ -91,10 +91,10 @@ namespace Kite {
{ {
cmess1 << " o Looking for fixed or manually global routed nets." << endl; cmess1 << " o Looking for fixed or manually global routed nets." << endl;
forEach ( Net*, inet, getCell()->getNets() ) { for( Net* net : getCell()->getNets() ) {
if (*inet == _blockageNet) continue; if (net == _blockageNet) continue;
if (inet->getType() == Net::Type::POWER ) continue; if (net->getType() == Net::Type::POWER ) continue;
if (inet->getType() == Net::Type::GROUND) continue; if (net->getType() == Net::Type::GROUND) continue;
// Don't skip the clock. // Don't skip the clock.
vector<Segment*> segments; vector<Segment*> segments;
@ -104,39 +104,39 @@ namespace Kite {
bool isFixed = false; bool isFixed = false;
size_t rpCount = 0; size_t rpCount = 0;
if (inet->isDeepNet()) { if (net->isDeepNet()) {
rpCount = 2; rpCount = 2;
Net* rootNet = dynamic_cast<Net*>( Net* rootNet = dynamic_cast<Net*>(
dynamic_cast<DeepNet*>(*inet)->getRootNetOccurrence().getEntity() ); dynamic_cast<DeepNet*>(net)->getRootNetOccurrence().getEntity() );
forEach ( Component*, icomponent, rootNet->getComponents() ) { for( Component* component : rootNet->getComponents() ) {
if (dynamic_cast<Horizontal*>(*icomponent)) { isFixed = true; break; } if (dynamic_cast<Horizontal*>(component)) { isFixed = true; break; }
if (dynamic_cast<Vertical*> (*icomponent)) { isFixed = true; break; } if (dynamic_cast<Vertical*> (component)) { isFixed = true; break; }
if (dynamic_cast<Contact*> (*icomponent)) { isFixed = true; break; } if (dynamic_cast<Contact*> (component)) { isFixed = true; break; }
} }
} else { } else {
forEach ( Component*, icomponent, inet->getComponents() ) { for( Component* component : net->getComponents() ) {
if (dynamic_cast<Pin*>(*icomponent)) continue; if (dynamic_cast<Pin*>(component)) continue;
const RegularLayer* layer = dynamic_cast<const RegularLayer*>(icomponent->getLayer()); const RegularLayer* layer = dynamic_cast<const RegularLayer*>(component->getLayer());
if (layer and (layer->getBasicLayer()->getMaterial() == BasicLayer::Material::blockage)) if (layer and (layer->getBasicLayer()->getMaterial() == BasicLayer::Material::blockage))
continue; continue;
Horizontal* horizontal = dynamic_cast<Horizontal*>(*icomponent); Horizontal* horizontal = dynamic_cast<Horizontal*>(component);
if (horizontal) { if (horizontal) {
segments.push_back( horizontal ); segments.push_back( horizontal );
isPreRouted = true; isPreRouted = true;
if (horizontal->getWidth() != Session::getWireWidth(horizontal->getLayer())) if (horizontal->getWidth() != Session::getWireWidth(horizontal->getLayer()))
isFixed = true; isFixed = true;
} else { } else {
Vertical* vertical = dynamic_cast<Vertical*>(*icomponent); Vertical* vertical = dynamic_cast<Vertical*>(component);
if (vertical) { if (vertical) {
isPreRouted = true; isPreRouted = true;
segments.push_back( vertical ); segments.push_back( vertical );
if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer())) if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer()))
isFixed = true; isFixed = true;
} else { } else {
Contact* contact = dynamic_cast<Contact*>(*icomponent); Contact* contact = dynamic_cast<Contact*>(component);
if (contact) { if (contact) {
isPreRouted = true; isPreRouted = true;
contacts.push_back( contact ); contacts.push_back( contact );
@ -144,11 +144,11 @@ namespace Kite {
or (contact->getHeight() != Session::getViaWidth(contact->getLayer())) ) or (contact->getHeight() != Session::getViaWidth(contact->getLayer())) )
isFixed = true; isFixed = true;
} else { } else {
RoutingPad* rp = dynamic_cast<RoutingPad*>(*icomponent); RoutingPad* rp = dynamic_cast<RoutingPad*>(component);
if (rp) { if (rp) {
++rpCount; ++rpCount;
} else { } else {
// Plug* plug = dynamic_cast<Plug*>(*icomponent); // Plug* plug = dynamic_cast<Plug*>(component);
// if (plug) { // if (plug) {
// cerr << "buildPreRouteds(): " << plug << endl; // cerr << "buildPreRouteds(): " << plug << endl;
// ++rpCount; // ++rpCount;
@ -161,19 +161,19 @@ namespace Kite {
} }
if (isFixed or isPreRouted or (rpCount < 2)) { if (isFixed or isPreRouted or (rpCount < 2)) {
NetRoutingState* state = getRoutingState( *inet, Katabatic::KbCreate ); NetRoutingState* state = getRoutingState( net, Katabatic::KbCreate );
state->unsetFlags( NetRoutingState::AutomaticGlobalRoute ); state->unsetFlags( NetRoutingState::AutomaticGlobalRoute );
state->setFlags ( NetRoutingState::ManualGlobalRoute ); state->setFlags ( NetRoutingState::ManualGlobalRoute );
if (rpCount < 2) if (rpCount < 2)
state->setFlags ( NetRoutingState::Unconnected ); state->setFlags ( NetRoutingState::Unconnected );
if (isFixed) { if (isFixed) {
cmess2 << " - <" << (*inet)->getName() << "> is fixed." << endl; cmess2 << " - <" << net->getName() << "> is fixed." << endl;
state->unsetFlags( NetRoutingState::ManualGlobalRoute ); state->unsetFlags( NetRoutingState::ManualGlobalRoute );
state->setFlags ( NetRoutingState::Fixed ); state->setFlags ( NetRoutingState::Fixed );
} else { } else {
if (rpCount > 1) { if (rpCount > 1) {
cmess2 << " - <" << (*inet)->getName() << "> is manually global routed." << endl; cmess2 << " - <" << net->getName() << "> is manually global routed." << endl;
for ( auto icontact : contacts ) { for ( auto icontact : contacts ) {
AutoContact::createFrom( icontact ); AutoContact::createFrom( icontact );
} }

View File

@ -213,13 +213,13 @@ namespace Kite {
throw Error("Trying to wipe out a routing with a routing engine\n"); throw Error("Trying to wipe out a routing with a routing engine\n");
using namespace Hurricane; using namespace Hurricane;
UpdateSession::open(); UpdateSession::open();
forEach(Net*, inet, cell->getNets()){ for(Net* net : cell->getNets()){
if(NetRoutingExtension::isManualGlobalRoute(*inet)) if(NetRoutingExtension::isManualGlobalRoute(net))
continue; continue;
// First pass: destroy the contacts // First pass: destroy the contacts
std::vector<Contact*> contactPointers; std::vector<Contact*> contactPointers;
forEach(Component*, icom, (*inet)->getComponents()){ for(Component* com : net->getComponents()){
Contact * contact = dynamic_cast<Contact*>(*icom); Contact * contact = dynamic_cast<Contact*>(com);
if(contact){ if(contact){
contactPointers.push_back(contact); contactPointers.push_back(contact);
} }
@ -228,12 +228,12 @@ namespace Kite {
contact->destroy(); contact->destroy();
// Second pass: destroy unconnected segments added by Knik as blockages // Second pass: destroy unconnected segments added by Knik as blockages
std::vector<Component*> compPointers; std::vector<Component*> compPointers;
forEach(Component*, icom, (*inet)->getComponents()){ for(Component* com : net->getComponents()){
Horizontal * h = dynamic_cast<Horizontal*>(*icom); Horizontal * h = dynamic_cast<Horizontal*>(com);
if(h){ if(h){
compPointers.push_back(h); compPointers.push_back(h);
} }
Vertical * v = dynamic_cast<Vertical*>(*icom); Vertical * v = dynamic_cast<Vertical*>(com);
if(v){ if(v){
compPointers.push_back(v); compPointers.push_back(v);
} }
@ -344,12 +344,12 @@ namespace Kite {
size_t coreReserved = 0; size_t coreReserved = 0;
size_t coronaReserved = 4; 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 ) { for ( int i=0 ; i<2 ; ++i ) {
Knik::Edge* edge = NULL; Knik::Edge* edge = NULL;
if (i==0) { if (i==0) {
edge = ivertex->getHEdgeOut(); edge = vertex->getHEdgeOut();
if (not edge) continue; if (not edge) continue;
if (chipTools.hPadsEnclosed(edge->getBoundingBox())) { if (chipTools.hPadsEnclosed(edge->getBoundingBox())) {
@ -358,7 +358,7 @@ namespace Kite {
} }
coreReserved = getHTracksReservedLocal(); coreReserved = getHTracksReservedLocal();
} else { } else {
edge = ivertex->getVEdgeOut(); edge = vertex->getVEdgeOut();
if (not edge) continue; if (not edge) continue;
if (chipTools.vPadsEnclosed(edge->getBoundingBox())) { if (chipTools.vPadsEnclosed(edge->getBoundingBox())) {
@ -732,13 +732,13 @@ namespace Kite {
coherency = _routingPlanes[i]->_check(overlap) and coherency; coherency = _routingPlanes[i]->_check(overlap) and coherency;
Katabatic::Session* ktbtSession = Session::base (); Katabatic::Session* ktbtSession = Session::base ();
forEach ( Net*, inet, getCell()->getNets() ) { for( Net* net : getCell()->getNets() ) {
forEach ( Segment*, isegment, inet->getComponents().getSubSet<Segment*>() ) { for( Segment* segment : net->getComponents().getSubSet<Segment*>() ) {
AutoSegment* autoSegment = ktbtSession->lookup( *isegment ); AutoSegment* autoSegment = ktbtSession->lookup( segment );
if (not autoSegment) continue; if (not autoSegment) continue;
if (not autoSegment->isCanonical()) continue; if (not autoSegment->isCanonical()) continue;
TrackElement* trackSegment = Session::lookup( *isegment ); TrackElement* trackSegment = Session::lookup( segment );
if (not trackSegment) { if (not trackSegment) {
coherency = false; coherency = false;
cerr << Bug( "%p %s without Track Segment" cerr << Bug( "%p %s without Track Segment"
@ -806,8 +806,8 @@ namespace Kite {
{ {
cerr << " o Checking " << net << endl; cerr << " o Checking " << net << endl;
forEach ( Segment*, isegment, net->getComponents().getSubSet<Segment*>() ) { for( Segment* segment : net->getComponents().getSubSet<Segment*>() ) {
TrackElement* trackSegment = _lookup( *isegment ); TrackElement* trackSegment = _lookup( segment );
if (trackSegment) { if (trackSegment) {
trackSegment->_check(); trackSegment->_check();

View File

@ -716,24 +716,24 @@ namespace Kite {
continue; continue;
canonicals.clear (); canonicals.clear ();
forEach ( TrackElement*, isegment3 for( TrackElement* segment3
, segment2->getPerpandiculars().getSubSet(TrackElements_UniqCanonical(canonicals)) ) { : segment2->getPerpandiculars().getSubSet(TrackElements_UniqCanonical(canonicals)) ) {
DataNegociate* data3 = isegment3->getDataNegociate(); DataNegociate* data3 = segment3->getDataNegociate();
if ( not data3 ) continue; if ( not data3 ) continue;
RoutingEvent* event3 = data3->getRoutingEvent(); RoutingEvent* event3 = data3->getRoutingEvent();
if ( not event3 ) continue; if ( not event3 ) continue;
if ( not toFree.intersect(event3->getConstraints()) ) { if ( not toFree.intersect(event3->getConstraints()) ) {
ltrace(200) << " . " << *isegment3 << endl; ltrace(200) << " . " << segment3 << endl;
continue; continue;
} }
ltrace(200) << " | " << *isegment3 << endl; ltrace(200) << " | " << segment3 << endl;
if ( shrinkRight xor shrinkLeft ) { if ( shrinkRight xor shrinkLeft ) {
if ( shrinkRight ) { if ( shrinkRight ) {
if ( not (success=Manipulator(*isegment3,_fsm) if ( not (success=Manipulator(segment3,_fsm)
.ripup( SegmentAction::OtherRipupPerpandAndPushAside .ripup( SegmentAction::OtherRipupPerpandAndPushAside
, toFree.getVMin() - getPPitch()/2 , toFree.getVMin() - getPPitch()/2
)) ) )) )
@ -741,28 +741,28 @@ namespace Kite {
if ( event3->getTracksFree() == 1 ) { if ( event3->getTracksFree() == 1 ) {
ltrace(200) << "Potential left intrication with other perpandicular." << endl; 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; leftIntrication = true;
leftAxisHint = isegment3->getAxis(); leftAxisHint = segment3->getAxis();
} }
} }
} }
if ( shrinkLeft ) { if ( shrinkLeft ) {
if ( not (success=Manipulator(*isegment3,_fsm) if ( not (success=Manipulator(segment3,_fsm)
.ripup( SegmentAction::OtherRipupPerpandAndPushAside .ripup( SegmentAction::OtherRipupPerpandAndPushAside
, toFree.getVMax() + getPPitch()/2 , toFree.getVMax() + getPPitch()/2
)) ) )) )
break; break;
if ( event3->getTracksFree() == 1 ) { if ( event3->getTracksFree() == 1 ) {
ltrace(200) << "Potential right intrication with other perpandicular." << endl; 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; rightIntrication = true;
rightAxisHint = isegment3->getAxis(); rightAxisHint = segment3->getAxis();
} }
} }
} }
} else { } else {
if ( not (success=Manipulator(*isegment3,_fsm).ripup( SegmentAction::OtherRipup if ( not (success=Manipulator(segment3,_fsm).ripup( SegmentAction::OtherRipup
| SegmentAction::EventLevel3 | SegmentAction::EventLevel3
)) ) )) )
break; break;
@ -828,16 +828,16 @@ namespace Kite {
continue; continue;
canonicals.clear(); canonicals.clear();
forEach ( TrackElement*, isegment3 for( TrackElement* segment3
, segment2->getPerpandiculars().getSubSet(TrackElements_UniqCanonical(canonicals)) ) { : segment2->getPerpandiculars().getSubSet(TrackElements_UniqCanonical(canonicals)) ) {
DataNegociate* data3 = isegment3->getDataNegociate(); DataNegociate* data3 = segment3->getDataNegociate();
if (not data3) continue; if (not data3) continue;
RoutingEvent* event3 = data3->getRoutingEvent(); RoutingEvent* event3 = data3->getRoutingEvent();
if (not event3) continue; if (not event3) continue;
if (Manipulator(*isegment3,_fsm).canRipup()) if (Manipulator(segment3,_fsm).canRipup())
_fsm.addAction( *isegment3, SegmentAction::OtherRipup ); _fsm.addAction( segment3, SegmentAction::OtherRipup );
} }
} }
@ -1008,13 +1008,13 @@ namespace Kite {
RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(_segment->getLayer()); RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(_segment->getLayer());
ltracein(200); ltracein(200);
forEach ( Track*, itrack, Tracks_Range::get(plane,uside)) { for( Track* track : Tracks_Range::get(plane,uside)) {
size_t begin; size_t begin;
size_t end; size_t end;
itrack->getOverlapBounds( _segment->getCanonicalInterval(), begin, end ); track->getOverlapBounds( _segment->getCanonicalInterval(), begin, end );
for ( ; begin < end ; begin++ ) { for ( ; begin < end ; begin++ ) {
TrackElement* other = itrack->getSegment(begin); TrackElement* other = track->getSegment(begin);
ltrace(200) << "| " << other << endl; ltrace(200) << "| " << other << endl;
if (other->getNet() == net) continue; if (other->getNet() == net) continue;

View File

@ -117,17 +117,17 @@ namespace {
AllianceFramework* af = AllianceFramework::get (); AllianceFramework* af = AllianceFramework::get ();
RoutingGauge* rg = nw->getKiteEngine()->getRoutingGauge(); RoutingGauge* rg = nw->getKiteEngine()->getRoutingGauge();
forEach ( Net*, inet, nw->getCell()->getNets() ) { for( Net* net : nw->getCell()->getNets() ) {
if (inet->getType() == Net::Type::POWER ) continue; if (net->getType() == Net::Type::POWER ) continue;
if (inet->getType() == Net::Type::GROUND) continue; if (net->getType() == Net::Type::GROUND) continue;
if (inet->getType() == Net::Type::CLOCK ) continue; if (net->getType() == Net::Type::CLOCK ) continue;
if (af->isBLOCKAGE(inet->getName())) continue; if (af->isBLOCKAGE(net->getName())) continue;
forEach ( RoutingPad*, irp, inet->getRoutingPads() ) { for( RoutingPad* rp : net->getRoutingPads() ) {
size_t depth = rg->getLayerDepth(irp->getLayer()); size_t depth = rg->getLayerDepth(rp->getLayer());
if (depth > 0) continue; if (depth > 0) continue;
if (depth == 0) if (depth == 0)
TrackMarker::create( *irp, 1 ); TrackMarker::create( rp, 1 );
} }
} }
} }
@ -326,8 +326,8 @@ namespace Kite {
const vector<AutoContact*>& contacts = _gcells[igcell]->getContacts(); const vector<AutoContact*>& contacts = _gcells[igcell]->getContacts();
for ( size_t i=0 ; i<contacts.size() ; i++ ) { for ( size_t i=0 ; i<contacts.size() ; i++ ) {
forEach ( Hook*, ihook, contacts[i]->getBodyHook()->getSlaveHooks() ) { for( Hook* hook : contacts[i]->getBodyHook()->getSlaveHooks() ) {
Hook* sourceHook = dynamic_cast<Segment::SourceHook*>(*ihook); Hook* sourceHook = dynamic_cast<Segment::SourceHook*>(hook);
if (not sourceHook) continue; if (not sourceHook) continue;
segment = dynamic_cast<Segment*>(sourceHook->getComponent()); segment = dynamic_cast<Segment*>(sourceHook->getComponent());
@ -360,8 +360,8 @@ namespace Kite {
ltrace(149) << "AutoSegments from AutoContacts" << endl; ltrace(149) << "AutoSegments from AutoContacts" << endl;
const vector<AutoContact*>& contacts = gcell->getContacts(); const vector<AutoContact*>& contacts = gcell->getContacts();
for ( size_t i=0 ; i<contacts.size() ; i++ ) { for ( size_t i=0 ; i<contacts.size() ; i++ ) {
forEach ( Component*, component, contacts[i]->getSlaveComponents() ) { for( Component* component : contacts[i]->getSlaveComponents() ) {
segment = dynamic_cast<Segment*>(*component); segment = dynamic_cast<Segment*>(component);
autoSegment = Session::base()->lookup( segment ); autoSegment = Session::base()->lookup( segment );
ltrace(149) << autoSegment << endl; ltrace(149) << autoSegment << endl;
if (autoSegment and autoSegment->isCanonical()) { if (autoSegment and autoSegment->isCanonical()) {

View File

@ -49,8 +49,8 @@ namespace {
) )
{ {
TrackElement* perpandicular; TrackElement* perpandicular;
forEach ( Segment*, isegment, segment->base()->getAutoSource()->getSlaveComponents().getSubSet<Segment*>() ) { for( Segment* osegment : segment->base()->getAutoSource()->getSlaveComponents().getSubSet<Segment*>() ) {
perpandicular = Session::lookup ( *isegment ); perpandicular = Session::lookup ( osegment );
ltrace(200) << "S " << perpandicular << endl; ltrace(200) << "S " << perpandicular << endl;
if ( not perpandicular or (perpandicular->getDirection() == direction) ) continue; if ( not perpandicular or (perpandicular->getDirection() == direction) ) continue;
@ -58,8 +58,8 @@ namespace {
perpandiculars.push_back ( perpandicular ); perpandiculars.push_back ( perpandicular );
} }
forEach ( Segment*, isegment, segment->base()->getAutoTarget()->getSlaveComponents().getSubSet<Segment*>() ) { for( Segment* osegment : segment->base()->getAutoTarget()->getSlaveComponents().getSubSet<Segment*>() ) {
perpandicular = Session::lookup ( *isegment ); perpandicular = Session::lookup ( osegment );
ltrace(200) << "T " << perpandicular << endl; ltrace(200) << "T " << perpandicular << endl;
if ( not perpandicular or (perpandicular->getDirection() == direction) ) continue; if ( not perpandicular or (perpandicular->getDirection() == direction) ) continue;
@ -74,8 +74,8 @@ namespace {
ltrace(200) << "Find failed caging: " << rp << endl; ltrace(200) << "Find failed caging: " << rp << endl;
TrackElement* parallel; TrackElement* parallel;
forEach ( Segment*, isegment, rp->getSlaveComponents().getSubSet<Segment*>() ) { for( Segment* osegment : rp->getSlaveComponents().getSubSet<Segment*>() ) {
parallel = Session::lookup ( *isegment ); parallel = Session::lookup ( osegment );
ltrace(200) << "* " << parallel << endl; ltrace(200) << "* " << parallel << endl;
if ( parallel->isFixed () ) continue; if ( parallel->isFixed () ) continue;
@ -156,8 +156,8 @@ namespace {
rp = dynamic_cast<RoutingPad*>(source->getAnchor()); rp = dynamic_cast<RoutingPad*>(source->getAnchor());
if (rp) { if (rp) {
TrackElement* parallel; TrackElement* parallel;
forEach ( Segment*, isegment, rp->getSlaveComponents().getSubSet<Segment*>() ) { for( Segment* osegment : rp->getSlaveComponents().getSubSet<Segment*>() ) {
parallel = Session::lookup( *isegment ); parallel = Session::lookup( osegment );
ltrace(200) << "* " << parallel << endl; ltrace(200) << "* " << parallel << endl;
if (parallel->isFixed ()) continue; if (parallel->isFixed ()) continue;
@ -207,8 +207,8 @@ namespace {
Katabatic::AutoContact* support = segment->base()->getAutoSource(); Katabatic::AutoContact* support = segment->base()->getAutoSource();
RoutingPad* rp = dynamic_cast<RoutingPad*>(support->getAnchor()); RoutingPad* rp = dynamic_cast<RoutingPad*>(support->getAnchor());
forEach( Component*, icomponent, rp->getSlaveComponents() ) { for( Component* component : rp->getSlaveComponents() ) {
Horizontal* baseSegment = dynamic_cast<Horizontal*>( *icomponent ); Horizontal* baseSegment = dynamic_cast<Horizontal*>( component );
TrackElement* accessSegment = Session::lookup( baseSegment ); TrackElement* accessSegment = Session::lookup( baseSegment );
if (accessSegment and not accessSegment->isFixed()) { if (accessSegment and not accessSegment->isFixed()) {

View File

@ -80,16 +80,16 @@ namespace {
vector<Segment*> segments; vector<Segment*> segments;
forEach ( Segment*, isegment, masterNet->getSegments() ) { for( Segment* segment : masterNet->getSegments() ) {
RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(isegment->getLayer()); RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(segment->getLayer());
if ( plane == NULL ) continue; if ( plane == NULL ) continue;
if ( usedComponent == dynamic_cast<Component*>(*isegment) ) continue; if ( usedComponent == dynamic_cast<Component*>(segment) ) continue;
if ( not NetExternalComponents::isExternal(*isegment) ) continue; if ( not NetExternalComponents::isExternal(segment) ) continue;
//cerr << "Looking " << (void*)*isegment << ":" << *isegment << endl; //cerr << "Looking " << (void*)*isegment << ":" << *isegment << endl;
segments.push_back ( *isegment ); segments.push_back ( segment );
} }
for ( size_t i=0 ; i<segments.size() ; ++i ) { for ( size_t i=0 ; i<segments.size() ; ++i ) {
@ -159,15 +159,15 @@ namespace Kite {
{ {
cmess1 << " o Protect external components not useds as RoutingPads." << endl; cmess1 << " o Protect external components not useds as RoutingPads." << endl;
forEach ( Net*, inet, getCell()->getNets() ) { for( Net* net : getCell()->getNets() ) {
if ( (*inet)->isSupply() ) continue; if ( net->isSupply() ) continue;
NetRoutingState* state = getRoutingState( *inet ); NetRoutingState* state = getRoutingState( net );
if (state and state->isFixed()) continue; if (state and state->isFixed()) continue;
vector<RoutingPad*> rps; vector<RoutingPad*> rps;
forEach ( RoutingPad*, irp, (*inet)->getRoutingPads() ) { for( RoutingPad* rp : net->getRoutingPads() ) {
rps.push_back ( *irp ); rps.push_back ( rp );
} }
for ( size_t i=0 ; i<rps.size() ; ++i ) for ( size_t i=0 ; i<rps.size() ; ++i )

View File

@ -504,15 +504,15 @@ namespace Kite {
and (segment->base()->getAutoSource()->getGCell()->getGlobalsCount(depth) >= 9.0); and (segment->base()->getAutoSource()->getGCell()->getGlobalsCount(depth) >= 9.0);
RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(segment->getLayer()); 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; unsigned int costflags = 0;
costflags |= (segment->isLocal() and (depth >= 3)) ? TrackCost::LocalAndTopDepth : 0; costflags |= (segment->isLocal() and (depth >= 3)) ? TrackCost::LocalAndTopDepth : 0;
_costs.push_back ( itrack->getOverlapCost(segment,costflags) ); _costs.push_back ( track->getOverlapCost(segment,costflags) );
_costs.back().setAxisWeight ( _event->getAxisWeight(itrack->getAxis()) ); _costs.back().setAxisWeight ( _event->getAxisWeight(track->getAxis()) );
_costs.back().incDeltaPerpand ( _data->getWiringDelta(itrack->getAxis()) ); _costs.back().incDeltaPerpand ( _data->getWiringDelta(track->getAxis()) );
if (segment->isGlobal()) { if (segment->isGlobal()) {
ltrace(500) << "Deter| setForGlobal() on " << *itrack << endl; ltrace(500) << "Deter| setForGlobal() on " << track << endl;
_costs.back().setForGlobal(); _costs.back().setForGlobal();
} }
@ -528,7 +528,7 @@ namespace Kite {
if ( _fullBlocked and (not _costs.back().isBlockage() and not _costs.back().isFixed()) ) if ( _fullBlocked and (not _costs.back().isBlockage() and not _costs.back().isFixed()) )
_fullBlocked = false; _fullBlocked = false;
ltrace(149) << "| " << _costs.back() << ((_fullBlocked)?" FB ": " -- ") << (*itrack) << endl; ltrace(149) << "| " << _costs.back() << ((_fullBlocked)?" FB ": " -- ") << track << endl;
} }
ltraceout(148); ltraceout(148);

View File

@ -216,16 +216,16 @@ namespace Kite {
ltrace(148) << "getGCells(): sourceGCell: " << sourceGCell << endl; ltrace(148) << "getGCells(): sourceGCell: " << sourceGCell << endl;
ltrace(148) << "getGCells(): targetGCell: " << targetGCell << endl; ltrace(148) << "getGCells(): targetGCell: " << targetGCell << endl;
forEach ( AutoSegment*, isegment, base()->getAligneds() ) { for( AutoSegment* segment : base()->getAligneds() ) {
ltrace(148) << "| " << *isegment << endl; ltrace(148) << "| " << segment << endl;
Katabatic::GCell* gcell = isegment->getAutoSource()->getGCell(); Katabatic::GCell* gcell = segment->getAutoSource()->getGCell();
if (gcell->getIndex() < sourceGCell->getIndex()) { if (gcell->getIndex() < sourceGCell->getIndex()) {
sourceGCell = gcell; sourceGCell = gcell;
ltrace(148) << "getGCells(): new sourceGCell: " << sourceGCell << endl; ltrace(148) << "getGCells(): new sourceGCell: " << sourceGCell << endl;
} }
gcell = isegment->getAutoTarget()->getGCell(); gcell = segment->getAutoTarget()->getGCell();
if (gcell->getIndex() > targetGCell->getIndex()) { if (gcell->getIndex() > targetGCell->getIndex()) {
targetGCell = gcell; targetGCell = gcell;
ltrace(148) << "getGCells(): new targetGCell: " << targetGCell << endl; ltrace(148) << "getGCells(): new targetGCell: " << targetGCell << endl;
@ -502,8 +502,8 @@ namespace Kite {
unsigned int direction = perpandicularTo( getDirection() ); unsigned int direction = perpandicularTo( getDirection() );
TrackElement* dogleg = NULL; TrackElement* dogleg = NULL;
forEach ( Segment*, isegment, base()->getAutoSource()->getSlaveComponents().getSubSet<Segment*>() ) { for( Segment* segment : base()->getAutoSource()->getSlaveComponents().getSubSet<Segment*>() ) {
dogleg = Session::lookup( *isegment ); dogleg = Session::lookup( segment );
if (dogleg and (dogleg->getDirection() == direction)) { if (dogleg and (dogleg->getDirection() == direction)) {
ltrace(200) << "Source dogleg: " << dogleg << endl; ltrace(200) << "Source dogleg: " << dogleg << endl;
return dogleg; return dogleg;
@ -519,8 +519,8 @@ namespace Kite {
unsigned int direction = perpandicularTo( getDirection() ); unsigned int direction = perpandicularTo( getDirection() );
TrackElement* dogleg = NULL; TrackElement* dogleg = NULL;
forEach ( Segment*, isegment, base()->getAutoTarget()->getSlaveComponents().getSubSet<Segment*>() ) { for( Segment* segment : base()->getAutoTarget()->getSlaveComponents().getSubSet<Segment*>() ) {
dogleg = Session::lookup( *isegment ); dogleg = Session::lookup( segment );
if (dogleg and (dogleg->getDirection() == direction)) { if (dogleg and (dogleg->getDirection() == direction)) {
ltrace(200) << "Target dogleg: " << dogleg << endl; ltrace(200) << "Target dogleg: " << dogleg << endl;
return dogleg; return dogleg;