2016-07-21 17:14:17 -05:00
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
|
|
|
// This file is part of the Coriolis Software.
|
2018-01-06 10:55:44 -06:00
|
|
|
// Copyright (c) UPMC 2014-2018, All Rights Reserved
|
2016-07-21 17:14:17 -05:00
|
|
|
//
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
// | C O R I O L I S |
|
|
|
|
// | A n a b a t i c - Global Routing Toolbox |
|
|
|
|
// | |
|
|
|
|
// | Author : Jean-Paul CHAPUT |
|
|
|
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
|
|
|
// | =============================================================== |
|
|
|
|
// | C++ Module : "./PreRouteds.cpp" |
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
#include "hurricane/Warning.h"
|
|
|
|
#include "hurricane/BasicLayer.h"
|
|
|
|
#include "hurricane/RegularLayer.h"
|
|
|
|
#include "hurricane/DeepNet.h"
|
|
|
|
#include "hurricane/Pin.h"
|
|
|
|
#include "hurricane/RoutingPad.h"
|
|
|
|
#include "crlcore/AllianceFramework.h"
|
|
|
|
#include "anabatic/AnabaticEngine.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Anabatic {
|
|
|
|
|
|
|
|
using std::cerr;
|
|
|
|
using std::cout;
|
|
|
|
using std::endl;
|
|
|
|
using Hurricane::Error;
|
|
|
|
using Hurricane::Warning;
|
|
|
|
using Hurricane::BasicLayer;
|
|
|
|
using Hurricane::RegularLayer;
|
|
|
|
using Hurricane::Component;
|
|
|
|
using Hurricane::Pin;
|
|
|
|
using Hurricane::DeepNet;
|
|
|
|
using Hurricane::Cell;
|
|
|
|
using Hurricane::NetRoutingExtension;
|
|
|
|
using CRL::RoutingGauge;
|
|
|
|
using CRL::RoutingLayerGauge;
|
|
|
|
using CRL::AllianceFramework;
|
|
|
|
|
|
|
|
|
|
|
|
void AnabaticEngine::setupSpecialNets ()
|
|
|
|
{
|
|
|
|
AllianceFramework* af = AllianceFramework::get();
|
|
|
|
for ( Net* net : _cell->getNets() ) {
|
|
|
|
const char* excludedType = NULL;
|
|
|
|
if (net->getType() == Net::Type::POWER ) excludedType = "POWER";
|
|
|
|
if (net->getType() == Net::Type::GROUND) excludedType = "GROUND";
|
|
|
|
if (excludedType) {
|
|
|
|
cparanoid << Warning( "%s is not a routable net (%s,excluded)."
|
|
|
|
, getString(net).c_str(), excludedType ) << endl;
|
|
|
|
}
|
|
|
|
if (af->isBLOCKAGE(net->getName())) excludedType = "BLOCKAGE";
|
|
|
|
if (excludedType) {
|
2016-07-31 11:43:44 -05:00
|
|
|
NetData* ndata = getNetData( net, Flags::Create );
|
|
|
|
NetRoutingState* state = ndata->getNetRoutingState();
|
2016-07-21 17:14:17 -05:00
|
|
|
state->setFlags( NetRoutingState::Fixed );
|
2016-07-31 11:43:44 -05:00
|
|
|
ndata->setGlobalRouted( true );
|
2016-07-21 17:14:17 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-03 11:28:27 -05:00
|
|
|
size_t AnabaticEngine::setupPreRouteds ()
|
2016-07-21 17:14:17 -05:00
|
|
|
{
|
|
|
|
cmess1 << " o Looking for fixed or manually global routed nets." << endl;
|
|
|
|
|
Anabatic transient commit 18. Port of Kite (Katana), Yeah, Baby! Yeah!
* Bug: In Hurricane, in StaticObservable::getObserver(), if the slot
pointer is NULL, do not try to access the owner. Returns NULL, so
the caller can be aware of the situation...
* Change: In Hurricane, in BreakpointWidget & ExceptionWidget some
cosmetic changes (fonts and window sizes).
* Bug: In Anabatic, In AutoHorizontal::getConstraints(), take into account
the constraints from the source AutoContact, as it holds the constraints
transmitted by the RoutingPads and sets up by propageConstraintsFromRp().
It is likely to be a bug affecting the original Katabatic as well.
* Change: In Anabatic, in RawGCellsUnder(), check that the segment is not
completly oustside the cell abutment box and truncate the coordinates
to the part that is inside. Use the "shrink" if we reach the east/north
border.
* Change: In Anabatic, in Configuration, no more decorator because we will
use a true derived relationship. Katana *derives* from *Anabatic* and do
not *decorate* it, so the Configuration can do the same. It also implies
that we directly create a Katana engine, not an Anabatic one.
* Change: In Anabatic, in Session, do not allow the opening of the Session
in a standalone fashion (with a static method). Instead it must be opened
using the relevant method of the Anabatic/Katana engine. This ensure we
are opening the right Session type.
* Change: In Anabatic, in AutoSegment_Aligneds() collection the seed segment
is not part of the collection by default, but will be included if the
Flags::WithSelf is set.
* Change: In Configuration, all the flags value are now defined in two steps.
Declared in the header and initialized in the module. This is to prevent
the fact that on some cases, in relation with the Python "extern C" part
modules, we need a true allocated variable. It was causing weird linking
problems.
A side effect is that they can no longer be used as entry is switches,
have to replace them by if/else.
* New: In Anabatic, new GCell::getNeighborAt() utility function.
* Bug: In Anabatic, in GCell::doGrid(), tag all the GCells of the grid with
the grid type... Back annote all the edges capacity (north & east) with
the reserved local capacity.
* New: Complete portage of Kite over Anabatic. The new engine is christened
"Katana" for Kite-Analogic. When it's capabilities and performances
will be on a part with Kite, it is to completly replace it (and take
back the "Kite" name). Preliminary tests seems to show that, contrary
to intuition (because built on a more complex/slower grid), it is even
slightly faster than Kite 8-).
2016-08-15 09:30:13 -05:00
|
|
|
openSession();
|
|
|
|
|
2018-06-03 11:28:27 -05:00
|
|
|
size_t toBeRouteds = 0;
|
|
|
|
|
2016-07-21 17:14:17 -05:00
|
|
|
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;
|
|
|
|
vector<Contact*> contacts;
|
|
|
|
|
|
|
|
bool isPreRouted = false;
|
|
|
|
bool isFixed = false;
|
|
|
|
size_t rpCount = 0;
|
|
|
|
|
2018-06-03 11:28:27 -05:00
|
|
|
for( Component* component : net->getComponents() ) {
|
|
|
|
if (dynamic_cast<Pin*>(component)) continue;
|
2016-07-21 17:14:17 -05:00
|
|
|
|
2018-06-03 11:28:27 -05:00
|
|
|
const RegularLayer* layer = dynamic_cast<const RegularLayer*>(component->getLayer());
|
|
|
|
if (layer and (layer->getBasicLayer()->getMaterial() == BasicLayer::Material::blockage))
|
|
|
|
continue;
|
2016-07-21 17:14:17 -05:00
|
|
|
|
2018-06-03 11:28:27 -05:00
|
|
|
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) {
|
2016-07-21 17:14:17 -05:00
|
|
|
isPreRouted = true;
|
2018-06-03 11:28:27 -05:00
|
|
|
segments.push_back( vertical );
|
|
|
|
if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer()))
|
2016-07-21 17:14:17 -05:00
|
|
|
isFixed = true;
|
|
|
|
} else {
|
2018-06-03 11:28:27 -05:00
|
|
|
Contact* contact = dynamic_cast<Contact*>(component);
|
|
|
|
if (contact) {
|
2016-07-21 17:14:17 -05:00
|
|
|
isPreRouted = true;
|
2018-06-03 11:28:27 -05:00
|
|
|
contacts.push_back( contact );
|
|
|
|
if ( (contact->getWidth () != Session::getViaWidth(contact->getLayer()))
|
|
|
|
or (contact->getHeight() != Session::getViaWidth(contact->getLayer()))
|
|
|
|
or (contact->getLayer () == Session::getContactLayer(0)) )
|
2016-07-21 17:14:17 -05:00
|
|
|
isFixed = true;
|
|
|
|
} else {
|
2018-06-03 11:28:27 -05:00
|
|
|
RoutingPad* rp = dynamic_cast<RoutingPad*>(component);
|
|
|
|
if (rp) {
|
|
|
|
++rpCount;
|
2016-07-21 17:14:17 -05:00
|
|
|
} else {
|
2018-06-03 11:28:27 -05:00
|
|
|
// Plug* plug = dynamic_cast<Plug*>(component);
|
|
|
|
// if (plug) {
|
|
|
|
// cerr << "buildPreRouteds(): " << plug << endl;
|
|
|
|
// ++rpCount;
|
|
|
|
// }
|
2016-07-21 17:14:17 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-03 11:28:27 -05:00
|
|
|
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; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-21 17:14:17 -05:00
|
|
|
if (isFixed or isPreRouted or (rpCount < 2)) {
|
2016-07-31 11:43:44 -05:00
|
|
|
NetData* ndata = getNetData( net, Flags::Create );
|
|
|
|
NetRoutingState* state = ndata->getNetRoutingState();
|
2016-07-21 17:14:17 -05:00
|
|
|
state->unsetFlags( NetRoutingState::AutomaticGlobalRoute );
|
|
|
|
state->setFlags ( NetRoutingState::ManualGlobalRoute );
|
2016-07-31 11:43:44 -05:00
|
|
|
ndata->setGlobalRouted( true );
|
2016-07-21 17:14:17 -05:00
|
|
|
if (rpCount < 2)
|
|
|
|
state->setFlags ( NetRoutingState::Unconnected );
|
|
|
|
|
|
|
|
if (isFixed) {
|
|
|
|
cmess2 << " - <" << net->getName() << "> is fixed." << endl;
|
|
|
|
state->unsetFlags( NetRoutingState::ManualGlobalRoute );
|
|
|
|
state->setFlags ( NetRoutingState::Fixed );
|
|
|
|
} else {
|
|
|
|
if (rpCount > 1) {
|
2018-06-03 11:28:27 -05:00
|
|
|
++toBeRouteds;
|
|
|
|
|
2016-07-21 17:14:17 -05:00
|
|
|
cmess2 << " - <" << net->getName() << "> is manually global routed." << endl;
|
|
|
|
for ( auto icontact : contacts ) {
|
|
|
|
AutoContact::createFrom( icontact );
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( auto isegment : segments ) {
|
|
|
|
AutoContact* source = Session::lookup( dynamic_cast<Contact*>( isegment->getSource() ));
|
|
|
|
AutoContact* target = Session::lookup( dynamic_cast<Contact*>( isegment->getTarget() ));
|
|
|
|
AutoSegment* autoSegment = AutoSegment::create( source, target, isegment );
|
Katana manage wide wires, and they can also be symmetric.
* New: In Anabatic::AutoContact and the derived classes, manages wide
wires. The contact self dimension itself according to the segments
it is connected to. Special case for the AutoContactTerminal which
also read the size of the component it is anchored upon.
New refresh method "updateSize()" and flag CntInvalidatedWidth.
to compute the size.
In AutoContactTerminal, compute the constraint box according to
the width of the segment.
* New: In Anabatic::AutoSegment, flags are now implemented as "static const"
attributes of the class. The flags are stored into a uint64_t as
they are more than 32.
Added new flag "SegWide" and associated predicates.
* Change: In GCellTopology::_doHChannel() and GCellTopology::_doVChannel(),
uses the simpler overload of AutoSegment::create() in order to detect
the wire width automatically.
* New: In Katana::Manipulator, split insertToTrack() and forceToTrack()
into a one-track method and a segment level method that iterate over
the track span of the segment.
* New: In Katana::SegmentFsm, for each cost in the table, now allow access
to a specific track. So the base functions have now two parameters:
"icost" and "itrack" (has a cost can have multiple tracks in the case
of wide segments).
* Change: In Katana::TrackElement, remove the index of the element inside
it's track, as for a wide segment it will not be meaningful for the
non-base track. This means that we have to use the Track::find()
method each time instead.
Remove the wide flag, as it is a duplicate of the one in AutoSegment.
Added a getTrackCount() method to tell the number of track the
segment is inserted into. Needed in the Track destroy step to delete
a segment only when the last track that refers it is destroyed.
Added getSymmetricAxis() to correct the computation of the symmetric
base track in case of wide segment as the base track is not centered
but the the leftmost one.
* Change: In Track::insert() insert wide segments in their whole track span.
* Change: In TrackCost, create an array of costs according to the segment
track span.
* Change: In TrackSegment::create(), now activate the factory and create
wide segments.
* Bug: In Katana::AutoSegments_Perpandicular, correct the debug indentation
problem (ever shifting to the right).
2017-07-28 08:30:22 -05:00
|
|
|
autoSegment->setFlags( AutoSegment::SegUserDefined|AutoSegment::SegAxisSet );
|
2016-07-21 17:14:17 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-06-03 11:28:27 -05:00
|
|
|
} else {
|
|
|
|
++toBeRouteds;
|
2016-07-21 17:14:17 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Anabatic transient commit 18. Port of Kite (Katana), Yeah, Baby! Yeah!
* Bug: In Hurricane, in StaticObservable::getObserver(), if the slot
pointer is NULL, do not try to access the owner. Returns NULL, so
the caller can be aware of the situation...
* Change: In Hurricane, in BreakpointWidget & ExceptionWidget some
cosmetic changes (fonts and window sizes).
* Bug: In Anabatic, In AutoHorizontal::getConstraints(), take into account
the constraints from the source AutoContact, as it holds the constraints
transmitted by the RoutingPads and sets up by propageConstraintsFromRp().
It is likely to be a bug affecting the original Katabatic as well.
* Change: In Anabatic, in RawGCellsUnder(), check that the segment is not
completly oustside the cell abutment box and truncate the coordinates
to the part that is inside. Use the "shrink" if we reach the east/north
border.
* Change: In Anabatic, in Configuration, no more decorator because we will
use a true derived relationship. Katana *derives* from *Anabatic* and do
not *decorate* it, so the Configuration can do the same. It also implies
that we directly create a Katana engine, not an Anabatic one.
* Change: In Anabatic, in Session, do not allow the opening of the Session
in a standalone fashion (with a static method). Instead it must be opened
using the relevant method of the Anabatic/Katana engine. This ensure we
are opening the right Session type.
* Change: In Anabatic, in AutoSegment_Aligneds() collection the seed segment
is not part of the collection by default, but will be included if the
Flags::WithSelf is set.
* Change: In Configuration, all the flags value are now defined in two steps.
Declared in the header and initialized in the module. This is to prevent
the fact that on some cases, in relation with the Python "extern C" part
modules, we need a true allocated variable. It was causing weird linking
problems.
A side effect is that they can no longer be used as entry is switches,
have to replace them by if/else.
* New: In Anabatic, new GCell::getNeighborAt() utility function.
* Bug: In Anabatic, in GCell::doGrid(), tag all the GCells of the grid with
the grid type... Back annote all the edges capacity (north & east) with
the reserved local capacity.
* New: Complete portage of Kite over Anabatic. The new engine is christened
"Katana" for Kite-Analogic. When it's capabilities and performances
will be on a part with Kite, it is to completly replace it (and take
back the "Kite" name). Preliminary tests seems to show that, contrary
to intuition (because built on a more complex/slower grid), it is even
slightly faster than Kite 8-).
2016-08-15 09:30:13 -05:00
|
|
|
Session::close();
|
2018-06-03 11:28:27 -05:00
|
|
|
|
|
|
|
return toBeRouteds;
|
2016-07-21 17:14:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // Anabatic namespace.
|