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...
This commit is contained in:
Jean-Paul Chaput 2021-04-15 23:55:29 +02:00
parent 7f41cd73c7
commit 813d0860fd
1 changed files with 23 additions and 0 deletions

View File

@ -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 );