2016-05-30 04:30:29 -05:00
|
|
|
// -*- mode: C++; explicit-buffer-name: "Dijkstra.cpp<anabatic>" -*-
|
|
|
|
//
|
|
|
|
// This file is part of the Coriolis Software.
|
|
|
|
// Copyright (c) UPMC 2016-2016, All Rights Reserved
|
|
|
|
//
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
// | 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 : "./anabatic/Dijkstra.cpp" |
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
#include <limits>
|
2017-02-14 08:47:22 -06:00
|
|
|
#include <algorithm>
|
2016-05-30 04:30:29 -05:00
|
|
|
#include "hurricane/Error.h"
|
|
|
|
#include "hurricane/Net.h"
|
|
|
|
#include "hurricane/RoutingPad.h"
|
|
|
|
#include "hurricane/Horizontal.h"
|
|
|
|
#include "hurricane/Vertical.h"
|
|
|
|
#include "hurricane/UpdateSession.h"
|
2016-06-10 11:27:06 -05:00
|
|
|
#include "hurricane/DebugSession.h"
|
2016-06-17 06:09:34 -05:00
|
|
|
#include "crlcore/Utilities.h"
|
2016-05-30 04:30:29 -05:00
|
|
|
#include "anabatic/AnabaticEngine.h"
|
|
|
|
#include "anabatic/Dijkstra.h"
|
2017-02-14 08:47:22 -06:00
|
|
|
#include "hurricane/DataBase.h"
|
|
|
|
#include "hurricane/viewer/CellViewer.h"
|
|
|
|
#include "hurricane/Technology.h"
|
2017-03-08 10:49:23 -06:00
|
|
|
#include "hurricane/NetRoutingProperty.h"
|
2017-02-14 08:47:22 -06:00
|
|
|
|
2016-05-30 04:30:29 -05:00
|
|
|
|
|
|
|
namespace Anabatic {
|
|
|
|
|
|
|
|
using std::cerr;
|
|
|
|
using std::endl;
|
|
|
|
using std::numeric_limits;
|
Anabatic transient commit 6 "Somatoline, ca marche!".
* Bug: In Anabatic:
- In Dijktra::load(), do not create Contact while looping over the Net's
components (for RoutingPads).
- In Dijkstra::propagate(), reset the connexId of reached Vertexes
on updating the stamp to avoid using connexId from previous runs.
Push the vertexes on the queue while backtracking (with a distance
of 0.0). Do not reset the "_from" as we need it in Dijkstra::toWires()
to know how were the routing is.
- In Edge::getDistance(), convert to float more early so the normalisation
do not always end up in zero.
- In GCell::_add(), when the axis of the new edge is equal to one already
on the given side, adds it *after* the existing edge and not before.
(to be coherent with the way GCells are split in two)
- In GCell::hcut() and GCell::vcut(), create an Edge if is equal to X/Y Max,
*but* the new chunk is flat. The new chunk is then expected to expand
"below".
- In GraphicsAnabaticEngine::drawGCell(), display the id of the GCell in
a small box at the center of it's bounding box. Nothing displayed for
flat GCells, to avoid cluttering.
2016-06-05 11:38:09 -05:00
|
|
|
using Hurricane::ForEachIterator;
|
2016-05-30 04:30:29 -05:00
|
|
|
using Hurricane::Error;
|
|
|
|
using Hurricane::Component;
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
using Hurricane::Segment;
|
2016-05-30 04:30:29 -05:00
|
|
|
using Hurricane::Horizontal;
|
|
|
|
using Hurricane::Vertical;
|
|
|
|
using Hurricane::RoutingPad;
|
|
|
|
using Hurricane::UpdateSession;
|
2016-06-10 11:27:06 -05:00
|
|
|
using Hurricane::DebugSession;
|
2017-03-08 10:49:23 -06:00
|
|
|
using Hurricane::NetRoutingExtension;
|
|
|
|
|
|
|
|
|
2017-02-14 08:47:22 -06:00
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "Anabatic::IntervalC".
|
|
|
|
|
|
|
|
|
|
|
|
IntervalC::IntervalC()
|
|
|
|
{
|
|
|
|
_min = Vertex::unreached;
|
|
|
|
_max = Vertex::unreached;
|
|
|
|
_axis = Vertex::unreached;
|
2017-04-25 11:06:53 -05:00
|
|
|
_flags = 0;
|
2017-02-14 08:47:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
IntervalC::IntervalC(IntervalC& i)
|
2017-02-14 08:47:22 -06:00
|
|
|
{
|
2017-04-25 11:06:53 -05:00
|
|
|
_min = i.getMin();
|
|
|
|
_max = i.getMax();
|
|
|
|
_axis = i.getAxis();
|
|
|
|
setFlags(i.getFlags());
|
2017-02-14 08:47:22 -06:00
|
|
|
}
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
|
|
|
|
IntervalC::IntervalC(const IntervalC& i)
|
2017-04-18 04:58:55 -05:00
|
|
|
{
|
2017-04-25 11:06:53 -05:00
|
|
|
_min = i.getMin();
|
|
|
|
_max = i.getMax();
|
|
|
|
_axis = i.getAxis();
|
|
|
|
setFlags(i.getFlags());
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
2017-02-14 08:47:22 -06:00
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
|
|
|
|
IntervalC::~IntervalC() {}
|
|
|
|
|
|
|
|
|
2017-02-14 08:47:22 -06:00
|
|
|
void IntervalC::set ( DbU::Unit min, DbU::Unit max, DbU::Unit axis )
|
|
|
|
{
|
|
|
|
_min = min;
|
|
|
|
_max = max;
|
|
|
|
_axis = axis;
|
|
|
|
setiSet();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void IntervalC::setRange( DbU::Unit vmin, DbU::Unit vmax )
|
|
|
|
{
|
|
|
|
if (vmin < vmax){
|
|
|
|
_min = vmin;
|
|
|
|
_max = vmax;
|
|
|
|
setiSet();
|
|
|
|
} else {
|
|
|
|
_min = vmax;
|
|
|
|
_max = vmin;
|
|
|
|
setiSet();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void IntervalC::extendMin( DbU::Unit vmin )
|
|
|
|
{
|
|
|
|
if (_min > vmin) _min = vmin;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void IntervalC::extendMax( DbU::Unit vmax )
|
|
|
|
{
|
|
|
|
if (_max < vmax) _max = vmax;
|
|
|
|
}
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
|
2017-02-14 08:47:22 -06:00
|
|
|
void IntervalC::print() const
|
|
|
|
{
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "[IntervalC]: min: " << DbU::getValueString(_min) << ", max:" << DbU::getValueString(_max) << ", axis:" << DbU::getValueString(_axis) << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void IntervalC::reset()
|
|
|
|
{
|
|
|
|
_min = Vertex::unreached;
|
|
|
|
_max = Vertex::unreached;
|
|
|
|
_axis = Vertex::unreached;
|
|
|
|
_flags &= ~iSet;
|
|
|
|
}
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "Anabatic::GRAData".
|
|
|
|
GRAData::GRAData ()
|
|
|
|
: _intervfrom (IntervalC())
|
|
|
|
, _interv (IntervalC())
|
|
|
|
, _from2 (NULL)
|
|
|
|
, _intervfrom2 (IntervalC())
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
GRAData::~GRAData() {}
|
|
|
|
|
|
|
|
|
|
|
|
GRAData* GRAData::create()
|
|
|
|
{
|
|
|
|
return new GRAData();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GRAData::resetIntervals()
|
|
|
|
{
|
|
|
|
_interv.reset();
|
|
|
|
_intervfrom.reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GRAData::clearFrom2 ()
|
|
|
|
{
|
|
|
|
_from2 = NULL;
|
|
|
|
}
|
|
|
|
|
2016-05-30 04:30:29 -05:00
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "Anabatic::Vertex".
|
|
|
|
|
|
|
|
|
2016-09-30 11:09:05 -05:00
|
|
|
DbU::Unit Vertex::unreached = std::numeric_limits<long>::max();
|
2016-06-20 11:36:00 -05:00
|
|
|
DbU::Unit Vertex::unreachable = std::numeric_limits<long>::max()-1;
|
2016-05-30 04:30:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
bool Vertex::hasValidStamp () const
|
|
|
|
{ return _stamp == getAnabatic()->getStamp(); }
|
|
|
|
|
|
|
|
|
2017-02-14 08:47:22 -06:00
|
|
|
bool Vertex::hasRP( Net* net ) const
|
|
|
|
{
|
|
|
|
if (getGCell() != NULL ){
|
|
|
|
Cell* cell = getGCell()->getAnabatic()->getCell();
|
|
|
|
RoutingPad* rp = NULL;
|
|
|
|
for ( Component* component : cell->getComponentsUnder(getGCell()->getBoundingBox().inflate(-1)) ){
|
|
|
|
rp = dynamic_cast<RoutingPad*>( component );
|
|
|
|
if (rp) {
|
|
|
|
if (rp->getNet() == net) return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Vertex::hasVRP( Net* net ) const
|
|
|
|
{
|
|
|
|
if (getGCell() != NULL){
|
|
|
|
Cell* cell = getGCell()->getAnabatic()->getCell();
|
|
|
|
RoutingPad* rp = NULL;
|
|
|
|
for ( Component* component : cell->getComponentsUnder(getGCell()->getBoundingBox().inflate(-1)) ){
|
|
|
|
rp = dynamic_cast<RoutingPad*>( component );
|
|
|
|
if (rp) {
|
|
|
|
if (rp->getNet() == net) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (rp) {
|
|
|
|
Vertical* v = dynamic_cast<Vertical*>(rp->_getEntityAsSegment());
|
|
|
|
if (v) { return true; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Vertex::hasHRP( Net* net ) const
|
|
|
|
{
|
|
|
|
if (getGCell() != NULL){
|
|
|
|
Cell* cell = getGCell()->getAnabatic()->getCell();
|
|
|
|
RoutingPad* rp = NULL;
|
|
|
|
for ( Component* component : cell->getComponentsUnder(getGCell()->getBoundingBox().inflate(-1)) ){
|
|
|
|
rp = dynamic_cast<RoutingPad*>( component );
|
|
|
|
if (rp) {
|
|
|
|
if (rp->getNet() == net) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (rp) {
|
|
|
|
Horizontal* h = dynamic_cast<Horizontal*>(rp->_getEntityAsSegment());
|
|
|
|
if (h) { return true; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
bool Vertex::isRestricted ( const Vertex* v1, const Vertex* v2, DbU::Unit hpitch, DbU::Unit vpitch )
|
2017-02-14 08:47:22 -06:00
|
|
|
{
|
|
|
|
bool restricted = true;
|
|
|
|
GCell* c1 = v1->getGCell();
|
|
|
|
GCell* c2 = v2->getGCell();
|
|
|
|
|
|
|
|
// Check from GCell 1
|
|
|
|
if ( c1->isNorth(c2) ) {
|
|
|
|
if ( !v1->isNRestricted() ) restricted = false;
|
|
|
|
} else if ( c1->isSouth(c2) ) {
|
|
|
|
if ( !v1->isSRestricted() ) restricted = false;
|
|
|
|
} else if ( c1->isEast (c2) ) {
|
|
|
|
if ( !v1->isERestricted() ) restricted = false;
|
|
|
|
} else if ( c1->isWest (c2) ) {
|
|
|
|
if ( !v1->isWRestricted() ) restricted = false;
|
|
|
|
} else {
|
|
|
|
cerr << Error( "GCells are not side by side." ) << endl;
|
|
|
|
return true;
|
|
|
|
}
|
2017-04-25 11:06:53 -05:00
|
|
|
|
|
|
|
if ( (c1->getWidth() < hpitch)
|
|
|
|
||(c1->getHeight() < vpitch)
|
|
|
|
||(restricted)
|
|
|
|
) return true;
|
2017-02-14 08:47:22 -06:00
|
|
|
else {
|
2017-04-25 11:06:53 -05:00
|
|
|
restricted = true;
|
2017-02-14 08:47:22 -06:00
|
|
|
// Check from GCell 2
|
|
|
|
if ( c2->isNorth(c1) ) {
|
2017-04-25 11:06:53 -05:00
|
|
|
if ( !v2->isNRestricted() ) restricted = false;
|
2017-02-14 08:47:22 -06:00
|
|
|
} else if ( c2->isSouth(c1) ) {
|
2017-04-25 11:06:53 -05:00
|
|
|
if ( !v2->isSRestricted() ) restricted = false;
|
2017-02-14 08:47:22 -06:00
|
|
|
} else if ( c2->isEast (c1) ) {
|
2017-04-25 11:06:53 -05:00
|
|
|
if ( !v2->isERestricted() ) restricted = false;
|
2017-02-14 08:47:22 -06:00
|
|
|
} else if ( c2->isWest (c1) ) {
|
2017-04-25 11:06:53 -05:00
|
|
|
if ( !v2->isWRestricted() ) restricted = false;
|
2017-02-14 08:47:22 -06:00
|
|
|
} else {
|
|
|
|
cerr << Error( "GCells are not side by side." ) << endl;
|
|
|
|
return true;
|
|
|
|
}
|
2017-04-25 11:06:53 -05:00
|
|
|
if ( (c2->getWidth() < hpitch)
|
|
|
|
||(c2->getHeight() < vpitch)
|
|
|
|
||(restricted)
|
|
|
|
) return true;
|
|
|
|
else return false;
|
2017-02-14 08:47:22 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-04-18 04:58:55 -05:00
|
|
|
Point Vertex::getNextPathPoint( Point pcurr, const Vertex* vnext ) const
|
|
|
|
{
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,1) << "Point Dijkstra::getNextPathPoint( Point pcurr, const Vertex* vnext )" << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
if (vnext == NULL){
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
return Point(0,0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vnext->getGCell()->isMatrix()) {
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
return Point(vnext->getGCell()->getXCenter(), vnext->getGCell()->getYCenter());
|
|
|
|
}
|
|
|
|
|
|
|
|
GCell* gnext = vnext->getGCell();
|
|
|
|
GCell* gcurr = getGCell();
|
|
|
|
DbU::Unit x = 0;
|
|
|
|
DbU::Unit y = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (vnext->isV()){
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "Case next: Vertical: " << vnext->isiSet() << endl; //", d:" << vnext->getDistance() << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
if ((vnext->isiSet())&&(vnext->hasValidStamp())){
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "Case set" << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
x = vnext->getIAxis();
|
|
|
|
if (isNorth(vnext)) y = vnext->getIMin();
|
|
|
|
else if (isSouth(vnext)) y = vnext->getIMax();
|
|
|
|
else if ((isWest(vnext))||(isEast(vnext))) {
|
|
|
|
if ( pcurr.getY() > vnext->getIMax() ) y = vnext->getIMax();
|
|
|
|
else if ( pcurr.getY() < vnext->getIMin() ) y = vnext->getIMin();
|
|
|
|
else y = pcurr.getY();
|
|
|
|
} else cdebug_log(112,0) << "[ERROR](Point Vertex::getNextPathPoint2(...) const: Something is wrong.1" << endl;
|
|
|
|
} else {
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "Case not set" << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
if (isNorth(vnext)){
|
|
|
|
y = gcurr->getYMax();
|
|
|
|
if (pcurr.getX() < gnext->getXMin()) x = gnext->getXMin();
|
|
|
|
else if (pcurr.getX() > gnext->getXMax()) x = gnext->getXMax();
|
|
|
|
else x = pcurr.getX();
|
|
|
|
} else if (isSouth(vnext)){
|
|
|
|
y = gcurr->getYMin();
|
|
|
|
if (pcurr.getX() < gnext->getXMin()) x = gnext->getXMin();
|
|
|
|
else if (pcurr.getX() > gnext->getXMax()) x = gnext->getXMax();
|
|
|
|
else x = pcurr.getX();
|
|
|
|
} else if (isWest(vnext)){
|
|
|
|
x = gcurr->getXMin();
|
|
|
|
if (pcurr.getY() < gnext->getYMin()) y = gnext->getYMin();
|
|
|
|
else if (pcurr.getY() > gnext->getYMax()) y = gnext->getYMax();
|
|
|
|
else y = pcurr.getY();
|
|
|
|
|
|
|
|
} else if (isEast(vnext)){
|
|
|
|
x = gcurr->getXMax();
|
|
|
|
if (pcurr.getY() < gnext->getYMin()) y = gnext->getYMin();
|
|
|
|
else if (pcurr.getY() > gnext->getYMax()) y = gnext->getYMax();
|
|
|
|
else y = pcurr.getY();
|
|
|
|
} else cdebug_log(112,0) << "[ERROR](Point Vertex::getNextPathPoint2(...) const: Something is wrong.2" << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (vnext->isH()) {
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "Case next: Horizontal: " << vnext->isiSet() << endl; //", d:" << vnext->getDistance() << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
|
|
|
|
if ((vnext->isiSet())&&(vnext->hasValidStamp())){
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "Case set" << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
y = vnext->getIAxis();
|
|
|
|
if (isEast (vnext)) x = vnext->getIMin();
|
|
|
|
else if (isWest (vnext)) x = vnext->getIMax();
|
|
|
|
else if ((isNorth(vnext))||(isSouth(vnext))) {
|
|
|
|
if ( pcurr.getX() > vnext->getIMax() ) x = vnext->getIMax();
|
|
|
|
else if ( pcurr.getX() < vnext->getIMin() ) x = vnext->getIMin();
|
|
|
|
else x = pcurr.getX();
|
|
|
|
} else cdebug_log(112,0) << "[ERROR](Point Vertex::getNextPathPoint2(...) const: Something is wrong.3" << endl;
|
|
|
|
|
|
|
|
} else {
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "Case not set" << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
if (isNorth(vnext)){
|
|
|
|
y = gcurr->getYMax();
|
|
|
|
if (pcurr.getX() < gnext->getXMin()) x = gnext->getXMin();
|
|
|
|
else if (pcurr.getX() > gnext->getXMax()) x = gnext->getXMax();
|
|
|
|
else x = pcurr.getX();
|
|
|
|
} else if (isSouth(vnext)){
|
|
|
|
y = gcurr->getYMin();
|
|
|
|
if (pcurr.getX() < gnext->getXMin()) x = gnext->getXMin();
|
|
|
|
else if (pcurr.getX() > gnext->getXMax()) x = gnext->getXMax();
|
|
|
|
else x = pcurr.getX();
|
|
|
|
} else if (isWest(vnext)){
|
|
|
|
x = gcurr->getXMin();
|
|
|
|
if (pcurr.getY() < gnext->getYMin()) y = gnext->getYMin();
|
|
|
|
else if (pcurr.getY() > gnext->getYMax()) y = gnext->getYMax();
|
|
|
|
else y = pcurr.getY();
|
|
|
|
|
|
|
|
} else if (isEast(vnext)){
|
|
|
|
x = gcurr->getXMax();
|
|
|
|
if (pcurr.getY() < gnext->getYMin()) y = gnext->getYMin();
|
|
|
|
else if (pcurr.getY() > gnext->getYMax()) y = gnext->getYMax();
|
|
|
|
else y = pcurr.getY();
|
|
|
|
} else cdebug_log(112,0) << "[ERROR](Point Vertex::getNextPathPoint2(...) const: Something is wrong.4" << endl;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "[ERROR](Point Vertex::getNextPathPoint2(...) const: Something is wrong.5" << endl;
|
|
|
|
}
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_tabw(112,-1);
|
2017-04-18 04:58:55 -05:00
|
|
|
return Point(x,y);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Point Vertex::getStartPathPoint( const Vertex* next ) const
|
|
|
|
{
|
|
|
|
cdebug_log(112,1) << "Point Vertex::getStartPathPoint( const Vertex* next ) const:" << this << endl;
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
GCell* gcurr = getGCell();
|
|
|
|
GCell* gnext = next->getGCell();
|
|
|
|
DbU::Unit x = 0;
|
|
|
|
DbU::Unit y = 0;
|
|
|
|
IntervalC intervfrom = IntervalC();
|
|
|
|
|
|
|
|
if (_adata == NULL){
|
|
|
|
cdebug_log(112,1) << "Point Vertex::getStartPathPoint( const Vertex* next ) const: GRAData unset." << endl;
|
|
|
|
return Point(0,0);
|
|
|
|
}
|
2017-04-18 04:58:55 -05:00
|
|
|
|
|
|
|
if (gcurr->isDevice ()){
|
|
|
|
cdebug_log(112,0) << "Case device" << endl;
|
|
|
|
if (isH()){
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "hinterval: " << DbU::getValueString(getIAxis()) << endl;
|
|
|
|
y = getIAxis();
|
|
|
|
if ((gnext->getXMax() < getIMin())||(isWest (next))) x = getIMin();
|
|
|
|
else if ((gnext->getXMin() > getIMax())||(isEast (next))) x = getIMax();
|
|
|
|
else x = (max(gnext->getXMin(), getIMin())+min(gnext->getXMax(), getIMax()))/2;
|
2017-04-18 04:58:55 -05:00
|
|
|
|
|
|
|
} else if (isV()){
|
|
|
|
cdebug_log(112,0) << "vinterval" << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
x = getIAxis();
|
|
|
|
if ((gnext->getYMax() < getIMin())||(isSouth(next))) y = getIMin();
|
|
|
|
else if ((gnext->getYMin() > getIMax())||(isNorth(next))) y = getIMax();
|
|
|
|
else y = (max(gnext->getYMin(), getIMin())+min(gnext->getYMax(), getIMax()))/2 ;
|
2017-04-18 04:58:55 -05:00
|
|
|
} else {
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "[ERROR](Point Vertex::getStartPathPoint( const Vertex * next ) const: Something is wrong." << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
return Point(0,0);
|
|
|
|
}
|
|
|
|
} else if (isH()) {
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "Case horizontal: " << isiSet() << endl;
|
|
|
|
GCell* gprev = getGPrev(Vertex::From2Mode);
|
|
|
|
intervfrom = getIntervFrom(From2Mode);
|
2017-04-18 04:58:55 -05:00
|
|
|
Vertex* prev = gprev->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
cdebug_log(112,0) << "PREV: " << prev << " ";
|
2017-04-25 11:06:53 -05:00
|
|
|
intervfrom.print();
|
|
|
|
|
2017-04-18 04:58:55 -05:00
|
|
|
if (isiSet()){
|
|
|
|
cdebug_log(112,0) << "isiSet: ";
|
2017-04-25 11:06:53 -05:00
|
|
|
printInterv();
|
|
|
|
y = getIAxis();
|
|
|
|
if ((gnext->getXMax() < getIMin())||(isWest (next))) x = getIMin();
|
|
|
|
else if ((gnext->getXMin() > getIMax())||(isEast (next))) x = getIMax();
|
|
|
|
else x = (max(gnext->getXMin(), getIMin())+min(gnext->getXMax(), getIMax()))/2;
|
2017-04-18 04:58:55 -05:00
|
|
|
} else {
|
|
|
|
if (prev->isH()){
|
|
|
|
cdebug_log(112,0) << "prev is H" << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
if (gnext->getXMax() < intervfrom.getMin()) x = intervfrom.getMin();
|
|
|
|
else if (gnext->getXMin() > intervfrom.getMax()) x = intervfrom.getMax();
|
|
|
|
else x = (max(gnext->getXMin(), intervfrom.getMin())+min(gnext->getXMax(), intervfrom.getMax()))/2;
|
2017-04-18 04:58:55 -05:00
|
|
|
if (isNorth(prev)) y = gcurr->getYMax();
|
|
|
|
else if (isSouth(prev)) y = gcurr->getYMin();
|
2017-04-25 11:06:53 -05:00
|
|
|
else y = intervfrom.getAxis();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else if (prev->isV()){
|
|
|
|
cdebug_log(112,0) << "prev is V" << endl;
|
|
|
|
|
|
|
|
if (isNorth(prev)){
|
2017-04-25 11:06:53 -05:00
|
|
|
//cdebug_log(112,0) << "1" << endl;
|
|
|
|
x = intervfrom.getAxis();
|
2017-04-18 04:58:55 -05:00
|
|
|
y = gcurr->getYMax();
|
|
|
|
} else if (isSouth(prev)){
|
2017-04-25 11:06:53 -05:00
|
|
|
//cdebug_log(112,0) << "2" << endl;
|
|
|
|
x = intervfrom.getAxis();
|
2017-04-18 04:58:55 -05:00
|
|
|
y = gcurr->getYMin();
|
|
|
|
} else if (isWest (prev)){
|
2017-04-25 11:06:53 -05:00
|
|
|
//cdebug_log(112,0) << "3" << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
x = gcurr->getXMin();
|
|
|
|
if (isNorth(next)){
|
2017-04-25 11:06:53 -05:00
|
|
|
if (intervfrom.getMax() > gcurr->getYMax()) y = gcurr->getYMax();
|
|
|
|
else y = intervfrom.getMax();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else if (isSouth(next)){
|
2017-04-25 11:06:53 -05:00
|
|
|
if (intervfrom.getMin() < gcurr->getYMin()) y = gcurr->getYMin();
|
|
|
|
else y = intervfrom.getMin();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else { // East side
|
2017-04-25 11:06:53 -05:00
|
|
|
if ( intervfrom.getMin() < gcurr->getYMin() ){ y = gcurr->getYMin();
|
|
|
|
} else if ( intervfrom.getMax() > gcurr->getYMax() ){ y = gcurr->getYMax();
|
|
|
|
} else { y = (intervfrom.getMin() + intervfrom.getMax())/2 ;
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (isEast (prev)){
|
2017-04-25 11:06:53 -05:00
|
|
|
//cdebug_log(112,0) << "4" << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
x = gcurr->getXMax();
|
|
|
|
if (isNorth(next)){
|
2017-04-25 11:06:53 -05:00
|
|
|
if (intervfrom.getMax() > gcurr->getYMax()) y = gcurr->getYMax();
|
|
|
|
else y = intervfrom.getMax();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else if (isSouth(next)){
|
2017-04-25 11:06:53 -05:00
|
|
|
if (intervfrom.getMin() < gcurr->getYMin()) y = gcurr->getYMin();
|
|
|
|
else y = intervfrom.getMin();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else { // West side
|
2017-04-25 11:06:53 -05:00
|
|
|
if ( intervfrom.getMin() < gcurr->getYMin() ){ y = gcurr->getYMin();
|
|
|
|
} else if ( intervfrom.getMax() > gcurr->getYMax() ){ y = gcurr->getYMax();
|
|
|
|
} else { y = (intervfrom.getMin() + intervfrom.getMax())/2 ;
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "[ERROR](Point Vertex::getStartPathPoint() const: Something is wrong." << endl;
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
return Point(0,0);
|
|
|
|
}
|
|
|
|
cdebug_log(112,0) << "x: " << DbU::getValueString(x) << ", y:" << DbU::getValueString(y) << endl;
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "[ERROR](Point Vertex::getStartPathPoint() const: Something is wrong." << endl;
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
return Point(0,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (isV()) {
|
|
|
|
cdebug_log(112,0) << "Case vertical: " << isiSet() << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
//GCell* gprev = NULL;
|
|
|
|
GCell* gprev = getGPrev(Vertex::From2Mode);
|
|
|
|
intervfrom = getIntervFrom(From2Mode);
|
2017-04-18 04:58:55 -05:00
|
|
|
Vertex* prev = gprev->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
cdebug_log(112,0) << "PREV: " << prev << " ";
|
2017-04-25 11:06:53 -05:00
|
|
|
intervfrom.print();
|
2017-04-18 04:58:55 -05:00
|
|
|
|
|
|
|
if (isiSet()){
|
|
|
|
cdebug_log(112,0) << "isiSet: ";
|
2017-04-25 11:06:53 -05:00
|
|
|
printInterv();
|
|
|
|
x = getIAxis();
|
|
|
|
if ((gnext->getYMax() <= getIMin())||(isSouth(next))){
|
|
|
|
y = getIMin();
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
2017-04-25 11:06:53 -05:00
|
|
|
else if ((gnext->getYMin() >= getIMax())||(isNorth(next))){
|
|
|
|
y = getIMax();
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
|
|
|
else {
|
2017-04-25 11:06:53 -05:00
|
|
|
y = (max(gnext->getYMin(), getIMin())+min(gnext->getYMax(), getIMax()))/2 ;
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (prev->isH()){
|
|
|
|
cdebug_log(112,0) << "prev is H" << endl;
|
|
|
|
if (isNorth(prev)){
|
|
|
|
y = gcurr->getYMax();
|
|
|
|
if (isNorth(next)){
|
2017-04-25 11:06:53 -05:00
|
|
|
if (intervfrom.getMax() > gcurr->getXMax()) x = gcurr->getXMax();
|
|
|
|
else x = intervfrom.getMax();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else if (isSouth(next)){
|
2017-04-25 11:06:53 -05:00
|
|
|
if (intervfrom.getMin() < gcurr->getXMin()) x = gcurr->getXMin();
|
|
|
|
else x = intervfrom.getMin();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else { // West side
|
2017-04-25 11:06:53 -05:00
|
|
|
if ( intervfrom.getMin() < gcurr->getXMin() ){ x = gcurr->getXMin();
|
|
|
|
} else if ( intervfrom.getMax() > gcurr->getXMax() ){ x = gcurr->getXMax();
|
|
|
|
} else { x = (intervfrom.getMin() + intervfrom.getMax())/2 ;
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (isSouth(prev)){
|
|
|
|
y = gcurr->getYMin();
|
|
|
|
if (isEast(next)){
|
2017-04-25 11:06:53 -05:00
|
|
|
if (intervfrom.getMax() > gcurr->getXMax()) x = gcurr->getXMax();
|
|
|
|
else x = intervfrom.getMax();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else if (isWest(next)){
|
2017-04-25 11:06:53 -05:00
|
|
|
if (intervfrom.getMin() < gcurr->getXMin()) x = gcurr->getXMin();
|
|
|
|
else x = intervfrom.getMin();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else { // Northside
|
2017-04-25 11:06:53 -05:00
|
|
|
if ( intervfrom.getMin() < gcurr->getXMin() ){ x = gcurr->getXMin();
|
|
|
|
} else if ( intervfrom.getMax() > gcurr->getXMax() ){ x = gcurr->getXMax();
|
|
|
|
} else { x = (intervfrom.getMin() + intervfrom.getMax())/2 ;
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (isWest (prev)){
|
|
|
|
x = gcurr->getXMin();
|
2017-04-25 11:06:53 -05:00
|
|
|
y = intervfrom.getAxis();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else if (isEast (prev)){
|
|
|
|
x = gcurr->getXMax();
|
2017-04-25 11:06:53 -05:00
|
|
|
y = intervfrom.getAxis();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "[ERROR](Point Vertex::getStartPathPoint() const: Something is wrong." << endl;
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
return Point(0,0);
|
|
|
|
}
|
|
|
|
} else if (prev->isV()){
|
|
|
|
cdebug_log(112,0) << "prev is V" << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
if (gnext->getYMax() < intervfrom.getMin()) { y = intervfrom.getMin();
|
|
|
|
} else if (gnext->getYMin() > intervfrom.getMax()){ y = intervfrom.getMax();
|
|
|
|
} else{ y = (max(gnext->getYMin(), intervfrom.getMin())+min(gnext->getYMax(), intervfrom.getMax()))/2;
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if (isEast(prev)) x = gcurr->getXMax();
|
|
|
|
else if (isWest(prev)) x = gcurr->getXMin();
|
2017-04-25 11:06:53 -05:00
|
|
|
else x = intervfrom.getAxis();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "[ERROR](Point Vertex::getStartPathPoint() const: Something is wrong." << endl;
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
return Point(0,0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "[ERROR](Point Vertex::getStartPathPoint() const: Something is wrong." << endl;
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
return Point(0,0);
|
|
|
|
}
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
return Point(x,y);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-02-14 08:47:22 -06:00
|
|
|
bool Vertex::isH() const
|
|
|
|
{
|
|
|
|
GCell* gcell = getGCell();
|
2017-04-25 11:06:53 -05:00
|
|
|
if (gcell->isDevice()) return isiHorizontal();
|
2017-02-14 08:47:22 -06:00
|
|
|
else if (gcell->isHChannel()) return true;
|
2017-03-20 11:38:29 -05:00
|
|
|
else if (gcell->isStrut()) return ((gcell->getWidth() > gcell->getHeight())||(gcell->getWidth() == gcell->getHeight()));
|
2017-02-14 08:47:22 -06:00
|
|
|
else return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Vertex::isV() const
|
|
|
|
{
|
|
|
|
GCell* gcell = getGCell();
|
2017-04-25 11:06:53 -05:00
|
|
|
if (gcell->isDevice()) return isiVertical();
|
2017-02-14 08:47:22 -06:00
|
|
|
else if (gcell->isVChannel()) return true;
|
|
|
|
else if (gcell->isStrut()) return gcell->getWidth() < gcell->getHeight();
|
|
|
|
else return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Vertex::setIntervals ( Vertex* vcurr )
|
|
|
|
{
|
2017-04-18 04:58:55 -05:00
|
|
|
cdebug_log(112,1) << "!SETINTERVALS! ( Vertex* vcurr )" << endl;
|
|
|
|
Point pcurr;
|
|
|
|
if (isFromFrom2()){
|
2017-04-25 11:06:53 -05:00
|
|
|
vcurr->setFlags(Vertex::From2Mode);
|
2017-04-18 04:58:55 -05:00
|
|
|
pcurr = vcurr->getStartPathPoint(this);
|
2017-04-25 11:06:53 -05:00
|
|
|
vcurr->unsetFlags(Vertex::From2Mode);
|
2017-04-18 04:58:55 -05:00
|
|
|
} else {
|
|
|
|
pcurr = vcurr->getStartPathPoint(this);
|
|
|
|
}
|
|
|
|
Point pnext = vcurr->getNextPathPoint( pcurr, this );
|
2017-02-14 08:47:22 -06:00
|
|
|
cdebug_log(112,0) << "Pcurrent : X:" << DbU::getValueString(pcurr.getX()) << ", Y:" << DbU::getValueString(pcurr.getY()) << endl;
|
2017-03-20 11:38:29 -05:00
|
|
|
cdebug_log(112,0) << "Pneighbour: X:" << DbU::getValueString(pnext.getX()) << ", Y:" << DbU::getValueString(pnext.getY()) << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
DbU::Unit min, max, axis;
|
|
|
|
|
|
|
|
if (vcurr->isH()){
|
2017-03-20 11:38:29 -05:00
|
|
|
cdebug_log(112,0) << "case vcurr: Horizontal" << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
if ((vcurr->isiSet())&&(vcurr->hasValidStamp())){
|
2017-03-20 11:38:29 -05:00
|
|
|
cdebug_log(112,0) << "case set" << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
if (vcurr->getIMin() > pnext.getX()) {
|
|
|
|
min = pnext.getX();
|
|
|
|
max = vcurr->getIMax();
|
|
|
|
axis = vcurr->getIAxis();
|
|
|
|
} else if (vcurr->getIMax() < pnext.getX()) {
|
|
|
|
min = vcurr->getIMin();
|
|
|
|
max = pnext.getX();
|
|
|
|
axis = vcurr->getIAxis();
|
|
|
|
} else {
|
|
|
|
min = vcurr->getIMin();
|
|
|
|
max = vcurr->getIMax();
|
|
|
|
axis = vcurr->getIAxis();
|
|
|
|
}
|
|
|
|
} else {
|
2017-03-20 11:38:29 -05:00
|
|
|
cdebug_log(112,0) << "case not set" << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
axis = pcurr.getY();
|
2017-03-20 11:38:29 -05:00
|
|
|
bool hh = false;
|
|
|
|
if (vcurr->hasValidStamp() && (vcurr->getFrom() != NULL)){
|
2017-04-25 11:06:53 -05:00
|
|
|
GCell* gprev = vcurr->getGPrev(Vertex::UseFromFrom2);
|
2017-03-20 11:38:29 -05:00
|
|
|
Vertex* vprev = gprev->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
if (vprev->isH()) {
|
|
|
|
cdebug_log(112,0) << "----------------------------" << endl;
|
|
|
|
cdebug_log(112,0) << "HHCASE:" << endl;
|
|
|
|
cdebug_log(112,0) << "prev: " << vprev << endl;
|
|
|
|
cdebug_log(112,0) << "curr: " << vcurr << endl;
|
|
|
|
cdebug_log(112,0) << "next: " << this << endl;
|
|
|
|
cdebug_log(112,0) << "----------------------------" << endl;
|
|
|
|
hh = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (hh){
|
2017-04-18 04:58:55 -05:00
|
|
|
GCell* gcurr = vcurr->getGCell();
|
|
|
|
GCell* gnext = getGCell();
|
2017-04-25 11:06:53 -05:00
|
|
|
IntervalC intervfrom = vcurr->getIntervFrom(UseFromFrom2);
|
|
|
|
vcurr->printIntervfrom();
|
|
|
|
|
|
|
|
if (gnext->getXMin() > intervfrom.getMax()){
|
|
|
|
//cdebug_log(112,0) << "1" << endl;
|
|
|
|
min = intervfrom.getMax();
|
2017-04-18 04:58:55 -05:00
|
|
|
max = gnext->getXMin();
|
2017-04-25 11:06:53 -05:00
|
|
|
} else if (gnext->getXMax() < intervfrom.getMin()){
|
|
|
|
//cdebug_log(112,0) << "2" << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
min = gnext->getXMax();
|
2017-04-25 11:06:53 -05:00
|
|
|
max = intervfrom.getMin();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else {
|
2017-04-25 11:06:53 -05:00
|
|
|
//cdebug_log(112,0) << "3" << endl;
|
|
|
|
min = std::max(gcurr->getXMin(), intervfrom.getMin());
|
|
|
|
max = std::min(gcurr->getXMax(), intervfrom.getMax());
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
2017-02-14 08:47:22 -06:00
|
|
|
} else {
|
2017-03-20 11:38:29 -05:00
|
|
|
if (pcurr.getX() < pnext.getX()){
|
2017-04-25 11:06:53 -05:00
|
|
|
//cdebug_log(112,0) << "4" << endl;
|
2017-03-20 11:38:29 -05:00
|
|
|
min = pcurr.getX();
|
|
|
|
max = pnext.getX();
|
|
|
|
} else {
|
2017-04-25 11:06:53 -05:00
|
|
|
//cdebug_log(112,0) << "5" << endl;
|
2017-03-20 11:38:29 -05:00
|
|
|
max = pcurr.getX();
|
|
|
|
min = pnext.getX();
|
|
|
|
}
|
2017-02-14 08:47:22 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (vcurr->isV()){
|
2017-03-20 11:38:29 -05:00
|
|
|
cdebug_log(112,0) << "case vcurr: Vertical" << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
|
|
|
|
if ((vcurr->isiSet())&&(vcurr->hasValidStamp())){
|
2017-03-20 11:38:29 -05:00
|
|
|
cdebug_log(112,0) << "case set" << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
if (vcurr->getIMin() > pnext.getY()) {
|
|
|
|
min = pnext.getY();
|
|
|
|
max = vcurr->getIMax();
|
|
|
|
axis = vcurr->getIAxis();
|
|
|
|
} else if (vcurr->getIMax() < pnext.getY()) {
|
|
|
|
min = vcurr->getIMin();
|
|
|
|
max = pnext.getY();
|
|
|
|
axis = vcurr->getIAxis();
|
|
|
|
} else {
|
|
|
|
min = vcurr->getIMin();
|
|
|
|
max = vcurr->getIMax();
|
|
|
|
axis = vcurr->getIAxis();
|
|
|
|
}
|
|
|
|
} else {
|
2017-03-20 11:38:29 -05:00
|
|
|
cdebug_log(112,0) << "case not set" << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
axis = pcurr.getX();
|
2017-03-20 11:38:29 -05:00
|
|
|
bool vv = false;
|
|
|
|
if (vcurr->hasValidStamp() && (vcurr->getFrom() != NULL)){
|
2017-04-25 11:06:53 -05:00
|
|
|
GCell* gprev = vcurr->getGPrev(Vertex::UseFromFrom2);
|
2017-03-20 11:38:29 -05:00
|
|
|
Vertex* vprev = gprev->getObserver<Vertex>(GCell::Observable::Vertex);
|
2017-04-18 04:58:55 -05:00
|
|
|
if ((vprev->isV())) {
|
2017-03-20 11:38:29 -05:00
|
|
|
cdebug_log(112,0) << "----------------------------" << endl;
|
|
|
|
cdebug_log(112,0) << "VVCASE:" << endl;
|
|
|
|
cdebug_log(112,0) << "prev: " << vprev << endl;
|
|
|
|
cdebug_log(112,0) << "curr: " << vcurr << endl;
|
|
|
|
cdebug_log(112,0) << "next: " << this << endl;
|
|
|
|
cdebug_log(112,0) << "----------------------------" << endl;
|
|
|
|
vv = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (vv){
|
2017-04-18 04:58:55 -05:00
|
|
|
GCell* gcurr = vcurr->getGCell();
|
|
|
|
GCell* gnext = getGCell();
|
2017-04-25 11:06:53 -05:00
|
|
|
IntervalC intervfrom = vcurr->getIntervFrom(UseFromFrom2);
|
|
|
|
if (gnext->getYMin() > intervfrom.getMax()){
|
|
|
|
//cdebug_log(112,0) << "1" << endl;
|
|
|
|
min = intervfrom.getMax();
|
2017-04-18 04:58:55 -05:00
|
|
|
max = gnext->getYMin();
|
2017-04-25 11:06:53 -05:00
|
|
|
} else if (gnext->getYMax() < intervfrom.getMin()){
|
|
|
|
//cdebug_log(112,0) << "2" << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
min = gnext->getYMax();
|
2017-04-25 11:06:53 -05:00
|
|
|
max = intervfrom.getMin();
|
2017-04-18 04:58:55 -05:00
|
|
|
} else {
|
2017-04-25 11:06:53 -05:00
|
|
|
//cdebug_log(112,0) << "3" << endl;
|
|
|
|
min = std::max(gcurr->getYMin(), intervfrom.getMin());
|
|
|
|
max = std::min(gcurr->getYMax(), intervfrom.getMax());
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
2017-02-14 08:47:22 -06:00
|
|
|
} else {
|
2017-03-20 11:38:29 -05:00
|
|
|
if (pcurr.getY() < pnext.getY()){
|
2017-04-25 11:06:53 -05:00
|
|
|
//cdebug_log(112,0) << "4" << endl;
|
2017-03-20 11:38:29 -05:00
|
|
|
min = pcurr.getY();
|
|
|
|
max = pnext.getY();
|
|
|
|
} else {
|
2017-04-25 11:06:53 -05:00
|
|
|
//cdebug_log(112,0) << "5" << endl;
|
2017-03-20 11:38:29 -05:00
|
|
|
max = pcurr.getY();
|
|
|
|
min = pnext.getY();
|
|
|
|
}
|
2017-02-14 08:47:22 -06:00
|
|
|
}
|
|
|
|
}
|
2017-04-25 11:06:53 -05:00
|
|
|
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "[ERROR](void Vertex::setIntervals(...)): Something is wrong." << endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
cdebug_log(112,0) << "IntervFrom => min: " << DbU::getValueString(min) << ", max: " << DbU::getValueString(max) << ", axis:" << DbU::getValueString(axis) << endl;
|
|
|
|
|
|
|
|
if (isFrom2Mode()) {
|
|
|
|
cdebug_log(112,0) << "SetIntervfrom2" << endl;
|
|
|
|
setIntervfrom2(min, max, axis);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
cdebug_log(112,0) << "SetIntervfrom" << endl;
|
|
|
|
setIntervfrom(min, max, axis);
|
|
|
|
}
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Vertex::areSameSide ( const Vertex* v1, const Vertex* v2 ) const
|
|
|
|
{
|
|
|
|
if ( (isNorth(v1) and isNorth(v2))
|
|
|
|
|| (isSouth(v1) and isSouth(v2))
|
|
|
|
|| (isWest (v1) and isWest (v2))
|
|
|
|
|| (isEast (v1) and isEast (v2))
|
|
|
|
) return true;
|
|
|
|
else return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Vertex::createAData()
|
|
|
|
{
|
|
|
|
if (_adata == NULL) _adata = GRAData::create();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Vertex::isiSet() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->isiSet();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "bool Vertex::isiSet() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DbU::Unit Vertex::getIAxis() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getIAxis();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getIAxis() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DbU::Unit Vertex::getIMax() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getIMax();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getIMax() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DbU::Unit Vertex::getIMin() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getIMin();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getIMin() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DbU::Unit Vertex::getPIAxis() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getPIAxis();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getPIAxis() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DbU::Unit Vertex::getPIMax() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getPIMax();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getPIMax() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DbU::Unit Vertex::getPIMin() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getPIMin();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getPIMin() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Vertex::setInterv( DbU::Unit min, DbU::Unit max, DbU::Unit axis )
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
_adata->setInterv(min, max, axis);
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "void Vertex::setInterv( DbU::Unit min, DbU::Unit max, DbU::Unit axis ): Inappropriate usage of GRAData. " << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Vertex::setIntervfrom( DbU::Unit min, DbU::Unit max, DbU::Unit axis )
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
_adata->setIntervfrom(min, max, axis);
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "void Vertex::setIntervfrom( DbU::Unit min, DbU::Unit max, DbU::Unit axis ): Inappropriate usage of GRAData. " << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Vertex::setIntervfrom2( DbU::Unit min, DbU::Unit max, DbU::Unit axis )
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
_adata->setIntervfrom2(min, max, axis);
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "void Vertex::setIntervfrom2( DbU::Unit min, DbU::Unit max, DbU::Unit axis ): Inappropriate usage of GRAData. " << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Vertex::resetIntervals()
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
_adata->resetIntervals();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "void Vertex::resetIntervals(): Inappropriate usage of GRAData. " << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Vertex::clearFrom2()
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
_adata->clearFrom2();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "void Vertex::clearfrom2(): Inappropriate usage of GRAData. " << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Edge* Vertex::getFrom2() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getFrom2();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "Edge* Vertex::getFrom2() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Vertex::setFrom2( Edge* from )
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
_adata->setFrom2(from);
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "void Vertex::setFrom2( Edge* from ): Inappropriate usage of GRAData. " << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Vertex::createIntervFrom2()
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
//_adata->createIntervFrom2();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "void Vertex::createIntervFrom2(): Inappropriate usage of GRAData. " << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DbU::Unit Vertex::getPIMax2() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getPIMax2();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getPIMax2() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DbU::Unit Vertex::getPIMin2() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getPIMin2();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getPIMin2() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DbU::Unit Vertex::getPIAxis2() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getPIAxis2();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getPIAxis2() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IntervalC Vertex::getIntervFrom2() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getIntervFrom2();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getIntervFrom2() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return IntervalC();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Replace "unsigned int" by "Flags" in all AutoSegments collections.
* Change: In Anabatic::AutoSegments collections, change the type of all
the flags that where in "unsigned int" (32 bits) to Flags (uint64_t)
as there is now more than 32 flags for functions.
* New: In Ababatic::Constants, added new flag Flags::WithPerpands, which
makes the number of flags tip over 32 bits, thus making mandatory
to uses Flags and not unsigned int.
* New: In Anabatic::AutoSegments_Perpandiculars, manage a new flag
Flags::WithDoglegs to allow to propagate through global segments that
are connecteds via doglegs on local segments. Meaning that there is
a good chance that they could be aligned.
Slighly change the way we propagate on aligned segments: no longer
check for VTee or HTee, but only for same direction and layer as
master.
* New: In Anabatic & Katana, replace all the "int", "long" and their
variants by the less implementation ambiguous "int32_t", "int64_t"
(and variant). This should help to better detect bit trucation in
flags.
Use the type to give a hint about the flags kind:
- Type "Flags", for flags shared among Anabatic & Katana
functions/methods (may also appear in some objects states).
- Type "uint32_t" for flags belonging to an object internal
state of from Hurricane functions flags (those should be
grouped in a Flag subclass in a perfect world).
2017-05-16 07:53:33 -05:00
|
|
|
IntervalC Vertex::getIntervFrom( uint32_t criteria ) const
|
2017-04-25 11:06:53 -05:00
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
switch (criteria){
|
|
|
|
case Vertex::From2Mode:
|
|
|
|
if ((isFrom2Mode())&&(getFrom2() != NULL)){
|
|
|
|
cdebug_log(112,0) << "getIntervFrom:From2Mode:UseFrom2. " << endl;
|
|
|
|
return _adata->getIntervFrom2();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "getIntervFrom:From2Mode:UseFrom1. " << endl;
|
|
|
|
return _adata->getIntervFrom();
|
|
|
|
}
|
|
|
|
case Vertex::UseFromFrom2:
|
|
|
|
if ((isFromFrom2())&&(getFrom2() != NULL)){
|
|
|
|
cdebug_log(112,0) << "getIntervFrom:UseFromFrom2:UseFrom2. " << endl;
|
|
|
|
return _adata->getIntervFrom2();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "getIntervFrom:UseFromFrom2:UseFrom1. " << endl;
|
|
|
|
return _adata->getIntervFrom();
|
|
|
|
}
|
|
|
|
case 0:
|
|
|
|
cdebug_log(112,0) << "getIntervFrom:Default:UseFrom1. " << endl;
|
|
|
|
return _adata->getIntervFrom();
|
|
|
|
default:
|
|
|
|
cdebug_log(112,0) << "getIntervFrom:Default:UseFrom1. " << endl;
|
|
|
|
return _adata->getIntervFrom();
|
|
|
|
}
|
|
|
|
} else {
|
Replace "unsigned int" by "Flags" in all AutoSegments collections.
* Change: In Anabatic::AutoSegments collections, change the type of all
the flags that where in "unsigned int" (32 bits) to Flags (uint64_t)
as there is now more than 32 flags for functions.
* New: In Ababatic::Constants, added new flag Flags::WithPerpands, which
makes the number of flags tip over 32 bits, thus making mandatory
to uses Flags and not unsigned int.
* New: In Anabatic::AutoSegments_Perpandiculars, manage a new flag
Flags::WithDoglegs to allow to propagate through global segments that
are connecteds via doglegs on local segments. Meaning that there is
a good chance that they could be aligned.
Slighly change the way we propagate on aligned segments: no longer
check for VTee or HTee, but only for same direction and layer as
master.
* New: In Anabatic & Katana, replace all the "int", "long" and their
variants by the less implementation ambiguous "int32_t", "int64_t"
(and variant). This should help to better detect bit trucation in
flags.
Use the type to give a hint about the flags kind:
- Type "Flags", for flags shared among Anabatic & Katana
functions/methods (may also appear in some objects states).
- Type "uint32_t" for flags belonging to an object internal
state of from Hurricane functions flags (those should be
grouped in a Flag subclass in a perfect world).
2017-05-16 07:53:33 -05:00
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getIntervFrom(Flags criteria) const: Inappropriate usage of GRAData. " << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
return IntervalC();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Replace "unsigned int" by "Flags" in all AutoSegments collections.
* Change: In Anabatic::AutoSegments collections, change the type of all
the flags that where in "unsigned int" (32 bits) to Flags (uint64_t)
as there is now more than 32 flags for functions.
* New: In Ababatic::Constants, added new flag Flags::WithPerpands, which
makes the number of flags tip over 32 bits, thus making mandatory
to uses Flags and not unsigned int.
* New: In Anabatic::AutoSegments_Perpandiculars, manage a new flag
Flags::WithDoglegs to allow to propagate through global segments that
are connecteds via doglegs on local segments. Meaning that there is
a good chance that they could be aligned.
Slighly change the way we propagate on aligned segments: no longer
check for VTee or HTee, but only for same direction and layer as
master.
* New: In Anabatic & Katana, replace all the "int", "long" and their
variants by the less implementation ambiguous "int32_t", "int64_t"
(and variant). This should help to better detect bit trucation in
flags.
Use the type to give a hint about the flags kind:
- Type "Flags", for flags shared among Anabatic & Katana
functions/methods (may also appear in some objects states).
- Type "uint32_t" for flags belonging to an object internal
state of from Hurricane functions flags (those should be
grouped in a Flag subclass in a perfect world).
2017-05-16 07:53:33 -05:00
|
|
|
GCell* Vertex::getGPrev( uint32_t criteria ) const
|
2017-04-25 11:06:53 -05:00
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
switch (criteria){
|
|
|
|
case Vertex::From2Mode:
|
|
|
|
if ((isFrom2Mode())&&(getFrom2() != NULL)){
|
|
|
|
cdebug_log(112,0) << "getGPrev:From2Mode:UseFrom2. " << endl;
|
|
|
|
return _adata->getFrom2()->getOpposite(getGCell());
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "getGPrev:From2Mode:UseFrom1. " << endl;
|
|
|
|
if (_from) return getFrom()->getOpposite(getGCell());
|
|
|
|
else return NULL;
|
|
|
|
}
|
|
|
|
case Vertex::UseFromFrom2:
|
|
|
|
if ((isFromFrom2())&&(getFrom2() != NULL)){
|
|
|
|
cdebug_log(112,0) << "getGPrev:UseFromFrom2:UseFrom2. " << endl;
|
|
|
|
return _adata->getFrom2()->getOpposite(getGCell());
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "getGPrev:UseFromFrom2:UseFrom1. " << endl;
|
|
|
|
if (_from) return getFrom()->getOpposite(getGCell());
|
|
|
|
else return NULL;
|
|
|
|
}
|
|
|
|
case 0:
|
|
|
|
cdebug_log(112,0) << "getGPrev:Default:UseFrom1. " << endl;
|
|
|
|
if (_from) return getFrom()->getOpposite(getGCell());
|
|
|
|
else return NULL;
|
|
|
|
default:
|
|
|
|
cdebug_log(112,0) << "getGPrev:Default:UseFrom1. " << endl;
|
|
|
|
if (_from) return getFrom()->getOpposite(getGCell());
|
|
|
|
else return NULL;
|
|
|
|
}
|
2017-02-14 08:47:22 -06:00
|
|
|
} else {
|
2017-04-25 11:06:53 -05:00
|
|
|
if (_from) return getFrom()->getOpposite(getGCell());
|
|
|
|
else return NULL;
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
2017-04-25 11:06:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IntervalC Vertex::getInterv() const
|
|
|
|
{
|
|
|
|
if (_adata){
|
|
|
|
return _adata->getInterv();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "DbU::Unit Vertex::getInterv() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
return IntervalC();
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
2017-02-14 08:47:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
void Vertex::printInterv() const
|
2017-02-14 08:47:22 -06:00
|
|
|
{
|
2017-04-25 11:06:53 -05:00
|
|
|
if (_adata){
|
|
|
|
_adata->printInterv();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "void Vertex::printInterv() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
}
|
2016-12-22 04:21:25 -06:00
|
|
|
}
|
2017-04-25 11:06:53 -05:00
|
|
|
|
|
|
|
|
|
|
|
void Vertex::printIntervfrom() const
|
2017-04-18 04:58:55 -05:00
|
|
|
{
|
2017-04-25 11:06:53 -05:00
|
|
|
if (_adata){
|
|
|
|
_adata->printIntervfrom();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,1) << "void Vertex::printIntervfrom() const: Inappropriate usage of GRAData. " << endl;
|
|
|
|
}
|
2017-04-18 04:58:55 -05:00
|
|
|
}
|
2016-12-22 04:21:25 -06:00
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
2016-12-22 04:21:25 -06:00
|
|
|
|
2016-05-30 11:52:38 -05:00
|
|
|
string Vertex::_getString () const
|
|
|
|
{
|
Anabatic transient commit 6 "Somatoline, ca marche!".
* Bug: In Anabatic:
- In Dijktra::load(), do not create Contact while looping over the Net's
components (for RoutingPads).
- In Dijkstra::propagate(), reset the connexId of reached Vertexes
on updating the stamp to avoid using connexId from previous runs.
Push the vertexes on the queue while backtracking (with a distance
of 0.0). Do not reset the "_from" as we need it in Dijkstra::toWires()
to know how were the routing is.
- In Edge::getDistance(), convert to float more early so the normalisation
do not always end up in zero.
- In GCell::_add(), when the axis of the new edge is equal to one already
on the given side, adds it *after* the existing edge and not before.
(to be coherent with the way GCells are split in two)
- In GCell::hcut() and GCell::vcut(), create an Edge if is equal to X/Y Max,
*but* the new chunk is flat. The new chunk is then expected to expand
"below".
- In GraphicsAnabaticEngine::drawGCell(), display the id of the GCell in
a small box at the center of it's bounding box. Nothing displayed for
flat GCells, to avoid cluttering.
2016-06-05 11:38:09 -05:00
|
|
|
if (not _gcell) {
|
|
|
|
string s = "<Vertex [key] " + getString(_id) + ">";
|
|
|
|
return s;
|
|
|
|
}
|
2016-05-30 11:52:38 -05:00
|
|
|
string s = "<Vertex " + getString(_id)
|
Anabatic transient commit 6 "Somatoline, ca marche!".
* Bug: In Anabatic:
- In Dijktra::load(), do not create Contact while looping over the Net's
components (for RoutingPads).
- In Dijkstra::propagate(), reset the connexId of reached Vertexes
on updating the stamp to avoid using connexId from previous runs.
Push the vertexes on the queue while backtracking (with a distance
of 0.0). Do not reset the "_from" as we need it in Dijkstra::toWires()
to know how were the routing is.
- In Edge::getDistance(), convert to float more early so the normalisation
do not always end up in zero.
- In GCell::_add(), when the axis of the new edge is equal to one already
on the given side, adds it *after* the existing edge and not before.
(to be coherent with the way GCells are split in two)
- In GCell::hcut() and GCell::vcut(), create an Edge if is equal to X/Y Max,
*but* the new chunk is flat. The new chunk is then expected to expand
"below".
- In GraphicsAnabaticEngine::drawGCell(), display the id of the GCell in
a small box at the center of it's bounding box. Nothing displayed for
flat GCells, to avoid cluttering.
2016-06-05 11:38:09 -05:00
|
|
|
+ " @(" + DbU::getValueString(_gcell->getXMin())
|
2016-09-22 11:52:53 -05:00
|
|
|
+ "-" + DbU::getValueString(_gcell->getYMin())
|
|
|
|
+ "-" + DbU::getValueString(_gcell->getXMax())
|
|
|
|
+ "-" + DbU::getValueString(_gcell->getYMax()) + ")"
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
//+ " rps:" + getString(_rpCount)
|
|
|
|
//+ " deg:" + getString(_degree)
|
|
|
|
+ " connexId:" + ((_connexId >= 0) ? getString(_connexId) : "None")
|
2016-06-26 07:55:34 -05:00
|
|
|
+ " d:" + ((_distance == unreached) ? "unreached"
|
|
|
|
: ((_distance == unreachable) ? "unreachable"
|
|
|
|
: DbU::getValueString(_distance)) )
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
//+ "+" + getString(_branchId)
|
|
|
|
//+ " stamp:" + (hasValidStamp() ? "valid" : "outdated")
|
2016-06-03 10:29:22 -05:00
|
|
|
+ " from:" + ((_from) ? "set" : "NULL")
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
//+ " from2:" + ((_adata) ? _adata->getFrom2() : "NULL")
|
|
|
|
+ " restricted:"
|
|
|
|
+ (isNRestricted() ? "N" : "-")
|
2016-06-20 11:36:00 -05:00
|
|
|
+ (isSRestricted() ? "S" : "-")
|
|
|
|
+ (isERestricted() ? "E" : "-")
|
|
|
|
+ (isWRestricted() ? "W" : "-")
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
//+ " isiSet:" +(isiSet() ? "1" : "0")
|
2016-05-30 11:52:38 -05:00
|
|
|
+ ">";
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-06-03 10:29:22 -05:00
|
|
|
void Vertex::notify ( Vertex* vertex, unsigned int flags )
|
|
|
|
{
|
2016-06-17 06:09:34 -05:00
|
|
|
cdebug_log(111,0) << "Vertex::notify() " << vertex << endl;
|
2016-06-03 10:29:22 -05:00
|
|
|
// Take into account the GCell modification here.
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-05-30 04:30:29 -05:00
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "Anabatic::Dijkstra".
|
|
|
|
|
|
|
|
|
2016-06-10 11:27:06 -05:00
|
|
|
Dijkstra::Mode::~Mode ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
string Dijkstra::Mode::_getTypeName () const
|
|
|
|
{ return "Anabatic::Dijkstra::Mode"; }
|
|
|
|
|
|
|
|
|
|
|
|
string Dijkstra::Mode::_getString () const
|
|
|
|
{
|
|
|
|
string s = "";
|
|
|
|
s += (_flags & Standart ) ? 'S' : '-';
|
|
|
|
s += (_flags & Monotonic) ? 'M' : '-';
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-12-22 04:21:25 -06:00
|
|
|
DbU::Unit Dijkstra::_distance ( const Vertex* current, const Vertex* vneighbour, const Edge* e )
|
2016-06-10 11:27:06 -05:00
|
|
|
{
|
2017-02-14 08:47:22 -06:00
|
|
|
if (Vertex::isRestricted(current, vneighbour)) return Vertex::unreachable;
|
|
|
|
else return current->getDistance() + e->getDistance();
|
|
|
|
}
|
2016-12-22 04:21:25 -06:00
|
|
|
|
|
|
|
|
2017-02-14 08:47:22 -06:00
|
|
|
DbU::Unit calcDistance( Point p1, Point p2 )
|
2016-12-22 04:21:25 -06:00
|
|
|
{
|
2017-02-14 08:47:22 -06:00
|
|
|
return abs(p1.getX()-p2.getX()) + abs(p1.getY()-p2.getY());
|
2016-12-22 04:21:25 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-05-30 04:30:29 -05:00
|
|
|
Dijkstra::Dijkstra ( AnabaticEngine* anabatic )
|
2016-08-10 16:48:06 -05:00
|
|
|
: _anabatic (anabatic)
|
|
|
|
, _vertexes ()
|
|
|
|
, _distanceCb (_distance)
|
|
|
|
, _mode (Mode::Standart)
|
|
|
|
, _net (NULL)
|
|
|
|
, _stamp (-1)
|
|
|
|
, _sources ()
|
|
|
|
, _targets ()
|
|
|
|
, _searchArea ()
|
|
|
|
, _searchAreaHalo(0)
|
|
|
|
, _connectedsId (-1)
|
|
|
|
, _queue ()
|
2017-03-08 10:49:23 -06:00
|
|
|
, _flags (0)
|
2016-05-30 04:30:29 -05:00
|
|
|
{
|
|
|
|
const vector<GCell*>& gcells = _anabatic->getGCells();
|
|
|
|
for ( GCell* gcell : gcells ) {
|
|
|
|
_vertexes.push_back( new Vertex (gcell) );
|
|
|
|
}
|
2016-08-27 09:00:14 -05:00
|
|
|
_anabatic->getMatrix()->show();
|
2016-05-30 04:30:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Dijkstra::~Dijkstra ()
|
|
|
|
{
|
|
|
|
for ( Vertex* vertex : _vertexes ) delete vertex;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-02-14 08:47:22 -06:00
|
|
|
Point Dijkstra::_getPonderedPoint() const
|
|
|
|
{
|
|
|
|
vector<RoutingPad*> rps;
|
|
|
|
int cpt = 0;
|
|
|
|
DbU::Unit x = 0;
|
|
|
|
DbU::Unit y = 0;
|
|
|
|
|
|
|
|
for ( Component* component : _net->getComponents() ) {
|
|
|
|
RoutingPad* rp = dynamic_cast<RoutingPad*>( component );
|
|
|
|
if (rp) rps.push_back( rp );
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( auto rp : rps ) {
|
|
|
|
x += rp->getBoundingBox().getCenter().getX();
|
|
|
|
y += rp->getBoundingBox().getCenter().getY();
|
|
|
|
cpt++;
|
|
|
|
}
|
|
|
|
return Point(x/cpt, y/cpt);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-05-30 04:30:29 -05:00
|
|
|
void Dijkstra::load ( Net* net )
|
|
|
|
{
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
_cleanup();
|
|
|
|
|
|
|
|
_net = net;
|
|
|
|
_stamp = _anabatic->incStamp();
|
2016-05-30 11:52:38 -05:00
|
|
|
|
2016-06-17 06:09:34 -05:00
|
|
|
DebugSession::open( _net, 112, 120 );
|
|
|
|
cdebug_log(112,1) << "Dijkstra::load() " << _net << endl;
|
2016-05-30 04:30:29 -05:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
vector<RoutingPad*> rps;
|
2017-03-08 10:49:23 -06:00
|
|
|
NetRoutingState* state = NetRoutingExtension::get( _net );
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
|
2017-03-08 10:49:23 -06:00
|
|
|
if (state){
|
|
|
|
if (state->isSelfSym()){
|
|
|
|
cdebug_log(112,0) << "Dijkstra::SELF SYMMETRY CASE " << _net << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
for ( Component* component : _net->getComponents() ) {
|
|
|
|
RoutingPad* rp = dynamic_cast<RoutingPad*>( component );
|
2016-09-30 11:09:05 -05:00
|
|
|
if (rp) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
if (_attachSymContactsHook(rp)) continue; // ANALOG
|
|
|
|
|
First intergration of the Analogic router parts.
* New: In Anabatic::AutoSegment, introduce a the kind (associated to a
flag) "LongLocal". Analog GCells can be very wide, so at least some
carefuly choosen long local segments must be took into account as
attractors in the computation of the optimal axis.
* New: In Anabatic::AutoSegment::computeOptimal(), take LongLocal into
account as attractors.
* Change: In ::GCellTopology constructors compare the layers of the
RoutingPads using layer masks instead of Layer pointers. Allows to
find both "METALx" (symbolic) and "metalX" (real).
* Change: In ::GCellTopology::_doHChannel(), _doChannel(), _doStrut()
and _doDevice(), tag long locals as "LongLocal". This need to be
reviewed as it as bind done a bit too quickly.
* Change: In Anabatic::AutoSegment, due too a much bigger span of the
analogic GCells the _optimalMin & _optimalMax bitfields must use
16 bits instead of 8 (they where overflowed).
* New: In Katana, reorganisation of the initialization procedure to fit
both digital and analogic cases. Create an analogInit() method.
* Change: In Katana::RoutingEvent, the _tracksNb and _tracksFree bitfields
where too short for the Analog GCell size, now uses 16 bits instead of
6.
* Bug: In Katana::GraphicKatanEngine::drawGCell(), skip drawing of a
GCell if *both* width and height are under 150 pixels.
* New: In Katana::Session, add a new isOpen() method.
2016-10-04 10:12:58 -05:00
|
|
|
cdebug_log(112,0) << "| " << rp << endl;
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
rps.push_back( rp );
|
2016-09-30 11:09:05 -05:00
|
|
|
continue;
|
|
|
|
}
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
}
|
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
for ( auto rp : rps ) {
|
|
|
|
Point center = rp->getBoundingBox().getCenter();
|
|
|
|
GCell* gcell = _anabatic->getGCellUnder( center );
|
2017-03-08 10:49:23 -06:00
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
_limitSymSearchArea(rp); // ANALOG
|
2016-08-10 16:48:06 -05:00
|
|
|
|
2016-09-30 11:09:05 -05:00
|
|
|
cdebug_log(112,0) << "| " << rp << endl;
|
2016-05-30 04:30:29 -05:00
|
|
|
|
Anabatic transient commit 6 "Somatoline, ca marche!".
* Bug: In Anabatic:
- In Dijktra::load(), do not create Contact while looping over the Net's
components (for RoutingPads).
- In Dijkstra::propagate(), reset the connexId of reached Vertexes
on updating the stamp to avoid using connexId from previous runs.
Push the vertexes on the queue while backtracking (with a distance
of 0.0). Do not reset the "_from" as we need it in Dijkstra::toWires()
to know how were the routing is.
- In Edge::getDistance(), convert to float more early so the normalisation
do not always end up in zero.
- In GCell::_add(), when the axis of the new edge is equal to one already
on the given side, adds it *after* the existing edge and not before.
(to be coherent with the way GCells are split in two)
- In GCell::hcut() and GCell::vcut(), create an Edge if is equal to X/Y Max,
*but* the new chunk is flat. The new chunk is then expected to expand
"below".
- In GraphicsAnabaticEngine::drawGCell(), display the id of the GCell in
a small box at the center of it's bounding box. Nothing displayed for
flat GCells, to avoid cluttering.
2016-06-05 11:38:09 -05:00
|
|
|
if (not gcell) {
|
2016-08-27 09:00:14 -05:00
|
|
|
cerr << Error( "Dijkstra::load(): %s\n"
|
|
|
|
" @%s of %s is not under any GCell.\n"
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
" It will be ignored so the routing may be incomplete."
|
2016-07-30 05:15:49 -05:00
|
|
|
, getString(rp).c_str()
|
2016-08-27 09:00:14 -05:00
|
|
|
, getString(center).c_str()
|
Anabatic transient commit 6 "Somatoline, ca marche!".
* Bug: In Anabatic:
- In Dijktra::load(), do not create Contact while looping over the Net's
components (for RoutingPads).
- In Dijkstra::propagate(), reset the connexId of reached Vertexes
on updating the stamp to avoid using connexId from previous runs.
Push the vertexes on the queue while backtracking (with a distance
of 0.0). Do not reset the "_from" as we need it in Dijkstra::toWires()
to know how were the routing is.
- In Edge::getDistance(), convert to float more early so the normalisation
do not always end up in zero.
- In GCell::_add(), when the axis of the new edge is equal to one already
on the given side, adds it *after* the existing edge and not before.
(to be coherent with the way GCells are split in two)
- In GCell::hcut() and GCell::vcut(), create an Edge if is equal to X/Y Max,
*but* the new chunk is flat. The new chunk is then expected to expand
"below".
- In GraphicsAnabaticEngine::drawGCell(), display the id of the GCell in
a small box at the center of it's bounding box. Nothing displayed for
flat GCells, to avoid cluttering.
2016-06-05 11:38:09 -05:00
|
|
|
, getString(_net).c_str()
|
|
|
|
) << endl;
|
|
|
|
continue;
|
|
|
|
}
|
2016-05-30 04:30:29 -05:00
|
|
|
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(112,0) << "Merge search area: " << _searchArea << ", gcell: " << gcell << endl;
|
2016-06-10 11:27:06 -05:00
|
|
|
_searchArea.merge( gcell->getBoundingBox() );
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(112,0) << "Search area: " << _searchArea << endl;
|
2016-05-30 04:30:29 -05:00
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
Vertex* seed = gcell->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
GCell* gseed = seed->getGCell();
|
|
|
|
|
|
|
|
if (!gseed->isMatrix()) _setSourcesGRAData( seed, rp ); // ANALOG
|
2017-02-14 08:47:22 -06:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
if (seed->getConnexId() < 0) {
|
|
|
|
VertexSet connecteds;
|
|
|
|
_getConnecteds( seed, connecteds );
|
|
|
|
|
|
|
|
++_connectedsId;
|
|
|
|
for ( Vertex* vertex : connecteds ) {
|
|
|
|
vertex->setDistance ( Vertex::unreached );
|
|
|
|
vertex->setStamp ( _stamp );
|
|
|
|
vertex->setConnexId ( _connectedsId );
|
|
|
|
vertex->setBranchId ( 0 );
|
|
|
|
vertex->setDegree ( 1 );
|
|
|
|
vertex->setRpCount ( 0 );
|
|
|
|
vertex->setFrom ( NULL );
|
|
|
|
vertex->clearRestriction();
|
|
|
|
_targets.insert( vertex );
|
2016-08-10 16:48:06 -05:00
|
|
|
cdebug_log(112,0) << "| Add: " << vertex << endl;
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
seed->incRpCount();
|
|
|
|
Contact* vcontact = seed->getGContact( _net );
|
|
|
|
rp->getBodyHook()->detach();
|
|
|
|
rp->getBodyHook()->attach( vcontact->getBodyHook() );
|
2016-05-30 04:30:29 -05:00
|
|
|
}
|
|
|
|
|
2016-08-10 16:48:06 -05:00
|
|
|
_searchArea.inflate( _searchAreaHalo );
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(112,0) << "Search halo: " << _searchAreaHalo << endl;
|
2016-06-17 06:09:34 -05:00
|
|
|
cdebug_log(112,0) << "Search area: " << _searchArea << endl;
|
2017-03-08 10:49:23 -06:00
|
|
|
|
|
|
|
setAxisTargets();
|
|
|
|
|
2016-06-17 06:09:34 -05:00
|
|
|
cdebug_tabw(112,-1);
|
2016-06-10 11:27:06 -05:00
|
|
|
DebugSession::close();
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
}
|
2016-05-30 04:30:29 -05:00
|
|
|
|
|
|
|
|
2017-03-08 10:49:23 -06:00
|
|
|
void Dijkstra::unsetAxisTargets ()
|
|
|
|
{
|
|
|
|
NetRoutingState* state = NetRoutingExtension::get( _net );
|
|
|
|
|
|
|
|
if (state){
|
|
|
|
if (state->isSelfSym()){
|
|
|
|
Cell* cell = _anabatic->getCell();
|
|
|
|
_queue.clear();
|
|
|
|
GCell* gcell = NULL;
|
|
|
|
if (state->isSymVertical()){
|
|
|
|
gcell = _anabatic->getGCellUnder( Point( state->getSymAxis()
|
|
|
|
, _anabatic->getCell()->getAbutmentBox().getYMin()
|
|
|
|
) );
|
|
|
|
} else if (state->isSymHorizontal()){
|
|
|
|
gcell = _anabatic->getGCellUnder( Point( _anabatic->getCell()->getAbutmentBox().getXMin()
|
|
|
|
, state->getSymAxis()
|
|
|
|
) );
|
|
|
|
}
|
|
|
|
if (gcell) {
|
|
|
|
_queue.push(gcell->getObserver<Vertex>(GCell::Observable::Vertex));
|
|
|
|
}
|
|
|
|
while ( not _queue.empty() ) {
|
|
|
|
Vertex* current = _queue.top();
|
|
|
|
_queue.pop();
|
|
|
|
if ( (state->isSymVertical() && (!current->isNRestricted()) && (!current->isSRestricted()))
|
|
|
|
||(state->isSymHorizontal() && (!current->isERestricted()) && (!current->isWRestricted()))
|
|
|
|
){
|
|
|
|
current->unsetFlags(Vertex::AxisTarget);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (state->isSymVertical()){
|
|
|
|
// check North
|
|
|
|
for ( Edge* edge : current->getGCell()->getNorthEdges() ) {
|
|
|
|
GCell* gnext = edge->getOpposite(current->getGCell());
|
|
|
|
Vertex* vnext = gnext->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
if ( (gnext->getXCenter() == state->getSymAxis())
|
|
|
|
&& (gnext->getYMin() <= cell->getAbutmentBox().getYMax())
|
|
|
|
) _queue.push( vnext );
|
|
|
|
}
|
|
|
|
} else if (state->isSymHorizontal()){
|
|
|
|
// check East
|
|
|
|
for ( Edge* edge : current->getGCell()->getNorthEdges() ) {
|
|
|
|
GCell* gnext = edge->getOpposite(current->getGCell());
|
|
|
|
Vertex* vnext = gnext->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
if ( (gnext->getXCenter() == state->getSymAxis())
|
|
|
|
&& (gnext->getXMin() <= cell->getAbutmentBox().getXMax())
|
|
|
|
) _queue.push( vnext );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dijkstra::setAxisTargets ()
|
|
|
|
{
|
|
|
|
NetRoutingState* state = NetRoutingExtension::get( _net );
|
|
|
|
|
|
|
|
if (state){
|
|
|
|
if (state->isSelfSym()){
|
2017-05-11 04:24:19 -05:00
|
|
|
cdebug_log(112,0) << "void Dijkstra::setAxisTargets (): " << endl;
|
|
|
|
|
2017-03-08 10:49:23 -06:00
|
|
|
Cell* cell = _anabatic->getCell();
|
|
|
|
_queue.clear();
|
|
|
|
GCell* gcell = NULL;
|
|
|
|
if (state->isSymVertical()){
|
|
|
|
gcell = _anabatic->getGCellUnder( Point( state->getSymAxis()
|
|
|
|
, _anabatic->getCell()->getAbutmentBox().getYMin()
|
|
|
|
) );
|
|
|
|
} else if (state->isSymHorizontal()){
|
|
|
|
gcell = _anabatic->getGCellUnder( Point( _anabatic->getCell()->getAbutmentBox().getXMin()
|
|
|
|
, state->getSymAxis()
|
|
|
|
) );
|
|
|
|
}
|
|
|
|
if (gcell) {
|
|
|
|
_queue.push(gcell->getObserver<Vertex>(GCell::Observable::Vertex));
|
|
|
|
setFlags(Mode::AxisTarget);
|
|
|
|
cdebug_log(112,0) << "Find axis targets: " << endl;
|
|
|
|
}
|
|
|
|
while ( not _queue.empty() ) {
|
|
|
|
Vertex* current = _queue.top();
|
|
|
|
_queue.pop();
|
|
|
|
if ( (state->isSymVertical() && (!current->isNRestricted()) && (!current->isSRestricted()))
|
|
|
|
||(state->isSymHorizontal() && (!current->isERestricted()) && (!current->isWRestricted()))
|
|
|
|
){
|
|
|
|
current->setDistance ( Vertex::unreached );
|
|
|
|
current->setStamp ( _stamp );
|
|
|
|
current->setConnexId( -1 );
|
2017-04-25 11:06:53 -05:00
|
|
|
current->setFlags(Vertex::AxisTarget);
|
2017-03-08 10:49:23 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
if (state->isSymVertical()){
|
|
|
|
// check North
|
|
|
|
for ( Edge* edge : current->getGCell()->getNorthEdges() ) {
|
|
|
|
GCell* gnext = edge->getOpposite(current->getGCell());
|
|
|
|
Vertex* vnext = gnext->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
if ( (gnext->getXCenter() == state->getSymAxis())
|
|
|
|
&& (gnext->getYMin() <= cell->getAbutmentBox().getYMax())
|
|
|
|
) _queue.push( vnext );
|
|
|
|
}
|
|
|
|
} else if (state->isSymHorizontal()){
|
|
|
|
// check East
|
|
|
|
for ( Edge* edge : current->getGCell()->getNorthEdges() ) {
|
|
|
|
GCell* gnext = edge->getOpposite(current->getGCell());
|
|
|
|
Vertex* vnext = gnext->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
if ( (gnext->getXCenter() == state->getSymAxis())
|
|
|
|
&& (gnext->getXMin() <= cell->getAbutmentBox().getXMax())
|
|
|
|
) _queue.push( vnext );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-06-10 11:27:06 -05:00
|
|
|
void Dijkstra::_selectFirstSource ()
|
2016-05-30 04:30:29 -05:00
|
|
|
{
|
|
|
|
if (_targets.empty()) {
|
2016-06-17 06:09:34 -05:00
|
|
|
#if 0
|
|
|
|
cparanoid << Error( "Dijkstra::_selectFirstSource(): %s has no vertexes to route, ignored."
|
|
|
|
, getString(_net).c_str()
|
|
|
|
) << endl;
|
|
|
|
#endif
|
2016-05-30 04:30:29 -05:00
|
|
|
return;
|
|
|
|
}
|
2016-06-10 11:27:06 -05:00
|
|
|
|
|
|
|
Vertex* firstSource = NULL;
|
|
|
|
|
|
|
|
if (_mode & Mode::Monotonic) {
|
|
|
|
if (_targets.size() == 2) {
|
|
|
|
auto ivertex = _targets.begin();
|
|
|
|
Vertex* v1 = *ivertex;
|
|
|
|
Vertex* v2 = *(++ivertex);
|
|
|
|
|
|
|
|
firstSource = (v1->getCenter().getX() <= v2->getCenter().getY()) ? v1 : v2;
|
|
|
|
} else {
|
|
|
|
cerr << Error( "Dijkstra::_selectFirstSource(): %s cannot be routed in monotonic mode.\n"
|
|
|
|
" Must have exactly two terminals (%u), revert to Standart."
|
|
|
|
, getString(_net).c_str()
|
|
|
|
, _targets.size()
|
|
|
|
) << endl;
|
|
|
|
_mode = Mode::Standart;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (not firstSource) {
|
|
|
|
// Standart routing.
|
2017-02-14 08:47:22 -06:00
|
|
|
bool hasDevice = false;
|
|
|
|
for ( Vertex* ivertex : _targets ) {
|
|
|
|
if (ivertex->getGCell()->isDevice()) hasDevice = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Point areaCenter;
|
|
|
|
if (hasDevice) areaCenter = _getPonderedPoint();
|
|
|
|
else areaCenter = _searchArea.getCenter();
|
|
|
|
|
|
|
|
auto ivertex = _targets.begin();
|
2016-06-10 11:27:06 -05:00
|
|
|
|
|
|
|
firstSource = *ivertex++;
|
|
|
|
DbU::Unit minDistance = areaCenter.manhattanDistance( firstSource->getCenter() );
|
|
|
|
|
|
|
|
for ( ; ivertex != _targets.end() ; ++ivertex ) {
|
|
|
|
DbU::Unit distance = areaCenter.manhattanDistance( (*ivertex)->getCenter() );
|
|
|
|
if (distance < minDistance) {
|
|
|
|
minDistance = distance;
|
|
|
|
firstSource = *ivertex;
|
|
|
|
}
|
2016-05-30 04:30:29 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
for ( auto ivertex = _targets.begin() ; ivertex != _targets.end() ; ) {
|
|
|
|
auto inext = ivertex; inext++;
|
|
|
|
|
|
|
|
if ((*ivertex)->getConnexId() == firstSource->getConnexId()) {
|
|
|
|
_sources.insert( *ivertex );
|
|
|
|
_targets.erase ( ivertex );
|
|
|
|
}
|
|
|
|
|
|
|
|
ivertex = inext;
|
|
|
|
}
|
2016-05-30 11:52:38 -05:00
|
|
|
|
2016-06-17 06:09:34 -05:00
|
|
|
cdebug_log(112,0) << "Dijkstra::_selectFirstSource() " << *_sources.begin() << endl;
|
2016-05-30 04:30:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
void Dijkstra::_cleanup ()
|
|
|
|
{
|
|
|
|
//_checkEdges();
|
|
|
|
_sources.clear();
|
|
|
|
_targets.clear();
|
|
|
|
_searchArea.makeEmpty();
|
|
|
|
_connectedsId = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-06-10 11:27:06 -05:00
|
|
|
bool Dijkstra::_propagate ( Flags enabledSides )
|
2016-05-30 04:30:29 -05:00
|
|
|
{
|
2017-05-11 04:24:19 -05:00
|
|
|
cdebug_log(112,1) << "Dijkstra::_propagate() " << _net << endl;
|
2016-05-30 04:30:29 -05:00
|
|
|
while ( not _queue.empty() ) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "Number of targets left: " << _targets.size()
|
|
|
|
<< " and needaxis? " << needAxisTarget() << endl;
|
|
|
|
|
2016-05-30 11:52:38 -05:00
|
|
|
_queue.dump();
|
2017-04-25 11:06:53 -05:00
|
|
|
Vertex* current = _queue.top();
|
|
|
|
GCell* gcurrent = current->getGCell();
|
2016-05-30 11:52:38 -05:00
|
|
|
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,1) << "Current:" << current << endl;
|
2016-05-30 04:30:29 -05:00
|
|
|
_queue.pop();
|
|
|
|
|
2017-04-18 04:58:55 -05:00
|
|
|
if ( current->isAxisTarget() and needAxisTarget()) unsetFlags(Mode::AxisTarget);
|
|
|
|
else if ((current->getConnexId() == _connectedsId) or (current->getConnexId() < 0)) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,1) << "Looking for neighbors:" << endl;
|
2017-03-08 10:49:23 -06:00
|
|
|
|
2016-05-30 04:30:29 -05:00
|
|
|
for ( Edge* edge : current->getGCell()->getEdges() ) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "@ Edge " << edge << endl;
|
|
|
|
|
2016-08-11 08:40:21 -05:00
|
|
|
if (edge == current->getFrom()) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "| Reject: edge == current->getFrom()" << endl;
|
2016-08-11 08:40:21 -05:00
|
|
|
continue;
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
}
|
2017-04-25 11:06:53 -05:00
|
|
|
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
if (_checkFrom2(edge, current)) { // ANALOG
|
|
|
|
cdebug_log(111,0) << "| Reject: _checkFrom2()" << endl;
|
|
|
|
continue;
|
|
|
|
}
|
2017-04-18 04:58:55 -05:00
|
|
|
|
2016-05-30 04:30:29 -05:00
|
|
|
GCell* gneighbor = edge->getOpposite(current->getGCell());
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
Vertex* vneighbor = gneighbor->getObserver<Vertex>( GCell::Observable::Vertex );
|
|
|
|
if (not gneighbor->isMatrix()) vneighbor->createAData();
|
|
|
|
|
|
|
|
cdebug_log(111,0) << "+ Neighbor:" << vneighbor << endl;
|
2016-05-30 04:30:29 -05:00
|
|
|
|
2017-02-14 08:47:22 -06:00
|
|
|
if (vneighbor->getConnexId() == _connectedsId) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "| Reject: Neighbor already reached (has connectedsId)" << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
continue;
|
|
|
|
}
|
2016-08-11 08:40:21 -05:00
|
|
|
if (not _searchArea.intersect(gneighbor->getBoundingBox())) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "| Reject: not in _searchArea: " << _searchArea << ", gneighbor area: " << gneighbor->getBoundingBox() << endl;
|
2016-08-11 08:40:21 -05:00
|
|
|
continue;
|
|
|
|
}
|
2017-04-18 04:58:55 -05:00
|
|
|
|
|
|
|
////////////////////////////////////// DEBUG //////////////////////////////////////
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_tabw(111,1);
|
2017-04-18 04:58:55 -05:00
|
|
|
if (current->getFrom()) {
|
2017-02-14 08:47:22 -06:00
|
|
|
cdebug_log(111,0) << "| From: " << current->getFrom()->getOpposite(gcurrent) << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
current->getIntervFrom().print();
|
|
|
|
}
|
2017-04-18 04:58:55 -05:00
|
|
|
if (current->getFrom2()) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "| From2: " << current->getFrom2()->getOpposite(gcurrent) << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
current->getIntervFrom2().print();
|
2017-02-14 08:47:22 -06:00
|
|
|
}
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
if ( (vneighbor->getFrom() != NULL) and (vneighbor->hasValidStamp()) ) {
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(111,0) << "| Neighbor GETFROM:" << vneighbor->getFrom()->getOpposite( gneighbor ) << endl;
|
|
|
|
cdebug_log(111,0) << "Distance prev : " << DbU::getValueString(vneighbor->getDistance()) << endl;
|
|
|
|
}
|
2017-04-18 04:58:55 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
2016-05-30 11:52:38 -05:00
|
|
|
|
2017-02-14 08:47:22 -06:00
|
|
|
DbU::Unit distance = _distanceCb( current, vneighbor, edge );
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
bool isDistance2shorter = _isDistance2Shorter ( distance, current, vneighbor, edge ); // ANALOG
|
2017-04-18 04:58:55 -05:00
|
|
|
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
if ( (distance == vneighbor->getDistance())
|
|
|
|
and ( (not gcurrent->isMatrix()) and (not gneighbor->isMatrix()) ) ) {
|
2017-04-25 11:06:53 -05:00
|
|
|
_pushEqualDistance( distance, isDistance2shorter, current, vneighbor, edge ); // ANALOG
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
} else
|
|
|
|
if ( (distance < vneighbor->getDistance()) and (distance != Vertex::unreachable) ) {
|
|
|
|
if (vneighbor->getDistance() != Vertex::unreached) _queue.erase( vneighbor );
|
|
|
|
else {
|
|
|
|
if (not vneighbor->hasValidStamp()) {
|
|
|
|
cdebug_log(111,0) << "Vertex reached for the first time" << endl;
|
|
|
|
vneighbor->setConnexId( -1 );
|
|
|
|
vneighbor->setStamp ( _stamp );
|
|
|
|
vneighbor->setDegree ( 1 );
|
|
|
|
vneighbor->setRpCount ( 0 );
|
|
|
|
vneighbor->unsetFlags(Vertex::AxisTarget);
|
|
|
|
}
|
2016-06-17 06:09:34 -05:00
|
|
|
}
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "Vertex reached through a shorter path" << endl;
|
|
|
|
_updateGRAData( vneighbor, isDistance2shorter, current ); // ANALOG
|
|
|
|
|
|
|
|
vneighbor->setBranchId( current->getBranchId() );
|
|
|
|
vneighbor->setDistance( distance );
|
|
|
|
vneighbor->setFrom ( edge );
|
|
|
|
_queue.push( vneighbor );
|
|
|
|
cdebug_log(111,0) << "Push: (size:" << _queue.size() << ") " << vneighbor << endl;
|
|
|
|
} else {
|
|
|
|
cdebug_log(111,0) << "Reject: Vertex reached through a *longer* path" << endl;
|
Anabatic transient commit 6 "Somatoline, ca marche!".
* Bug: In Anabatic:
- In Dijktra::load(), do not create Contact while looping over the Net's
components (for RoutingPads).
- In Dijkstra::propagate(), reset the connexId of reached Vertexes
on updating the stamp to avoid using connexId from previous runs.
Push the vertexes on the queue while backtracking (with a distance
of 0.0). Do not reset the "_from" as we need it in Dijkstra::toWires()
to know how were the routing is.
- In Edge::getDistance(), convert to float more early so the normalisation
do not always end up in zero.
- In GCell::_add(), when the axis of the new edge is equal to one already
on the given side, adds it *after* the existing edge and not before.
(to be coherent with the way GCells are split in two)
- In GCell::hcut() and GCell::vcut(), create an Edge if is equal to X/Y Max,
*but* the new chunk is flat. The new chunk is then expected to expand
"below".
- In GraphicsAnabaticEngine::drawGCell(), display the id of the GCell in
a small box at the center of it's bounding box. Nothing displayed for
flat GCells, to avoid cluttering.
2016-06-05 11:38:09 -05:00
|
|
|
}
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
|
|
|
|
cdebug_tabw(111,-1);
|
2016-05-30 04:30:29 -05:00
|
|
|
}
|
2016-05-30 11:52:38 -05:00
|
|
|
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_tabw(111,-2);
|
2016-05-30 11:52:38 -05:00
|
|
|
continue;
|
2016-05-30 04:30:29 -05:00
|
|
|
}
|
|
|
|
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_tabw(111,-1);
|
|
|
|
|
2016-05-30 04:30:29 -05:00
|
|
|
// We did reach another target (different <connexId>).
|
2016-06-17 06:09:34 -05:00
|
|
|
// Tag back the path, with a higher <branchId>.
|
2016-06-17 10:45:32 -05:00
|
|
|
_traceback( current );
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
cdebug_tabw(112,-1);
|
2016-05-30 11:52:38 -05:00
|
|
|
return true;
|
2016-05-30 04:30:29 -05:00
|
|
|
}
|
2016-05-30 11:52:38 -05:00
|
|
|
|
|
|
|
cerr << Error( "Dijkstra::propagate(): %s has unreachable targets."
|
|
|
|
, getString(_net).c_str()
|
|
|
|
) << endl;
|
2017-03-08 10:49:23 -06:00
|
|
|
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(112, 0) << "Unreached targets:" << endl;
|
|
|
|
for ( Vertex* v : _targets )
|
|
|
|
cdebug_log(112, 0) << "| " << v << endl;
|
2016-05-30 11:52:38 -05:00
|
|
|
|
2016-06-17 06:09:34 -05:00
|
|
|
cdebug_tabw(112,-1);
|
2016-05-30 11:52:38 -05:00
|
|
|
return false;
|
2016-05-30 04:30:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-06-17 10:45:32 -05:00
|
|
|
void Dijkstra::_traceback ( Vertex* current )
|
|
|
|
{
|
|
|
|
cdebug_log(112,1) << "Dijkstra::_traceback() " << _net << " branchId:" << _sources.size() << endl;
|
|
|
|
|
2017-04-18 04:58:55 -05:00
|
|
|
int branchId = _sources.size();
|
2016-07-30 05:15:49 -05:00
|
|
|
_toSources( current, _connectedsId );
|
2016-06-17 10:45:32 -05:00
|
|
|
|
2017-04-18 04:58:55 -05:00
|
|
|
bool isfirst = true;
|
|
|
|
bool useFrom2 = false;
|
2017-02-14 08:47:22 -06:00
|
|
|
if (!current->getGCell()->isMatrix()){
|
2017-04-25 11:06:53 -05:00
|
|
|
_initiateUpdateIntervals ( current ); // ANALOG
|
2017-03-08 10:49:23 -06:00
|
|
|
} else {
|
|
|
|
current = current->getPredecessor();
|
|
|
|
isfirst = false;
|
2017-04-18 04:58:55 -05:00
|
|
|
|
2017-02-14 08:47:22 -06:00
|
|
|
}
|
2017-04-18 04:58:55 -05:00
|
|
|
cdebug_log(112,0) << "[Start WHILE]" << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
Edge* from = NULL;
|
2016-06-17 10:45:32 -05:00
|
|
|
while ( current ) {
|
2017-04-18 04:58:55 -05:00
|
|
|
cdebug_log(112,0) << endl;
|
2017-02-14 08:47:22 -06:00
|
|
|
cdebug_log(112,0) << "| " << current << " | " << endl;
|
2016-07-30 05:15:49 -05:00
|
|
|
|
2017-04-18 04:58:55 -05:00
|
|
|
if (!current->getGCell()->isMatrix()){
|
2017-04-25 11:06:53 -05:00
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////// ANALOG
|
|
|
|
if (_updateIntervals ( isfirst, current, useFrom2, branchId, from )) break;
|
2017-04-18 04:58:55 -05:00
|
|
|
Vertex* next = NULL;
|
|
|
|
next = current->getPredecessor();
|
|
|
|
|
|
|
|
if( current->isFromFrom2()) {
|
|
|
|
cdebug_log(112,0) << "ISFROMFROM2: " << current << endl;
|
|
|
|
useFrom2 = true;
|
2017-04-25 11:06:53 -05:00
|
|
|
current->unsetFlags(Vertex::UseFromFrom2);
|
2017-04-18 04:58:55 -05:00
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "ISNOT FROMFROM2" << endl;
|
|
|
|
useFrom2 = false;
|
|
|
|
}
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,0) << "next: " << next << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
current = next;
|
2017-04-25 11:06:53 -05:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
2017-04-18 04:58:55 -05:00
|
|
|
} else {
|
|
|
|
current->incDegree();
|
|
|
|
if (current->getConnexId() == _connectedsId) break;
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
from = current->getFrom();
|
2017-04-18 04:58:55 -05:00
|
|
|
if (not from) break;
|
|
|
|
|
|
|
|
current->setDistance( 0.0 );
|
|
|
|
current->setConnexId( _connectedsId );
|
|
|
|
current->setBranchId( branchId );
|
|
|
|
_sources.insert( current );
|
|
|
|
_queue.push( current );
|
|
|
|
current = current->getPredecessor();
|
|
|
|
}
|
2016-07-30 05:15:49 -05:00
|
|
|
}
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dijkstra::_materialize ()
|
|
|
|
{
|
|
|
|
cdebug_log(112,1) << "Dijkstra::_materialize() " << _net << " _sources:" << _sources.size() << endl;
|
|
|
|
|
|
|
|
if (_sources.size() < 2) { cdebug_tabw(112,-1); return; }
|
|
|
|
|
2017-03-08 10:49:23 -06:00
|
|
|
NetRoutingState* state = NetRoutingExtension::get( _net );
|
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
for ( Vertex* startVertex : _sources ) {
|
2017-02-14 08:47:22 -06:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
if (not startVertex->getFrom()) continue;
|
|
|
|
if ( not startVertex->hasGContact(_net)
|
|
|
|
and not startVertex->getRpCount()
|
2017-03-08 10:49:23 -06:00
|
|
|
and (startVertex->getDegree() < 3)
|
|
|
|
and not startVertex->isAxisTarget() ) continue;
|
2016-07-30 05:15:49 -05:00
|
|
|
|
|
|
|
Vertex* source = startVertex;
|
|
|
|
while ( source ) {
|
2017-04-25 11:06:53 -05:00
|
|
|
source->resetIntervals(); // ANALOG
|
2017-02-14 08:47:22 -06:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
cdebug_log(112,0) << "* " << source << endl;
|
|
|
|
|
|
|
|
Edge* from = source->getFrom();
|
|
|
|
vector<Edge*> aligneds;
|
|
|
|
aligneds.push_back( from );
|
|
|
|
|
|
|
|
Vertex* target = source->getPredecessor();
|
|
|
|
Interval constraint = from->getSide();
|
|
|
|
source->setFrom( NULL );
|
2016-06-17 10:45:32 -05:00
|
|
|
|
2016-08-27 09:00:14 -05:00
|
|
|
cdebug_log(112,0) << "+ " << target << endl;
|
|
|
|
|
|
|
|
if (target->getConnexId() < 0) {
|
|
|
|
cdebug_log(112,0) << "| " << "break (abort: false start)." << endl;
|
|
|
|
break;
|
|
|
|
}
|
2016-06-17 10:45:32 -05:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
while ( true ) {
|
|
|
|
from = target->getFrom();
|
2016-08-11 08:40:21 -05:00
|
|
|
if ( not from
|
|
|
|
or not (target->getGCell()->isMatrix())
|
2016-07-30 05:15:49 -05:00
|
|
|
or (target->hasGContact(_net))
|
|
|
|
or (target->getRpCount())
|
|
|
|
or (target->getDegree() > 2)
|
|
|
|
or (aligneds.back()->isHorizontal() xor from->isHorizontal())
|
|
|
|
or not constraint.intersect(from->getSide())) break;
|
2016-06-17 10:45:32 -05:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
aligneds.push_back( from );
|
|
|
|
constraint.merge( from->getSide() );
|
|
|
|
|
|
|
|
Vertex* nextTarget = target->getPredecessor();
|
|
|
|
target->setFrom( NULL );
|
|
|
|
target = nextTarget;
|
|
|
|
|
2016-08-27 09:00:14 -05:00
|
|
|
cdebug_log(112,0) << "| " << target << endl;
|
2016-07-30 05:15:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
Contact* sourceContact = source->getGContact( _net );
|
|
|
|
Contact* targetContact = target->hasGContact( _net );
|
|
|
|
Segment* segment = NULL;
|
|
|
|
|
2017-03-08 10:49:23 -06:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
if (not targetContact) {
|
|
|
|
if (target->getFrom()) targetContact = target->getGContact( _net );
|
|
|
|
else targetContact = target->breakGoThrough( _net );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aligneds.front()->isHorizontal()) {
|
2016-08-18 04:59:19 -05:00
|
|
|
if (sourceContact->getX() > targetContact->getX())
|
|
|
|
std::swap( sourceContact, targetContact );
|
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
segment = Horizontal::create( sourceContact
|
|
|
|
, targetContact
|
|
|
|
, _anabatic->getConfiguration()->getGHorizontalLayer()
|
|
|
|
, constraint.getCenter()
|
|
|
|
, DbU::fromLambda(2.0)
|
|
|
|
);
|
|
|
|
for ( Edge* through : aligneds ) through->add( segment );
|
2017-03-08 10:49:23 -06:00
|
|
|
if (state){
|
|
|
|
if (state->isSymmetric()) _createSelfSymSeg ( segment );
|
|
|
|
}
|
2016-07-30 05:15:49 -05:00
|
|
|
} else {
|
2016-08-18 04:59:19 -05:00
|
|
|
if (sourceContact->getY() > targetContact->getY())
|
|
|
|
std::swap( sourceContact, targetContact );
|
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
segment = Vertical::create( sourceContact
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
, targetContact
|
2016-07-30 05:15:49 -05:00
|
|
|
, _anabatic->getConfiguration()->getGVerticalLayer()
|
|
|
|
, constraint.getCenter()
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
, DbU::fromLambda(2.0)
|
|
|
|
);
|
2016-07-30 05:15:49 -05:00
|
|
|
for ( Edge* through : aligneds ) through->add( segment );
|
2017-03-08 10:49:23 -06:00
|
|
|
if (state){
|
|
|
|
if (state->isSymmetric()) _createSelfSymSeg ( segment );
|
|
|
|
}
|
2016-07-30 05:15:49 -05:00
|
|
|
}
|
|
|
|
|
2017-03-08 10:49:23 -06:00
|
|
|
cdebug_log(112,0) << "|| " << segment << endl;
|
|
|
|
//cdebug_log(112,0) << "| " << "break (turn, branch or terminal)." << endl;
|
2017-04-18 04:58:55 -05:00
|
|
|
Vertex* stc = source;
|
2016-07-30 05:15:49 -05:00
|
|
|
source = (target->getFrom()) ? target : NULL;
|
2017-04-18 04:58:55 -05:00
|
|
|
stc->clearFrom2();
|
2016-06-17 10:45:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-06-10 11:27:06 -05:00
|
|
|
void Dijkstra::run ( Dijkstra::Mode mode )
|
2016-05-30 04:30:29 -05:00
|
|
|
{
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
DebugSession::open( _net, 111, 120 );
|
2016-05-30 11:52:38 -05:00
|
|
|
|
2016-06-17 06:09:34 -05:00
|
|
|
cdebug_log(112,1) << "Dijkstra::run() on " << _net << " mode:" << mode << endl;
|
2016-06-10 11:27:06 -05:00
|
|
|
_mode = mode;
|
|
|
|
|
|
|
|
_selectFirstSource();
|
2016-05-30 11:52:38 -05:00
|
|
|
if (_sources.empty()) {
|
2016-06-17 06:09:34 -05:00
|
|
|
cdebug_log(112,0) << "No source to start, not routed." << endl;
|
|
|
|
cdebug_tabw(112,-1);
|
2016-05-30 11:52:38 -05:00
|
|
|
return;
|
|
|
|
}
|
2016-05-30 04:30:29 -05:00
|
|
|
|
2016-06-10 11:27:06 -05:00
|
|
|
Flags enabledEdges = Flags::AllSides;
|
|
|
|
if (_mode & Mode::Monotonic) {
|
|
|
|
if ((*_sources.begin())->getCenter().getY() <= (*_targets.begin())->getCenter().getY())
|
|
|
|
enabledEdges = Flags::EastSide | Flags::NorthSide;
|
|
|
|
else
|
|
|
|
enabledEdges = Flags::EastSide | Flags::SouthSide;
|
|
|
|
}
|
2016-05-30 04:30:29 -05:00
|
|
|
|
|
|
|
_queue.clear();
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
_connectedsId = (*_sources.begin())->getConnexId();
|
|
|
|
for ( Vertex* source : _sources ) {
|
|
|
|
_queue.push( source );
|
|
|
|
source->setDistance( 0.0 );
|
|
|
|
cdebug_log(112,0) << "Push source: (size:" << _queue.size() << ") "
|
|
|
|
<< source
|
|
|
|
<< " _connectedsId:" << _connectedsId << endl;
|
|
|
|
}
|
2017-03-08 10:49:23 -06:00
|
|
|
while ( ((not _targets.empty()) || needAxisTarget()) and _propagate(enabledEdges) );
|
2016-05-30 04:30:29 -05:00
|
|
|
|
2016-05-30 11:52:38 -05:00
|
|
|
_queue.clear();
|
2016-07-30 05:15:49 -05:00
|
|
|
_materialize();
|
2017-03-08 10:49:23 -06:00
|
|
|
unsetAxisTargets();
|
2016-05-30 04:30:29 -05:00
|
|
|
|
2016-07-31 11:43:44 -05:00
|
|
|
_anabatic->getNetData( _net )->setGlobalRouted( true );
|
|
|
|
|
2016-06-17 06:09:34 -05:00
|
|
|
cdebug_tabw(112,-1);
|
2016-06-10 11:27:06 -05:00
|
|
|
DebugSession::close();
|
2016-05-30 04:30:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
void Dijkstra::_toSources ( Vertex* source, int connexId )
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
{
|
2017-04-25 11:06:53 -05:00
|
|
|
cdebug_log(112,1) << "Dijkstra::_toSources() " << endl;
|
2017-03-08 10:49:23 -06:00
|
|
|
//cdebug_log(112,0) << "* from: " << source << endl;
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
source->setConnexId( connexId );
|
|
|
|
source->setDistance( 0.0 );
|
|
|
|
_targets.erase ( source );
|
|
|
|
_sources.insert( source );
|
|
|
|
_queue.push( source );
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
VertexSet stack;
|
|
|
|
stack.insert( source );
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
while ( not stack.empty() ) {
|
|
|
|
source = *stack.begin();
|
|
|
|
stack.erase( source );
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
2017-03-08 10:49:23 -06:00
|
|
|
//cdebug_log(112,0) << "| source:" << source << " stack.size():" << stack.size() << endl;
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
for ( Edge* edge : source->getGCell()->getEdges() ) {
|
|
|
|
if (not edge->hasNet(_net)) {
|
2017-03-08 10:49:23 -06:00
|
|
|
//cdebug_log(112,0) << " Not connected:" << edge
|
|
|
|
// << " to:" << edge->getOpposite(source->getGCell()) << endl;
|
2016-07-30 05:15:49 -05:00
|
|
|
continue;
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
}
|
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
GCell* gneighbor = edge->getOpposite(source->getGCell());
|
|
|
|
Vertex* vneighbor = gneighbor->getObserver<Vertex>(GCell::Observable::Vertex);
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
if (not vneighbor->hasValidStamp()) continue;
|
|
|
|
if (vneighbor->getConnexId() == connexId) continue;
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
vneighbor->setConnexId( connexId );
|
|
|
|
vneighbor->setDistance( 0.0 );
|
2016-08-27 09:00:14 -05:00
|
|
|
//vneighbor->setFrom ( edge );
|
2016-07-30 05:15:49 -05:00
|
|
|
_targets.erase ( vneighbor );
|
|
|
|
_sources.insert( vneighbor );
|
|
|
|
_queue.push( vneighbor );
|
|
|
|
stack.insert( vneighbor );
|
|
|
|
}
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
void Dijkstra::_getConnecteds ( Vertex* source, VertexSet& connecteds )
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
{
|
2016-07-30 05:15:49 -05:00
|
|
|
cdebug_log(112,1) << "Dijkstra::_getConnecteds()" << endl;
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
connecteds.clear();
|
|
|
|
connecteds.insert( source );
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
|
|
|
VertexSet stack;
|
|
|
|
stack.insert( source );
|
|
|
|
|
|
|
|
while ( not stack.empty() ) {
|
|
|
|
source = *stack.begin();
|
|
|
|
stack.erase( source );
|
|
|
|
|
|
|
|
cdebug_log(112,0) << "| source:" << source << " stack.size():" << stack.size() << endl;
|
|
|
|
|
|
|
|
for ( Edge* edge : source->getGCell()->getEdges() ) {
|
2016-07-30 05:15:49 -05:00
|
|
|
if (not edge->hasNet(_net)) {
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
cdebug_log(112,0) << " Not connected:" << edge << endl;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
GCell* gneighbor = edge->getOpposite(source->getGCell());
|
|
|
|
Vertex* vneighbor = gneighbor->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
|
2016-07-30 05:15:49 -05:00
|
|
|
if (connecteds.find(vneighbor) != connecteds.end()) continue;
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
|
|
|
stack.insert( vneighbor );
|
2016-07-30 05:15:49 -05:00
|
|
|
connecteds.insert( vneighbor );
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dijkstra::_checkEdges () const
|
|
|
|
{
|
|
|
|
cdebug_log(112,1) << "Dijkstra::_checkEdges()" << endl;
|
|
|
|
|
2016-07-31 11:43:44 -05:00
|
|
|
// for ( Vertex* vertex : _vertexes ) {
|
|
|
|
// for ( Edge* edge : vertex->getGCell()->getEdges(Flags::EastSide|Flags::NorthSide) ) {
|
|
|
|
// }
|
|
|
|
// }
|
Anabatic transient commit 10. Ripup & reroute support in Dijsktra.
* New: In Anabatic:
- In AnabaticEngine, keep track of overflowed edges.
- In AnabaticEngine, getNetsFromedge() to lookup all nets going
through an Edge.
- In Configuration, read the Kite "reserved local" parameter to
decrease the Edge capacity (it's a guessing of the cost of the
local routing).
- In Edge, add an attribute to know if there is an associated
segment of the current net (set by Dijkstra::_traceback()).
Transparently manage the overflowed edges.
- In GCell_Edges, correct a filtering bug when not all sides are
selecteds.
- New GCell::getEdgeTo() to find the edge between two adjacent
GCells.
- New GCell::unrefContact() to automatically removes global contacts
no longer used by any global segments (used during the ripup
step).
- In Dijkstra::load(), now able to "reload" and already partially
or completly routed net (look for Contact of "gcontact" layer
and their attached segments).
- In Dijkstra, keep the last net loaded until the next one is.
Put the cleanup operations in an isolated function "_cleanup()".
- In Dijkstra::_selectFirstsource() and run(), load first source
component made of multiple vertexes.
- In Dijkstra::_trackback(), link the Net segments to the Edges.
- New Dijkstra::ripup(), Dijkstra::_propagateRipup() to perform
the ripup of one edge of a Net (must be loaded in Dijkstra first).
Dijkstra::_tagConnecteds() setup the connexId of a set of Vertexes
- that are connecteds through edges *with* segments.
- In GraphicAnabaticengine & GlobalRoute.cpp, embryo of a global
routing tool with ripup & reroute.
2016-06-26 07:32:32 -05:00
|
|
|
|
|
|
|
cdebug_tabw(112,-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-03-08 10:49:23 -06:00
|
|
|
void Dijkstra::_createSelfSymSeg ( Segment* segment )
|
|
|
|
{
|
|
|
|
NetRoutingState* state = NetRoutingExtension::get( _net );
|
|
|
|
if ((state != NULL)&&(segment!=NULL)){
|
|
|
|
Horizontal* h = dynamic_cast<Horizontal*>(segment);
|
|
|
|
Vertical* v = dynamic_cast<Vertical*>(segment);
|
|
|
|
Point sp, tp;
|
|
|
|
DbU::Unit axis;
|
|
|
|
Component* sourceContact = segment->getSource();
|
|
|
|
Component* targetContact = segment->getTarget();
|
|
|
|
if (h){
|
|
|
|
if (state->isSymHorizontal()){
|
|
|
|
sp = Point(sourceContact->getX(), state->getSymValue(sourceContact->getY()) );
|
|
|
|
tp = Point(targetContact->getX(), state->getSymValue(targetContact->getY()) );
|
|
|
|
axis = state->getSymValue(segment->getY());
|
|
|
|
} else if (state->isSymVertical()){
|
|
|
|
sp = Point( state->getSymValue(targetContact->getX()), targetContact->getY() );
|
|
|
|
tp = Point( state->getSymValue(sourceContact->getX()), sourceContact->getY() );
|
|
|
|
axis = segment->getY();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong here. " << endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
GCell* sgcell = _anabatic->getGCellUnder( sp );
|
|
|
|
GCell* tgcell = _anabatic->getGCellUnder( tp );
|
|
|
|
Vertex* svertex = sgcell->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
Vertex* tvertex = tgcell->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
Contact* sourceSym = NULL;
|
|
|
|
Contact* targetSym = NULL;
|
|
|
|
if (state->isSelfSym()){
|
|
|
|
cdebug_log(112,0) << "isSelfSym" << endl;
|
|
|
|
sourceSym = svertex->getGContact( _net );
|
|
|
|
targetSym = tvertex->getGContact( _net );
|
|
|
|
} else if (state->isSymMaster()){
|
|
|
|
cdebug_log(112,0) << "isSymPair: " << state->getSymNet() << endl;
|
|
|
|
sourceSym = svertex->getGContact( state->getSymNet() );
|
|
|
|
targetSym = tvertex->getGContact( state->getSymNet() );
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong with the symmetry. " << endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
cdebug_log(112,0) << "sourceSym:" << sourceSym << endl;
|
|
|
|
cdebug_log(112,0) << "targetSym:" << targetSym << endl;
|
|
|
|
Segment* segment2 = Horizontal::create( sourceSym
|
|
|
|
, targetSym
|
|
|
|
, _anabatic->getConfiguration()->getGHorizontalLayer()
|
|
|
|
, axis
|
|
|
|
, DbU::fromLambda(2.0)
|
|
|
|
);
|
|
|
|
cdebug_log(112,0) << "|| " << segment2 << endl;
|
|
|
|
} else if (v) {
|
|
|
|
if (state->isSymVertical()){
|
|
|
|
sp = Point(state->getSymValue(sourceContact->getX()), sourceContact->getY() );
|
|
|
|
tp = Point(state->getSymValue(targetContact->getX()), targetContact->getY() );
|
|
|
|
axis = state->getSymValue(segment->getX());
|
|
|
|
} else if (state->isSymHorizontal()){
|
|
|
|
sp = Point( targetContact->getX(), state->getSymValue(targetContact->getY()) );
|
|
|
|
tp = Point( sourceContact->getX(), state->getSymValue(sourceContact->getY()) );
|
|
|
|
axis = segment->getX();
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong here. " << endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
GCell* sgcell = _anabatic->getGCellUnder( sp );
|
|
|
|
GCell* tgcell = _anabatic->getGCellUnder( tp );
|
|
|
|
Vertex* svertex = sgcell->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
Vertex* tvertex = tgcell->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
Contact* sourceSym = NULL;
|
|
|
|
Contact* targetSym = NULL;
|
|
|
|
if (state->isSelfSym()){
|
|
|
|
sourceSym = svertex->getGContact( _net );
|
|
|
|
targetSym = tvertex->getGContact( _net );
|
|
|
|
} else if (state->isSymMaster()){
|
|
|
|
sourceSym = svertex->getGContact( state->getSymNet() );
|
|
|
|
targetSym = tvertex->getGContact( state->getSymNet() );
|
|
|
|
} else {
|
|
|
|
cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong with the symmetry. " << endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
cdebug_log(112,0) << "sourceSym:" << sourceSym << endl;
|
|
|
|
cdebug_log(112,0) << "targetSym:" << targetSym << endl;
|
|
|
|
Segment* segment2 = Vertical::create( sourceSym
|
|
|
|
, targetSym
|
|
|
|
, _anabatic->getConfiguration()->getGVerticalLayer()
|
|
|
|
, axis
|
|
|
|
, DbU::fromLambda(2.0)
|
|
|
|
);
|
|
|
|
cdebug_log(112,0) << "|| " << segment2 << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
bool Dijkstra::_checkFrom2 ( Edge* edge, Vertex* current )
|
|
|
|
{
|
|
|
|
if (current->getFrom2()){
|
|
|
|
if (edge == current->getFrom2()) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
//cdebug_log(111,0) << "edge == current->getFrom2()" << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
return true;
|
|
|
|
} else {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
//cdebug_log(111,0) << "edge != current->getFrom2(): " << current->getFrom2() << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} else {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
//cdebug_log(111,0) << "current->getFrom2() = NULL" << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Dijkstra::_isDistance2Shorter ( DbU::Unit& distance, Vertex* current, Vertex* vneighbor, Edge* edge )
|
|
|
|
{
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,1) << "Dijkstra::_isDistance2Shorter()" << endl;
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
DbU::Unit distance2 = Vertex::unreachable;
|
|
|
|
bool isDistance2shorter = false;
|
|
|
|
GCell* gneighbor = edge->getOpposite(current->getGCell());
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
if (current->getFrom2()) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "Has second ::getFrom()" << edge << endl;
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
current->setFlags(Vertex::From2Mode);
|
|
|
|
distance2 = _distanceCb( current, vneighbor, edge );
|
|
|
|
current->unsetFlags(Vertex::From2Mode);
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
|
|
|
|
cdebug_log(111,0) << "Distance 1 from current: " << DbU::getValueString(distance) << endl;
|
|
|
|
cdebug_log(111,0) << "Distance 2 from current: " << DbU::getValueString(distance2) << endl;
|
|
|
|
|
|
|
|
if (distance > distance2) {
|
|
|
|
cdebug_log(111,0) << "* Distance 2 is shorter" << endl;
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
isDistance2shorter = true;
|
|
|
|
distance = distance2;
|
|
|
|
} else if (distance == distance2) {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "* Distance 1 equal Distance 2" << endl;
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
Point pcurr = current->getStartPathPoint(vneighbor);
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
current->setFlags( Vertex::From2Mode );
|
2017-04-25 11:06:53 -05:00
|
|
|
Point pcurr2 = current->getStartPathPoint(vneighbor);
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
current->unsetFlags( Vertex::From2Mode );
|
2017-04-25 11:06:53 -05:00
|
|
|
Point pnext = gneighbor->getCenter();
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
|
|
|
|
if (calcDistance(pcurr,pnext) > calcDistance(pcurr2,pnext)) {
|
|
|
|
cdebug_log(111,0) << "* Distance 2 is shorter" << endl;
|
|
|
|
|
2017-04-25 11:06:53 -05:00
|
|
|
isDistance2shorter = true;
|
|
|
|
distance = distance2;
|
|
|
|
} else {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "* Distance 1 is shorter" << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
}
|
|
|
|
} else {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "* Distance 1 is shorter" << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
}
|
|
|
|
} else {
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
cdebug_log(111,0) << "No second ::getFrom()" << endl;
|
|
|
|
cdebug_log(111,0) << "Distance 1 from current: " << DbU::getValueString(distance) << endl;
|
2017-04-25 11:06:53 -05:00
|
|
|
}
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
|
|
|
|
cdebug_tabw(111,-1);
|
2017-04-25 11:06:53 -05:00
|
|
|
return isDistance2shorter;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dijkstra::_pushEqualDistance ( DbU::Unit distance, bool isDistance2shorter, Vertex* current, Vertex* vneighbor, Edge* edge )
|
|
|
|
{
|
|
|
|
GCell* gneighbor = edge->getOpposite(current->getGCell());
|
|
|
|
cdebug_log(111,0) << "[case: Distance EQUAL + SameSide]" << endl;
|
|
|
|
cdebug_log(111,0) << "Previous getfrom:" << vneighbor->getFrom()->getOpposite( gneighbor ) << endl;
|
|
|
|
|
|
|
|
GCell* gnext = vneighbor->getGCell();
|
|
|
|
GCell* gprev = vneighbor->getFrom()->getOpposite(gnext);
|
|
|
|
Vertex* vprev = gprev->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
|
|
|
|
if ((distance == vneighbor->getDistance()) and vneighbor->areSameSide(vprev, current)){
|
|
|
|
cdebug_log(111,0) << "[case: Other GetFROM]" << endl;
|
|
|
|
vneighbor->setFrom2 ( edge );
|
|
|
|
vneighbor->setFlags(Vertex::From2Mode);
|
|
|
|
//vneighbor->createIntervFrom2();
|
|
|
|
vneighbor->setIntervals( current );
|
|
|
|
vneighbor->unsetFlags(Vertex::From2Mode);
|
|
|
|
if (isDistance2shorter) {
|
|
|
|
vneighbor->setFlags(Vertex::UseFromFrom2);
|
|
|
|
cdebug_log(111,0) << "setFromFrom2: " << vneighbor << endl;
|
|
|
|
}
|
|
|
|
cdebug_log(111,0) << "Push BIS : " << vneighbor << endl;
|
|
|
|
vneighbor->getIntervFrom().print();
|
|
|
|
vneighbor->getIntervFrom2().print();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dijkstra::_updateGRAData ( Vertex* vneighbor, bool isDistance2shorter, Vertex* current )
|
|
|
|
{
|
|
|
|
vneighbor->unsetFlags(Vertex::UseFromFrom2);
|
|
|
|
cdebug_log(111,0) << "unsetFromFrom2: " << vneighbor << endl;
|
|
|
|
vneighbor->clearFrom2();
|
|
|
|
if (isDistance2shorter) {
|
|
|
|
vneighbor->setFlags(Vertex::UseFromFrom2);
|
|
|
|
cdebug_log(111,0) << "setFromFrom2: " << vneighbor << endl;
|
|
|
|
} else cdebug_log(111,0) << "DON'T setFromFrom2: " << vneighbor << endl;
|
|
|
|
|
|
|
|
vneighbor->setIntervals( current );
|
|
|
|
vneighbor->getIntervFrom().print();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Dijkstra::_initiateUpdateIntervals ( Vertex* current )
|
|
|
|
{
|
|
|
|
GCell* gcurr = current->getGCell();
|
|
|
|
GCell* gprev = current->getFrom()->getOpposite(gcurr);
|
|
|
|
Vertex* vprev = gprev->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
Point pcurrent = vprev->getStartPathPoint(current);
|
|
|
|
Point pentry = vprev->getNextPathPoint( pcurrent, current );
|
|
|
|
cdebug_log(112,0) << "current : " << gcurr << endl;
|
|
|
|
cdebug_log(112,0) << "previous: " << gprev << endl;
|
|
|
|
cdebug_log(112,0) << "pcurr : x: " << DbU::getValueString(pcurrent.getX()) << ", y: " << DbU::getValueString(pcurrent.getY()) << endl;
|
|
|
|
cdebug_log(112,0) << "pentry: x: " << DbU::getValueString(pentry.getX()) << ", y: " << DbU::getValueString(pentry.getY()) << endl;
|
|
|
|
|
|
|
|
cdebug_log(112,0) << "| " << current << " | " << endl;
|
|
|
|
if (current->isH()){
|
|
|
|
if (pentry.getX() < current->getIMin()){
|
|
|
|
current->setInterv(pentry.getX(), current->getIMax(), current->getIAxis());
|
|
|
|
cdebug_log(112,0) << "[Interval update1]: min : " << DbU::getValueString(pentry.getX());
|
|
|
|
cdebug_log(112,0) << ", max : " << DbU::getValueString(current->getIMax());
|
|
|
|
cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl;
|
|
|
|
} else if (pentry.getX() > current->getIMax()){
|
|
|
|
current->setInterv(current->getIMin(), pentry.getX(), current->getIAxis());
|
|
|
|
cdebug_log(112,0) << "[Interval update2]: min : " << DbU::getValueString(current->getIMin());
|
|
|
|
cdebug_log(112,0) << ", max : " << DbU::getValueString(pentry.getX());
|
|
|
|
cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl;
|
|
|
|
}
|
|
|
|
} else if (current->isV()){
|
|
|
|
if (pentry.getY() < current->getIMin()){
|
|
|
|
current->setInterv(pentry.getY(), current->getIMax(), current->getIAxis());
|
|
|
|
cdebug_log(112,0) << "[Interval update3]: min : " << DbU::getValueString(pentry.getY());
|
|
|
|
cdebug_log(112,0) << ", max : " << DbU::getValueString(current->getIMax());
|
|
|
|
cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl;
|
|
|
|
} else if (pentry.getY() > current->getIMax()){
|
|
|
|
current->setInterv(current->getIMin(), pentry.getY(), current->getIAxis());
|
|
|
|
cdebug_log(112,0) << "[Interval update4]: min : " << DbU::getValueString(current->getIMin());
|
|
|
|
cdebug_log(112,0) << ", max : " << DbU::getValueString(pentry.getY());
|
|
|
|
cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cdebug_log(112,0) << "isiSet: " << current->isiSet() << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Dijkstra::_updateIntervals( bool& isfirst, Vertex* current, bool& useFrom2, int& branchId, Edge* from )
|
|
|
|
{
|
|
|
|
if (!isfirst){
|
|
|
|
cdebug_log(112,0) << "Is not first" << endl;
|
|
|
|
current->incDegree();
|
|
|
|
if (current->getConnexId() == _connectedsId) return true;
|
|
|
|
from = NULL;
|
|
|
|
if (useFrom2) {
|
|
|
|
cdebug_log(112,0) << "USE FROM2: " << current->getFrom2() << endl;
|
|
|
|
current->setFrom(current->getFrom2());
|
|
|
|
current->setIntervfrom(current->getPIMin2(), current->getPIMax2(), current->getPIAxis2());
|
|
|
|
current->clearFrom2();
|
|
|
|
}
|
|
|
|
from = current->getFrom();
|
|
|
|
if (not from) return true;
|
|
|
|
|
|
|
|
current->setDistance( 0.0 );
|
|
|
|
current->setConnexId( _connectedsId );
|
|
|
|
current->setBranchId( branchId );
|
|
|
|
_sources.insert( current );
|
|
|
|
_queue.push( current );
|
|
|
|
} else isfirst = false;
|
|
|
|
|
|
|
|
if (current->getPredecessor() != NULL){
|
|
|
|
cdebug_log(112,0) << "Predecessor() : " << current->getPredecessor() << endl;
|
|
|
|
cdebug_log(112,0) << "[Interval update]: min : " << DbU::getValueString(current->getPIMin());
|
|
|
|
cdebug_log(112,0) << ", max : " << DbU::getValueString(current->getPIMax());
|
|
|
|
cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getPIAxis()) << endl;
|
|
|
|
current->getPredecessor()->setInterv(current->getPIMin(), current->getPIMax(), current->getPIAxis());
|
|
|
|
current->getIntervFrom().print();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Dijkstra::_attachSymContactsHook( RoutingPad* rp )
|
|
|
|
{
|
|
|
|
NetRoutingState* state = NetRoutingExtension::get( _net );
|
|
|
|
if (state){
|
|
|
|
if (state->isSelfSym()){
|
|
|
|
if ( ( (state->isSymHorizontal())&&(rp->getBoundingBox().getYMin() > state->getSymAxis()) )
|
|
|
|
||( (state->isSymVertical() )&&(rp->getBoundingBox().getXMin() > state->getSymAxis()) )
|
|
|
|
){
|
|
|
|
Point center = rp->getBoundingBox().getCenter();
|
|
|
|
GCell* gcell = _anabatic->getGCellUnder( center );
|
|
|
|
Vertex* seed = gcell->getObserver<Vertex>(GCell::Observable::Vertex);
|
|
|
|
Contact* vcontact = seed->getGContact( _net );
|
|
|
|
rp->getBodyHook()->detach();
|
|
|
|
rp->getBodyHook()->attach( vcontact->getBodyHook() );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dijkstra::_limitSymSearchArea( RoutingPad* rp )
|
|
|
|
{
|
|
|
|
NetRoutingState* state = NetRoutingExtension::get( _net );
|
|
|
|
Point center = rp->getBoundingBox().getCenter();
|
|
|
|
GCell* gcell = _anabatic->getGCellUnder( center );
|
|
|
|
if (state){
|
|
|
|
if (state->isSymHorizontal()){
|
|
|
|
_searchArea.merge( Box( _net->getCell()->getAbutmentBox().getXMin()
|
|
|
|
, _net->getCell()->getAbutmentBox().getYMin()
|
|
|
|
, _net->getCell()->getAbutmentBox().getXMax()
|
|
|
|
, state->getSymAxis()
|
|
|
|
)
|
|
|
|
);
|
|
|
|
} else if (state->isSymVertical()){
|
|
|
|
_searchArea.merge( Box( _net->getCell()->getAbutmentBox().getXMin()
|
|
|
|
, _net->getCell()->getAbutmentBox().getYMin()
|
|
|
|
, state->getSymAxis()
|
|
|
|
, _net->getCell()->getAbutmentBox().getYMax()
|
|
|
|
)
|
|
|
|
);
|
Added analog type on segment NetRoutingProperty.
* New: In Anabatic_AutoSegments collection, added a Flag to the constructors
to allow different behavior between digital and analog modes.
For "Aligneds" and "Perpandiculars" collections, now manage a new
Flag WithDoglegs to follow aligned globals through local doglegs
(for analog nets).
Adjust the log level of collections to 144 (formerly 145).
* New: In Anabatic::AutoSegment, new flag SegAnalog for segments that are
part of an analog net.
Note that with this flag, we reach the 32 bits limit...
* Change: In Anabatic::Constants, Flags are now declared as BaseFlags
objects and *not* uint64_t. This avoids overload resolution problems with
arithmetical overload of the operators.
The BaseFlags/Flags types are now completly "isolated" from the
uint64_t, it has the advantage of showing where unwanted previous implicit
conversions where occuring.
* Change: In Katana::Constants, Flags values are now of BaseFlags type instead
of uint64_t.
* Change: In Anabatic::Dijkstra, lots of log cleanup.
* Change: In Anabatic::GCell::getSide(), make the "shrink" parameter visible
to allow to substract the topmost and rightmost track for axis span
computation in AutoSegment::computeOptimal(). Used for analog mode.
* Change: In NetRoutingState, added a flag for analog mode. Use uint32_t
for the flags type.
* New: In Isobar, export the NetRoutingState and NetRoutingExtension objects.
2017-05-20 05:33:12 -05:00
|
|
|
} else if (gcell->isDevice()){
|
|
|
|
_searchArea.merge( _net->getCell()->getAbutmentBox() );
|
2017-04-25 11:06:53 -05:00
|
|
|
}
|
|
|
|
} else if (gcell->isDevice()){
|
|
|
|
_searchArea.merge( _net->getCell()->getAbutmentBox() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Dijkstra::_setSourcesGRAData( Vertex* seed, RoutingPad* rp )
|
|
|
|
{
|
|
|
|
Horizontal* h = dynamic_cast<Horizontal*>(rp->_getEntityAsSegment());
|
|
|
|
Vertical* v = dynamic_cast<Vertical*> (rp->_getEntityAsSegment());
|
|
|
|
seed->createAData();
|
|
|
|
if (h) {
|
|
|
|
seed->setFlags(Vertex::iHorizontal);
|
|
|
|
seed->setInterv(rp->getBoundingBox().getXMin(), rp->getBoundingBox().getXMax(), rp->getBoundingBox().getYCenter());
|
|
|
|
}
|
|
|
|
if (v) {
|
|
|
|
seed->setFlags(Vertex::iVertical);
|
|
|
|
seed->setInterv(rp->getBoundingBox().getYMin(), rp->getBoundingBox().getYMax(), rp->getBoundingBox().getXCenter());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-08 10:49:23 -06:00
|
|
|
|
2016-05-30 04:30:29 -05:00
|
|
|
} // Anabatic namespace.
|