From 798d1edb34a6bd5055c3b5297e254c9806f33a8c Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 13 Apr 2016 18:42:55 +0200 Subject: [PATCH] Bug corrections in Katabatic & Kite, bad bound index computation. * In Katabatic, in GCellConfiguration, added support to 3G_2M2 (generic). * In Katabatic, in GCellGrid, in getUSide() we were not using the correct contant set (Constant namespace instead of Kb...) so the size returned was always X. It doesn't show if the chip is square... * In Kite, in Track::getBeginIndex(), if the position requested was enclosed in same net segments, we were going one index too far in the "previous" direction. * In Kite, in Track::getOverlapBounds() we where going one index too far in the "next" direction while computing the "end" index. --- katabatic/src/GCellGrid.cpp | 6 ++++-- katabatic/src/LoadGrByNet.cpp | 4 +++- kite/src/Track.cpp | 15 ++++++++++----- kite/src/TrackFixedSegment.cpp | 2 +- kite/src/kite/Track.h | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/katabatic/src/GCellGrid.cpp b/katabatic/src/GCellGrid.cpp index c3ed3f3c..55c41238 100644 --- a/katabatic/src/GCellGrid.cpp +++ b/katabatic/src/GCellGrid.cpp @@ -140,8 +140,10 @@ namespace Katabatic { Interval side; switch ( direction ) { default: - case Constant::Horizontal: side = Interval(_boundingBox.getXMin(),_boundingBox.getXMax()); break; - case Constant::Vertical: side = Interval(_boundingBox.getYMin(),_boundingBox.getYMax()); break; + cerr << Error( "GCellGrid::getUSide(): Unknown direction flag \"%i\"" + , direction ) << endl; + case KbHorizontal: side = Interval(_boundingBox.getXMin(),_boundingBox.getXMax()); break; + case KbVertical: side = Interval(_boundingBox.getYMin(),_boundingBox.getYMax()); break; } return side; } diff --git a/katabatic/src/LoadGrByNet.cpp b/katabatic/src/LoadGrByNet.cpp index c817bbab..d6236fed 100644 --- a/katabatic/src/LoadGrByNet.cpp +++ b/katabatic/src/LoadGrByNet.cpp @@ -715,6 +715,7 @@ namespace { , Conn_3G_3M1 = CONNEXITY_VALUE( 3, 3, 0, 0, 0 , 0 ) , Conn_3G_4M1 = CONNEXITY_VALUE( 3, 4, 0, 0, 0 , 0 ) , Conn_3G_1M2 = CONNEXITY_VALUE( 3, 0, 1, 0, 0 , 0 ) + , Conn_3G_2M2 = CONNEXITY_VALUE( 3, 0, 2, 0, 0 , 0 ) , Conn_3G_1M3 = CONNEXITY_VALUE( 3, 0, 0, 1, 0 , 0 ) , Conn_3G_2M3 = CONNEXITY_VALUE( 3, 0, 0, 2, 0 , 0 ) , Conn_3G_3M3 = CONNEXITY_VALUE( 3, 0, 0, 3, 0 , 0 ) @@ -967,7 +968,8 @@ namespace { case Conn_2G_2M2: case Conn_2G_3M2: case Conn_2G_4M2: - case Conn_3G_1M2: _do_xG_xM2(); break; + case Conn_3G_1M2: + case Conn_3G_2M2: _do_xG_xM2(); break; case Conn_2G_1M3: case Conn_2G_2M3: case Conn_2G_3M3: diff --git a/kite/src/Track.cpp b/kite/src/Track.cpp index a7c220c9..67d154b8 100644 --- a/kite/src/Track.cpp +++ b/kite/src/Track.cpp @@ -234,14 +234,17 @@ namespace Kite { // I guess this has been written for the case of overlapping segments from the same // net, we find the first one of the overlapped sets. But what if they are not overlapping // but still from the same net? - if (begin < _segments.size()) - for ( ; (begin > 0) and (_segments[begin-1]->getNet() == _segments[begin]->getNet()) ; --begin ); + size_t sameNetDelta = 0; + if (begin < _segments.size()) { + for ( ; (begin > 0) and (_segments[begin-1]->getNet() == _segments[begin]->getNet()) + ; --begin, ++sameNetDelta ); + } state = 0; if ( (begin == 0) and (position < _segments[0]->getSourceU()) ) { state = BeforeFirstElement; } else { - if (begin) begin -= 1; + if (begin and not sameNetDelta) begin -= 1; size_t usedBegin = begin; Interval usedInterval = getOccupiedInterval( usedBegin ); @@ -272,9 +275,11 @@ namespace Kite { getOccupiedInterval( begin ); getBeginIndex( interval.getVMax(), end, iState ); - while ( end < _segments.size() ) { - if (_segments[end++]->getSourceU() >= interval.getVMax()) break; + for ( ; end < _segments.size() ; ++end ) { + if (_segments[end]->getSourceU() >= interval.getVMax()) break; } + + ltrace(190) << "Track::getOverlapBounds(): begin:" << begin << " end:" << end << endl; } diff --git a/kite/src/TrackFixedSegment.cpp b/kite/src/TrackFixedSegment.cpp index 34577f02..76bc61d8 100644 --- a/kite/src/TrackFixedSegment.cpp +++ b/kite/src/TrackFixedSegment.cpp @@ -8,7 +8,7 @@ // | K i t e - D e t a i l e d R o u t e r | // | | // | Author : Jean-Paul CHAPUT | -// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Module : "./TrackFixedSegment.cpp" | // +-----------------------------------------------------------------+ diff --git a/kite/src/kite/Track.h b/kite/src/kite/Track.h index 332b71a0..668243ec 100644 --- a/kite/src/kite/Track.h +++ b/kite/src/kite/Track.h @@ -8,7 +8,7 @@ // | K i t e - D e t a i l e d R o u t e r | // | | // | Author : Jean-Paul CHAPUT | -// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Header : "./kite/Track.h" | // +-----------------------------------------------------------------+