From 8d54a9cc294f09f7160be81104d0b72a412c8ac8 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 24 Apr 2021 12:56:32 +0200 Subject: [PATCH] In Etesian::Placement, reduce the number of warnings in case of misaligned block. --- etesian/src/Placement.cpp | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/etesian/src/Placement.cpp b/etesian/src/Placement.cpp index 95e362de..05360d65 100644 --- a/etesian/src/Placement.cpp +++ b/etesian/src/Placement.cpp @@ -131,18 +131,6 @@ 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; @@ -242,12 +230,12 @@ namespace Etesian { 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; + // cerr << "Misaligned hole @" << yspin + // << " ybottom=" << DbU::getValueString(ybottom) + // << " xmin=" << DbU::getValueString(xmin) + // << " modulo=" << DbU::getValueString(modulo) + // << " getXMin()=" << DbU::getValueString(getXMin()) + // << endl; } while ( true ) { @@ -431,6 +419,19 @@ namespace Etesian { return; } + DbU::Unit modulo = (flatAb.getXMin() - getXMin()) % getEtesian()->getSliceStep(); + if (modulo) { + cerr << Warning( "Area::merge(): Misaligned instance %s\n" + " y=%s (%d) x=%d (%d) area.getXMin()=%s sliceStep=%s (%d)" + , occurrence.getCompactString().c_str() + , DbU::getValueString(flatAb.getYMin()).c_str(), flatAb.getYMin() + , DbU::getValueString(flatAb.getXMin()).c_str(), flatAb.getXMin() + , DbU::getValueString(getXMin()).c_str() + , DbU::getValueString(getEtesian()->getSliceStep()).c_str() + , getEtesian()->getSliceStep() + ) << endl; + } + size_t ibegin = (flatAb.getYMin()-_placeArea.getYMin()) / _sliceHeight; size_t iend = (flatAb.getYMax()-_placeArea.getYMin()) / _sliceHeight;