From e3d6456ce3d14e977f43e7a43903f0feb9be6379 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 29 Jun 2023 15:17:02 +0200 Subject: [PATCH] Avoid placement issues on small designs by limiting cell bloat based on row size --- etesian/src/EtesianEngine.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 7149cec4..8a10f5df 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -750,6 +750,11 @@ namespace Etesian { } } } + _surface = new coloquinte::Rectangle( (int)(topAb.getXMin() / hpitch) + , (int)(topAb.getXMax() / hpitch) + , (int)(topAb.getYMin() / vpitch) + , (int)(topAb.getYMax() / vpitch) + ); for ( Occurrence occurrence : getCell()->getTerminalNetlistInstanceOccurrences(getBlockInstance()) ) { ++instancesNb; @@ -844,9 +849,10 @@ namespace Etesian { } } - // Compute the space margin from the row length computed earlier - double spaceFactor = (1.0 - getDensityVariation()) * totalLength / usedLength; - double bloatFactor = std::max(1.0, spaceFactor); + // Compute a bloat factor to be reach 1 - densityVariation density + double bloatFactor = std::max(1.0, (1.0 - getDensityVariation()) * totalLength / usedLength); + // Limit the maximum size of cells after bloat to avoid placement issues + int maxBloatSize = _surface->width() / 8; if (bloatFactor != 1.0) { ostringstream bf; bf << fixed << setprecision(2) << bloatFactor << "%"; @@ -886,7 +892,7 @@ namespace Etesian { ++xsize; // Take bloat into account to compute the size - xsize *= bloatFactor; + xsize = std::max(xsize, std::min(maxBloatSize, (int) (xsize * bloatFactor))); cellX[instanceId] = xpos; cellY[instanceId] = ypos; @@ -1032,11 +1038,6 @@ namespace Etesian { if (_bloatCells.getSelected()->getName() != "disabled") cmess2 << stdCellSizes.toString(1) << endl; - _surface = new coloquinte::Rectangle( (int)(topAb.getXMin() / hpitch) - , (int)(topAb.getXMax() / hpitch) - , (int)(topAb.getYMin() / vpitch) - , (int)(topAb.getYMax() / vpitch) - ); _circuit->setupRows(*_surface, rowHeight); _circuit->check(); _placementLB = new coloquinte::PlacementSolution ();