From 813d0860fdc14cce1dba1f4babc183e231948fca Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 15 Apr 2021 23:55:29 +0200 Subject: [PATCH] In Etesian::Placement, ensure that the tie in holes are pitcheds. * Bug: In Etesian::Placement::Slice::fillHole(), do not use the xmin previous bound, but pitch it (by excess). Insert ties *only* if they completely fit in the free space. This bug was showing *between* two SRAMs side-by-side, a column of tie was inserted... --- etesian/src/Placement.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/etesian/src/Placement.cpp b/etesian/src/Placement.cpp index 8348a9c9..95e362de 100644 --- a/etesian/src/Placement.cpp +++ b/etesian/src/Placement.cpp @@ -131,6 +131,18 @@ namespace Etesian { void Slice::merge ( const Occurrence& occurrence, const Box& flatAb ) { + DbU::Unit modulo = (flatAb.getXMin() - getXMin()) % getEtesian()->getSliceStep(); + if (modulo) { + cerr << "Misaligned instance " << occurrence << endl; + cerr << " y=" << DbU::getValueString(flatAb.getYMin()) << " (" << flatAb.getYMin() << ") " + << " x=" << DbU::getValueString(flatAb.getXMin()) << " (" << flatAb.getXMin() << ") " + << " modulo=" << DbU::getValueString(modulo) + << " getXMin()=" << DbU::getValueString(getXMin()) + << " sliceStep=" << DbU::getValueString(getEtesian()->getSliceStep()) + << " (" << getEtesian()->getSliceStep() << ")" + << endl; + } + if (_tiles.empty() or (_tiles.front().getXMin() > flatAb.getXMin())) { _tiles.insert( _tiles.begin(), Tile(flatAb.getXMin(), flatAb.getWidth(), occurrence) ); return; @@ -227,11 +239,22 @@ namespace Etesian { DbU::Unit feedWidth = feed->getAbutmentBox().getWidth(); DbU::Unit xtie = xmin; + DbU::Unit modulo = (xmin - getXMin()) % getEtesian()->getSliceStep(); + if (modulo) { + xtie += getEtesian()->getSliceStep() - modulo; + cerr << "Misaligned hole @" << yspin + << " ybottom=" << DbU::getValueString(ybottom) + << " xmin=" << DbU::getValueString(xmin) + << " modulo=" << DbU::getValueString(modulo) + << " getXMin()=" << DbU::getValueString(getXMin()) + << endl; + } while ( true ) { if (xtie >= xmax) break; if (xtie+feedWidth > xmax) { // Feed is too big, try to find a smaller one. + feed = NULL; int pitch = (int)((xmax-xtie) / getEtesian()->getSliceStep()); for ( ; pitch > 0 ; --pitch ) { feed = getEtesian()->getFeedCells().getFeed( pitch );