Basic STL-compliant collections
Ported etesian and kite to use them
This commit is contained in:
parent
20ac9080d6
commit
63b1f5abb0
|
@ -353,17 +353,17 @@ namespace Etesian {
|
|||
double cellLength = 0;
|
||||
|
||||
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();
|
||||
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<Occurrence> 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<Instance*>((*ioccurrence).getEntity());
|
||||
Instance* instance = static_cast<Instance*>(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<Instance*>((*ioccurrence).getEntity());
|
||||
Instance* instance = static_cast<Instance*>(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<Instance*>((*ioccurrence).getEntity());
|
||||
Instance* instance = static_cast<Instance*>(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<temporary_pin> 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<int_t>(
|
||||
(*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);
|
||||
|
@ -964,11 +964,11 @@ namespace Etesian {
|
|||
{
|
||||
UpdateSession::open();
|
||||
|
||||
forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() )
|
||||
for ( Occurrence occurrence : getCell()->getLeafInstanceOccurrences() )
|
||||
{
|
||||
Point instancePosition;
|
||||
Instance* instance = static_cast<Instance*>((*ioccurrence).getEntity());
|
||||
string instanceName = (*ioccurrence).getCompactString();
|
||||
Instance* instance = static_cast<Instance*>(occurrence.getEntity());
|
||||
string instanceName = occurrence.getCompactString();
|
||||
// Remove the enclosing brackets...
|
||||
instanceName.erase( 0, 1 );
|
||||
instanceName.erase( instanceName.size()-1 );
|
||||
|
|
|
@ -195,6 +195,24 @@ template<class Type> class Collection {
|
|||
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(); }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -84,16 +84,16 @@ namespace {
|
|||
|
||||
void destroyRing ( Net* net )
|
||||
{
|
||||
forEach ( RoutingPad*, irp, net->getRoutingPads() ) {
|
||||
for( RoutingPad* rp : net->getRoutingPads() ) {
|
||||
bool allMasters = true;
|
||||
vector<Hook*> 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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -180,27 +180,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) {
|
||||
|
@ -213,15 +213,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) {
|
||||
|
@ -256,17 +256,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 {
|
||||
|
@ -275,23 +275,23 @@ 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;
|
||||
cerr << inet->isExternal() << endl;
|
||||
cerr << net->isExternal() << 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;
|
||||
}
|
||||
|
@ -299,12 +299,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;
|
||||
}
|
||||
|
@ -926,8 +926,8 @@ namespace {
|
|||
Technology* technology = DataBase::getDB()->getTechnology();
|
||||
RoutingGauge* rg = _kite->getConfiguration()->getRoutingGauge();
|
||||
|
||||
forEach ( Layer*, iLayer, technology->getLayers() ) {
|
||||
RegularLayer* regular = dynamic_cast<RegularLayer*>(*iLayer);
|
||||
for( Layer* layer : technology->getLayers() ) {
|
||||
RegularLayer* regular = dynamic_cast<RegularLayer*>(layer);
|
||||
if ( not regular
|
||||
or (regular->getBasicLayer()->getMaterial() != BasicLayer::Material::metal) ) continue;
|
||||
|
||||
|
@ -1283,14 +1283,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();
|
||||
|
|
|
@ -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<Segment*> 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<Net*>(
|
||||
dynamic_cast<DeepNet*>(*inet)->getRootNetOccurrence().getEntity() );
|
||||
forEach ( Component*, icomponent, rootNet->getComponents() ) {
|
||||
if (dynamic_cast<Horizontal*>(*icomponent)) { isFixed = true; break; }
|
||||
if (dynamic_cast<Vertical*> (*icomponent)) { isFixed = true; break; }
|
||||
if (dynamic_cast<Contact*> (*icomponent)) { isFixed = true; break; }
|
||||
dynamic_cast<DeepNet*>(net)->getRootNetOccurrence().getEntity() );
|
||||
for( Component* component : rootNet->getComponents() ) {
|
||||
if (dynamic_cast<Horizontal*>(component)) { isFixed = true; break; }
|
||||
if (dynamic_cast<Vertical*> (component)) { isFixed = true; break; }
|
||||
if (dynamic_cast<Contact*> (component)) { isFixed = true; break; }
|
||||
}
|
||||
} else {
|
||||
forEach ( Component*, icomponent, inet->getComponents() ) {
|
||||
if (dynamic_cast<Pin*>(*icomponent)) continue;
|
||||
for( Component* component : net->getComponents() ) {
|
||||
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))
|
||||
continue;
|
||||
|
||||
Horizontal* horizontal = dynamic_cast<Horizontal*>(*icomponent);
|
||||
Horizontal* horizontal = dynamic_cast<Horizontal*>(component);
|
||||
if (horizontal) {
|
||||
segments.push_back( horizontal );
|
||||
isPreRouted = true;
|
||||
if (horizontal->getWidth() != Session::getWireWidth(horizontal->getLayer()))
|
||||
isFixed = true;
|
||||
} else {
|
||||
Vertical* vertical = dynamic_cast<Vertical*>(*icomponent);
|
||||
Vertical* vertical = dynamic_cast<Vertical*>(component);
|
||||
if (vertical) {
|
||||
isPreRouted = true;
|
||||
segments.push_back( vertical );
|
||||
if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer()))
|
||||
isFixed = true;
|
||||
} else {
|
||||
Contact* contact = dynamic_cast<Contact*>(*icomponent);
|
||||
Contact* contact = dynamic_cast<Contact*>(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<RoutingPad*>(*icomponent);
|
||||
RoutingPad* rp = dynamic_cast<RoutingPad*>(component);
|
||||
if (rp) {
|
||||
++rpCount;
|
||||
} else {
|
||||
// Plug* plug = dynamic_cast<Plug*>(*icomponent);
|
||||
// Plug* plug = dynamic_cast<Plug*>(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 );
|
||||
}
|
||||
|
|
|
@ -213,13 +213,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<Contact*> contactPointers;
|
||||
forEach(Component*, icom, (*inet)->getComponents()){
|
||||
Contact * contact = dynamic_cast<Contact*>(*icom);
|
||||
for(Component* com : net->getComponents()){
|
||||
Contact * contact = dynamic_cast<Contact*>(com);
|
||||
if(contact){
|
||||
contactPointers.push_back(contact);
|
||||
}
|
||||
|
@ -228,12 +228,12 @@ namespace Kite {
|
|||
contact->destroy();
|
||||
// Second pass: destroy unconnected segments added by Knik as blockages
|
||||
std::vector<Component*> compPointers;
|
||||
forEach(Component*, icom, (*inet)->getComponents()){
|
||||
Horizontal * h = dynamic_cast<Horizontal*>(*icom);
|
||||
for(Component* com : net->getComponents()){
|
||||
Horizontal * h = dynamic_cast<Horizontal*>(com);
|
||||
if(h){
|
||||
compPointers.push_back(h);
|
||||
}
|
||||
Vertical * v = dynamic_cast<Vertical*>(*icom);
|
||||
Vertical * v = dynamic_cast<Vertical*>(com);
|
||||
if(v){
|
||||
compPointers.push_back(v);
|
||||
}
|
||||
|
@ -344,12 +344,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())) {
|
||||
|
@ -358,7 +358,7 @@ namespace Kite {
|
|||
}
|
||||
coreReserved = getHTracksReservedLocal();
|
||||
} else {
|
||||
edge = ivertex->getVEdgeOut();
|
||||
edge = vertex->getVEdgeOut();
|
||||
if (not edge) continue;
|
||||
|
||||
if (chipTools.vPadsEnclosed(edge->getBoundingBox())) {
|
||||
|
@ -732,13 +732,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<Segment*>() ) {
|
||||
AutoSegment* autoSegment = ktbtSession->lookup( *isegment );
|
||||
for( Net* net : getCell()->getNets() ) {
|
||||
for( Segment* segment : net->getComponents().getSubSet<Segment*>() ) {
|
||||
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"
|
||||
|
@ -806,8 +806,8 @@ namespace Kite {
|
|||
{
|
||||
cerr << " o Checking " << net << endl;
|
||||
|
||||
forEach ( Segment*, isegment, net->getComponents().getSubSet<Segment*>() ) {
|
||||
TrackElement* trackSegment = _lookup( *isegment );
|
||||
for( Segment* segment : net->getComponents().getSubSet<Segment*>() ) {
|
||||
TrackElement* trackSegment = _lookup( segment );
|
||||
if (trackSegment) {
|
||||
trackSegment->_check();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<AutoContact*>& contacts = _gcells[igcell]->getContacts();
|
||||
for ( size_t i=0 ; i<contacts.size() ; i++ ) {
|
||||
forEach ( Hook*, ihook, contacts[i]->getBodyHook()->getSlaveHooks() ) {
|
||||
Hook* sourceHook = dynamic_cast<Segment::SourceHook*>(*ihook);
|
||||
for( Hook* hook : contacts[i]->getBodyHook()->getSlaveHooks() ) {
|
||||
Hook* sourceHook = dynamic_cast<Segment::SourceHook*>(hook);
|
||||
if (not sourceHook) continue;
|
||||
|
||||
segment = dynamic_cast<Segment*>(sourceHook->getComponent());
|
||||
|
@ -360,8 +360,8 @@ namespace Kite {
|
|||
ltrace(149) << "AutoSegments from AutoContacts" << endl;
|
||||
const vector<AutoContact*>& contacts = gcell->getContacts();
|
||||
for ( size_t i=0 ; i<contacts.size() ; i++ ) {
|
||||
forEach ( Component*, component, contacts[i]->getSlaveComponents() ) {
|
||||
segment = dynamic_cast<Segment*>(*component);
|
||||
for( Component* component : contacts[i]->getSlaveComponents() ) {
|
||||
segment = dynamic_cast<Segment*>(component);
|
||||
autoSegment = Session::base()->lookup( segment );
|
||||
ltrace(149) << autoSegment << endl;
|
||||
if (autoSegment and autoSegment->isCanonical()) {
|
||||
|
|
|
@ -49,8 +49,8 @@ namespace {
|
|||
)
|
||||
{
|
||||
TrackElement* perpandicular;
|
||||
forEach ( Segment*, isegment, segment->base()->getAutoSource()->getSlaveComponents().getSubSet<Segment*>() ) {
|
||||
perpandicular = Session::lookup ( *isegment );
|
||||
for( Segment* osegment : segment->base()->getAutoSource()->getSlaveComponents().getSubSet<Segment*>() ) {
|
||||
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<Segment*>() ) {
|
||||
perpandicular = Session::lookup ( *isegment );
|
||||
for( Segment* osegment : segment->base()->getAutoTarget()->getSlaveComponents().getSubSet<Segment*>() ) {
|
||||
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<Segment*>() ) {
|
||||
parallel = Session::lookup ( *isegment );
|
||||
for( Segment* osegment : rp->getSlaveComponents().getSubSet<Segment*>() ) {
|
||||
parallel = Session::lookup ( osegment );
|
||||
ltrace(200) << "* " << parallel << endl;
|
||||
|
||||
if ( parallel->isFixed () ) continue;
|
||||
|
@ -156,8 +156,8 @@ namespace {
|
|||
rp = dynamic_cast<RoutingPad*>(source->getAnchor());
|
||||
if (rp) {
|
||||
TrackElement* parallel;
|
||||
forEach ( Segment*, isegment, rp->getSlaveComponents().getSubSet<Segment*>() ) {
|
||||
parallel = Session::lookup( *isegment );
|
||||
for( Segment* osegment : rp->getSlaveComponents().getSubSet<Segment*>() ) {
|
||||
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<RoutingPad*>(support->getAnchor());
|
||||
|
||||
forEach( Component*, icomponent, rp->getSlaveComponents() ) {
|
||||
Horizontal* baseSegment = dynamic_cast<Horizontal*>( *icomponent );
|
||||
for( Component* component : rp->getSlaveComponents() ) {
|
||||
Horizontal* baseSegment = dynamic_cast<Horizontal*>( component );
|
||||
TrackElement* accessSegment = Session::lookup( baseSegment );
|
||||
|
||||
if (accessSegment and not accessSegment->isFixed()) {
|
||||
|
|
|
@ -80,16 +80,16 @@ namespace {
|
|||
|
||||
vector<Segment*> 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<Component*>(*isegment) ) continue;
|
||||
if ( not NetExternalComponents::isExternal(*isegment) ) continue;
|
||||
if ( usedComponent == dynamic_cast<Component*>(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 ; i<segments.size() ; ++i ) {
|
||||
|
@ -159,15 +159,15 @@ namespace Kite {
|
|||
{
|
||||
cmess1 << " o Protect external components not useds as RoutingPads." << endl;
|
||||
|
||||
forEach ( Net*, inet, getCell()->getNets() ) {
|
||||
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<RoutingPad*> rps;
|
||||
forEach ( RoutingPad*, irp, (*inet)->getRoutingPads() ) {
|
||||
rps.push_back ( *irp );
|
||||
for( RoutingPad* rp : net->getRoutingPads() ) {
|
||||
rps.push_back ( rp );
|
||||
}
|
||||
|
||||
for ( size_t i=0 ; i<rps.size() ; ++i )
|
||||
|
|
|
@ -504,15 +504,15 @@ namespace Kite {
|
|||
and (segment->base()->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);
|
||||
|
||||
|
|
|
@ -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<Segment*>() ) {
|
||||
dogleg = Session::lookup( *isegment );
|
||||
for( Segment* segment : base()->getAutoSource()->getSlaveComponents().getSubSet<Segment*>() ) {
|
||||
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<Segment*>() ) {
|
||||
dogleg = Session::lookup( *isegment );
|
||||
for( Segment* segment : base()->getAutoTarget()->getSlaveComponents().getSubSet<Segment*>() ) {
|
||||
dogleg = Session::lookup( segment );
|
||||
if (dogleg and (dogleg->getDirection() == direction)) {
|
||||
ltrace(200) << "Target dogleg: " << dogleg << endl;
|
||||
return dogleg;
|
||||
|
|
Loading…
Reference in New Issue