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;
openSession();
size_t toBeRouteds = 0;
for ( Net* net : getCell()->getNets() ) {
if (net == _blockageNet) continue;
if (net->getType() == Net::Type::POWER ) continue;
@ -85,17 +87,6 @@ namespace Anabatic {
bool isFixed = false;
size_t rpCount = 0;
if (net->isDeepNet()) {
rpCount = 2;
Net* rootNet = dynamic_cast<Net*>(
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 {
for( Component* component : net->getComponents() ) {
if (dynamic_cast<Pin*>(component)) continue;
@ -122,7 +113,8 @@ namespace Anabatic {
isPreRouted = true;
contacts.push_back( contact );
if ( (contact->getWidth () != Session::getViaWidth(contact->getLayer()))
or (contact->getHeight() != 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);
@ -139,6 +131,15 @@ namespace Anabatic {
}
}
}
if ((not isFixed and not isPreRouted) and net->isDeepNet()) {
Net* rootNet = dynamic_cast<Net*>(
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; }
}
}
if (isFixed or isPreRouted or (rpCount < 2)) {
@ -156,6 +157,8 @@ namespace Anabatic {
state->setFlags ( NetRoutingState::Fixed );
} else {
if (rpCount > 1) {
++toBeRouteds;
cmess2 << " - <" << net->getName() << "> is manually global routed." << endl;
for ( auto icontact : contacts ) {
AutoContact::createFrom( icontact );
@ -169,10 +172,14 @@ namespace Anabatic {
}
}
}
} else {
++toBeRouteds;
}
}
Session::close();
return toBeRouteds;
}

View File

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

View File

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