Detect double routing attempt in Katana.

* Change: In Anabatic::setupPreRouteds(), routed DeepNets can have
    components both at Occurrence root net devel and at top level.
    If no nets remains to route, set the tool state to EngineDriving,
    which prevent any further work (except for finalize).
This commit is contained in:
Jean-Paul Chaput 2018-06-03 18:28:27 +02:00
parent 1887f45135
commit 40b82212e3
3 changed files with 63 additions and 52 deletions

View File

@ -66,12 +66,14 @@ namespace Anabatic {
void AnabaticEngine::setupPreRouteds () size_t AnabaticEngine::setupPreRouteds ()
{ {
cmess1 << " o Looking for fixed or manually global routed nets." << endl; cmess1 << " o Looking for fixed or manually global routed nets." << endl;
openSession(); openSession();
size_t toBeRouteds = 0;
for ( Net* net : getCell()->getNets() ) { for ( Net* net : getCell()->getNets() ) {
if (net == _blockageNet) continue; if (net == _blockageNet) continue;
if (net->getType() == Net::Type::POWER ) continue; if (net->getType() == Net::Type::POWER ) continue;
@ -85,9 +87,52 @@ namespace Anabatic {
bool isFixed = false; bool isFixed = false;
size_t rpCount = 0; size_t rpCount = 0;
if (net->isDeepNet()) { for( Component* component : net->getComponents() ) {
rpCount = 2; if (dynamic_cast<Pin*>(component)) continue;
const RegularLayer* layer = dynamic_cast<const RegularLayer*>(component->getLayer());
if (layer and (layer->getBasicLayer()->getMaterial() == BasicLayer::Material::blockage))
continue;
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*>(component);
if (vertical) {
isPreRouted = true;
segments.push_back( vertical );
if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer()))
isFixed = true;
} else {
Contact* contact = dynamic_cast<Contact*>(component);
if (contact) {
isPreRouted = true;
contacts.push_back( contact );
if ( (contact->getWidth () != Session::getViaWidth(contact->getLayer()))
or (contact->getHeight() != Session::getViaWidth(contact->getLayer()))
or (contact->getLayer () == Session::getContactLayer(0)) )
isFixed = true;
} else {
RoutingPad* rp = dynamic_cast<RoutingPad*>(component);
if (rp) {
++rpCount;
} else {
// Plug* plug = dynamic_cast<Plug*>(component);
// if (plug) {
// cerr << "buildPreRouteds(): " << plug << endl;
// ++rpCount;
// }
}
}
}
}
}
if ((not isFixed and not isPreRouted) and net->isDeepNet()) {
Net* rootNet = dynamic_cast<Net*>( Net* rootNet = dynamic_cast<Net*>(
dynamic_cast<DeepNet*>(net)->getRootNetOccurrence().getEntity() ); dynamic_cast<DeepNet*>(net)->getRootNetOccurrence().getEntity() );
for( Component* component : rootNet->getComponents() ) { for( Component* component : rootNet->getComponents() ) {
@ -95,50 +140,6 @@ namespace Anabatic {
if (dynamic_cast<Vertical*> (component)) { isFixed = true; break; } if (dynamic_cast<Vertical*> (component)) { isFixed = true; break; }
if (dynamic_cast<Contact*> (component)) { isFixed = true; break; } if (dynamic_cast<Contact*> (component)) { isFixed = true; break; }
} }
} else {
for( Component* component : net->getComponents() ) {
if (dynamic_cast<Pin*>(component)) continue;
const RegularLayer* layer = dynamic_cast<const RegularLayer*>(component->getLayer());
if (layer and (layer->getBasicLayer()->getMaterial() == BasicLayer::Material::blockage))
continue;
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*>(component);
if (vertical) {
isPreRouted = true;
segments.push_back( vertical );
if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer()))
isFixed = true;
} else {
Contact* contact = dynamic_cast<Contact*>(component);
if (contact) {
isPreRouted = true;
contacts.push_back( contact );
if ( (contact->getWidth () != Session::getViaWidth(contact->getLayer()))
or (contact->getHeight() != Session::getViaWidth(contact->getLayer())) )
isFixed = true;
} else {
RoutingPad* rp = dynamic_cast<RoutingPad*>(component);
if (rp) {
++rpCount;
} else {
// Plug* plug = dynamic_cast<Plug*>(component);
// if (plug) {
// cerr << "buildPreRouteds(): " << plug << endl;
// ++rpCount;
// }
}
}
}
}
}
} }
if (isFixed or isPreRouted or (rpCount < 2)) { if (isFixed or isPreRouted or (rpCount < 2)) {
@ -156,6 +157,8 @@ namespace Anabatic {
state->setFlags ( NetRoutingState::Fixed ); state->setFlags ( NetRoutingState::Fixed );
} else { } else {
if (rpCount > 1) { if (rpCount > 1) {
++toBeRouteds;
cmess2 << " - <" << net->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 );
@ -169,10 +172,14 @@ namespace Anabatic {
} }
} }
} }
} else {
++toBeRouteds;
} }
} }
Session::close(); Session::close();
return toBeRouteds;
} }

View File

@ -240,7 +240,7 @@ namespace Anabatic {
inline void setBlockageNet ( Net* ); inline void setBlockageNet ( Net* );
void chipPrep (); void chipPrep ();
void setupSpecialNets (); void setupSpecialNets ();
void setupPreRouteds (); size_t setupPreRouteds ();
void loadGlobalRouting ( uint32_t method ); void loadGlobalRouting ( uint32_t method );
void computeNetConstraints ( Net* ); void computeNetConstraints ( Net* );
void toOptimals ( Net* ); void toOptimals ( Net* );

View File

@ -234,10 +234,14 @@ namespace Katana {
setupRoutingPlanes(); setupRoutingPlanes();
} }
setupSpecialNets(); setupSpecialNets();
setupPreRouteds(); if (not setupPreRouteds()) {
if (not isChannelMode()) { setState( Anabatic::EngineDriving );
setupPowerRails(); throw Error( "KatanaEngine::digitalInit(): All nets are already routed, doing nothing." );
protectRoutingPads(); } else {
if (not isChannelMode()) {
setupPowerRails();
protectRoutingPads();
}
} }
_runKatanaInit(); _runKatanaInit();