From 06433cc91417fc5a4d037463f1836ea444493a36 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 29 Jun 2023 12:38:22 +0200 Subject: [PATCH 1/4] Report slice height in Etesian logs --- etesian/src/EtesianEngine.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index f189715d..67b09085 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -709,6 +709,7 @@ namespace Etesian { cmess1 << " o Converting \"" << getCell()->getName() << "\" into Coloquinte." << endl; cmess1 << ::Dots::asString(" - H-pitch" , DbU::getValueString(hpitch)) << endl; cmess1 << ::Dots::asString(" - V-pitch" , DbU::getValueString(vpitch)) << endl; + cmess1 << ::Dots::asString(" - Slice height" , DbU::getValueString(sliceHeight)) << endl; if (isFlexLib) cmess1 << ::Dots::asString(" - Using patches for" , "\"FlexLib\"") << endl; cmess2 << " o Looking through the hierarchy." << endl; From 7b155d1ecfd980768cad7103a9601e0a2154ebfa Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 29 Jun 2023 14:37:46 +0200 Subject: [PATCH 2/4] Apply library bloating during free space computation --- etesian/src/EtesianEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 67b09085..cbc66f07 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -754,7 +754,7 @@ namespace Etesian { for ( Occurrence occurrence : getCell()->getTerminalNetlistInstanceOccurrences(getBlockInstance()) ) { ++instancesNb; Instance* instance = static_cast(occurrence.getEntity()); - Box instanceAb = instance->getAbutmentBox(); + Box instanceAb = _bloatCells.getAb( occurrence ); string masterName = getString( instance->getMasterCell()->getName() ); DbU::Unit length = (instanceAb.getHeight() / sliceHeight) * instanceAb.getWidth(); if (af->isRegister(masterName)) { From e084c1e6728ebd3e4ccd73ef02de3b61dd014cc5 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 29 Jun 2023 15:11:00 +0200 Subject: [PATCH 3/4] Apply density variation on the whole placement area, avoiding reduced free space under huge bloat --- etesian/src/EtesianEngine.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index cbc66f07..7149cec4 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -845,9 +845,8 @@ namespace Etesian { } // Compute the space margin from the row length computed earlier - double spaceMargin = (double) (totalLength - usedLength) / usedLength; - double densityVariation = getDensityVariation(); - double bloatFactor = 1.0 + std::max(spaceMargin - densityVariation, 0.0); + double spaceFactor = (1.0 - getDensityVariation()) * totalLength / usedLength; + double bloatFactor = std::max(1.0, spaceFactor); if (bloatFactor != 1.0) { ostringstream bf; bf << fixed << setprecision(2) << bloatFactor << "%"; From b7698e7500e03b984388cabbc8d0e988338d8c37 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 29 Jun 2023 15:17:02 +0200 Subject: [PATCH 4/4] 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 ();