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,17 +87,6 @@ namespace Anabatic {
bool isFixed = false; bool isFixed = false;
size_t rpCount = 0; 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() ) { for( Component* component : net->getComponents() ) {
if (dynamic_cast<Pin*>(component)) continue; if (dynamic_cast<Pin*>(component)) continue;
@ -122,7 +113,8 @@ namespace Anabatic {
isPreRouted = true; isPreRouted = true;
contacts.push_back( contact ); contacts.push_back( contact );
if ( (contact->getWidth () != Session::getViaWidth(contact->getLayer())) 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; isFixed = true;
} else { } else {
RoutingPad* rp = dynamic_cast<RoutingPad*>(component); 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)) { 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,11 +234,15 @@ namespace Katana {
setupRoutingPlanes(); setupRoutingPlanes();
} }
setupSpecialNets(); setupSpecialNets();
setupPreRouteds(); if (not setupPreRouteds()) {
setState( Anabatic::EngineDriving );
throw Error( "KatanaEngine::digitalInit(): All nets are already routed, doing nothing." );
} else {
if (not isChannelMode()) { if (not isChannelMode()) {
setupPowerRails(); setupPowerRails();
protectRoutingPads(); protectRoutingPads();
} }
}
_runKatanaInit(); _runKatanaInit();
cdebug_tabw(155,-1); cdebug_tabw(155,-1);