From 6984c1568228fad96bb7c2de43f6027542f32b63 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Fri, 3 Nov 2023 16:20:49 +0100 Subject: [PATCH 01/12] Fix warning when compiling EtesianEngine Fixes #68 --- etesian/src/EtesianEngine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 9845bcb33..5711f4b64 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -862,7 +862,7 @@ namespace Etesian { for ( Occurrence occurrence : getCell()->getTerminalNetlistInstanceOccurrences(getBlockInstance()) ) { - if (instanceId >= instancesNb) { + if (instanceId >= (int) instancesNb) { // This will be an error ++instanceId; continue; @@ -918,7 +918,7 @@ namespace Etesian { dots.dot(); } - if (instanceId != instancesNb) { + if (instanceId != (int) instancesNb) { throw Error( "EtesianEngine::toColoquinte(): %d leaf instances, but expected %d\n" " maybe a virtual flattening problem." , instanceId, instancesNb From 3454af1959c656c4bc9b0fc32b5cfd7ae2222342 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Mon, 27 Nov 2023 15:19:29 +0000 Subject: [PATCH 02/12] Mention hTracksReservedMin in the documentation It seems that hTracksReservedMin is actually more important than hTracksReservedLocal, which is just a threshold value. --- .../content/pages/users-guide/Configuration.rst | 4 ++-- .../content/pages/users-guide/ViewerTools.rst | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/documentation/content/pages/users-guide/Configuration.rst b/documentation/content/pages/users-guide/Configuration.rst index c129ce93c..f5f7d555d 100644 --- a/documentation/content/pages/users-guide/Configuration.rst +++ b/documentation/content/pages/users-guide/Configuration.rst @@ -137,8 +137,8 @@ A Comprehensive Example of :cb:`./coriolis2/setting.py` # P&R related parameters. Cfg.getParamString ( 'anabatic.routingGauge' ).setString ( 'msxlib4' ) Cfg.getParamString ( 'anabatic.topRoutingLayer' ).setString ( 'METAL4' ) - Cfg.getParamInt ( 'katana.hTracksReservedLocal' ).setInt ( 6 ) - Cfg.getParamInt ( 'katana.vTracksReservedLocal' ).setInt ( 3 ) + Cfg.getParamInt ( 'katana.hTracksReservedMin' ).setInt ( 3 ) + Cfg.getParamInt ( 'katana.vTracksReservedMin' ).setInt ( 2 ) Cfg.Configuration.popDefaultPriority() diff --git a/documentation/content/pages/users-guide/ViewerTools.rst b/documentation/content/pages/users-guide/ViewerTools.rst index ec95d2235..bff0dbae9 100644 --- a/documentation/content/pages/users-guide/ViewerTools.rst +++ b/documentation/content/pages/users-guide/ViewerTools.rst @@ -238,10 +238,13 @@ be equal to `100%` or (``NNNN+0``) if the detailed routing has been successfull. In the event of a failure, on a saturated design, you may tweak the three following configuration parameters: -#. ``katana.hTrackReservedLocal``, the number of track reserved for local routing, - that quantity is substracted from the edge capacities (global routing) to - give a sense of the cluttering inside the GCells. -#. ``katana.vTrackReservedLocal``, same as above. +#. ``katana.hTrackReservedMin``, minimum number of track reserved for horizontal + routing; that quantity is always substracted from the edge capacities during + global routing, to give more freedom to the detailed router. +#. ``katana.vTrackReservedMin``, same as above for vertical routing. +#. ``katana.hTrackReservedLocal``, maximum number of track reserved for horizontal + local routing (access to the cell pins). +#. ``katana.vTrackReservedLocal``, same as above for vertical routing. #. ``etesian.spaceMargin``, increases the free area of the overall design so the routing density decrease. From 31a4b4e605183085f3bebbfb021d9af43a2f9143 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Mon, 27 Nov 2023 15:54:29 +0000 Subject: [PATCH 03/12] Show track reserve options for what they are in viewer --- crlcore/python/technos/common/kite.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crlcore/python/technos/common/kite.py b/crlcore/python/technos/common/kite.py index 8c3fe6cad..f86e0f7a6 100644 --- a/crlcore/python/technos/common/kite.py +++ b/crlcore/python/technos/common/kite.py @@ -19,7 +19,7 @@ layout = Cfg.Configuration.get().getLayout() # Kite Layout. -layout.addTab ( 'Router', 'kite' ) +layout.addTab ( 'Router', 'katana' ) layout.addTitle ( 'Router', 'Katabatic - Routing Database' ) layout.addParameter( 'Router', 'katabatic.saturateRatio' , 'Saturate Ratio (%)' , 0, 1 ) layout.addParameter( 'Router', 'katabatic.saturateRp' , 'Saturate RoutingPad' , 0, 1 ) @@ -28,10 +28,12 @@ layout.addParameter( 'Router', 'anabatic.gcell.displayMode' , 'GCell Display Mode' , 1, 1 ) layout.addRule ( 'Router' ) layout.addTitle ( 'Router', 'Kite - Detailed Router' ) -layout.addParameter( 'Router', 'kite.hTracksReservedLocal', 'Vert. Locally Reserved Tracks', 0 ) -layout.addParameter( 'Router', 'kite.vTracksReservedLocal', 'Hor. Locally Reserved Tracks' , 0 ) -layout.addParameter( 'Router', 'kite.eventsLimit' , 'Events Limit' , 0 ) -layout.addParameter( 'Router', 'kite.ripupCost' , 'Ripup Cost' , 1, 1, Cfg.Parameter.Flags.UseSpinBox ) +layout.addParameter( 'Router', 'kite.hTracksReservedMin' , 'Min Vert. Reserved Tracks', 0 ) +layout.addParameter( 'Router', 'kite.vTracksReservedMin' , 'Min Hor. Reserved Tracks' , 0 ) +layout.addParameter( 'Router', 'kite.hTracksReservedLocal', 'Max Vert. Reserved Tracks', 5 ) +layout.addParameter( 'Router', 'kite.vTracksReservedLocal', 'Max Hor. Reserved Tracks' , 5 ) +layout.addParameter( 'Router', 'kite.eventsLimit' , 'Events Limit' , 0 ) +layout.addParameter( 'Router', 'kite.ripupCost' , 'Ripup Cost' , 1, 1, Cfg.Parameter.Flags.UseSpinBox ) layout.addSection ( 'Router', 'Ripup Limits', 1 ) layout.addParameter( 'Router', 'kite.strapRipupLimit' , 'Straps' , 1, 1, Cfg.Parameter.Flags.UseSpinBox ) layout.addParameter( 'Router', 'kite.localRipupLimit' , 'Locals' , 1, 1, Cfg.Parameter.Flags.UseSpinBox ) From bb6176c6ccde94c652cce65950f24eb712d13793 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Mon, 27 Nov 2023 15:56:57 +0000 Subject: [PATCH 04/12] Hide max number of reserved tracks in doc --- documentation/content/pages/users-guide/ViewerTools.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/documentation/content/pages/users-guide/ViewerTools.rst b/documentation/content/pages/users-guide/ViewerTools.rst index bff0dbae9..d8848bfa4 100644 --- a/documentation/content/pages/users-guide/ViewerTools.rst +++ b/documentation/content/pages/users-guide/ViewerTools.rst @@ -242,11 +242,12 @@ following configuration parameters: routing; that quantity is always substracted from the edge capacities during global routing, to give more freedom to the detailed router. #. ``katana.vTrackReservedMin``, same as above for vertical routing. -#. ``katana.hTrackReservedLocal``, maximum number of track reserved for horizontal - local routing (access to the cell pins). -#. ``katana.vTrackReservedLocal``, same as above for vertical routing. #. ``etesian.spaceMargin``, increases the free area of the overall design so the routing density decrease. +.. + #. ``katana.hTrackReservedLocal``, maximum number of track reserved for horizontal + local routing (access to the cell pins). + #. ``katana.vTrackReservedLocal``, same as above for vertical routing. The idea is to increase the horizontal and vertical local track reservation until the detailed router succeeds. But in doing so we make the task of the global router From 80be3d974e750a3dc3dbedcd3708e4d00bd21766 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Wed, 29 Nov 2023 17:42:10 +0000 Subject: [PATCH 05/12] Add new purple color to debug Sky130 VexRam --- crlcore/python/technos/common/colors.py | 1 + 1 file changed, 1 insertion(+) diff --git a/crlcore/python/technos/common/colors.py b/crlcore/python/technos/common/colors.py index d5ef82762..c6d16a7d2 100644 --- a/crlcore/python/technos/common/colors.py +++ b/crlcore/python/technos/common/colors.py @@ -45,6 +45,7 @@ , 'Tan' : '210,180,140' # Shade of Browns , 'Yellow' : '255,255,0' # Shade of Yellows. , 'LightYellow' : '255,255,224' + , 'Purple' : '160,32,240' } From 769ea0e94a5f6b5779e72a9d49659e82d30ca7a0 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Wed, 29 Nov 2023 20:44:43 +0000 Subject: [PATCH 06/12] Fix bloat factor reporting in Etesian (has wrong % symbol) --- 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 5711f4b64..baf48b18b 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -855,7 +855,7 @@ namespace Etesian { int maxBloatSize = _surface->width() / 8; if (bloatFactor != 1.0) { ostringstream bf; - bf << fixed << setprecision(2) << bloatFactor << "%"; + bf << fixed << setprecision(2) << "x " << bloatFactor; cmess1 << ::Dots::asString( " - Coloquinte cell bloat factor ", bf.str() ) << endl; } int rowHeight = (getSliceHeight() + vpitch - 1) / vpitch; From 4ead552f13749af63b11b27e4923a888bd5f735d Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 30 Nov 2023 10:20:06 +0000 Subject: [PATCH 07/12] Fix unclear printing in Etesian --- etesian/src/EtesianEngine.cpp | 41 +++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index baf48b18b..153ab30a0 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -783,6 +783,8 @@ namespace Etesian { return 0; } + cmess1 << ::Dots::asPercentage( " - Effective density" + , (float)usedLength/(float)totalLength ) << endl; cmess1 << ::Dots::asPercentage( " - Effective space margin" , (float)(totalLength-usedLength)/(float)totalLength ) << endl; @@ -792,12 +794,16 @@ namespace Etesian { ostringstream os1; os1 << registerNb << " (" << fixed << setprecision(2) << ratio << "%)"; cmess1 << ::Dots::asString ( " - Registers (DFF) ", os1.str() ) << endl; - cmess1 << ::Dots::asPercentage( " - Registers (DFF) area " + cmess1 << ::Dots::asPercentage( " - Registers (DFF) density " , (float)(registerLength)/(float)totalLength ) << endl; - ratio = ((float)_bufferCount / (float)instancesNb) * 100.0; - ostringstream os2; - os2 << _bufferCount << " (" << fixed << setprecision(2) << ratio << "%)"; - cmess1 << ::Dots::asString( " - Buffers ", os2.str() ) << endl; + if (_bufferCount != 0) { + // Seems unused + // Related to (now unused) code in HFNS.cpp for clock tree insertion + ratio = ((float)_bufferCount / (float)instancesNb) * 100.0; + ostringstream os2; + os2 << _bufferCount << " (" << fixed << setprecision(2) << ratio << "%)"; + cmess1 << ::Dots::asString( " - Buffers ", os2.str() ) << endl; + } } cout.flush(); @@ -814,6 +820,17 @@ namespace Etesian { vector cellIsObstruction( instancesNb+1 ); vector cellRowPolarity( instancesNb+1, CellRowPolarity::SAME ); + // Compute a bloat factor to reach (1 - densityVariation) density + double bloatFactor = std::max(1.0, (1.0 - getDensityVariation()) * totalLength / usedLength); + if (bloatFactor != 1.0) { + ostringstream bf; + bf << fixed << setprecision(2) << "x " << bloatFactor; + cmess1 << ::Dots::asString( " - Coloquinte cell bloat factor ", bf.str() ) << endl; + } + int rowHeight = (getSliceHeight() + vpitch - 1) / vpitch; + // Limit the maximum size of cells after bloat to avoid placement issues + int maxBloatSize = _surface->width() / 8; + cmess1 << " - Building RoutingPads (transhierarchical)" << endl; //getCell()->flattenNets( Cell::Flags::BuildRings|Cell::Flags::NoClockFlatten ); //getCell()->flattenNets( getBlockInstance(), Cell::Flags::NoClockFlatten ); @@ -821,6 +838,7 @@ namespace Etesian { int instanceId = 0; if (getBlockInstance()) { + // Translate the fixed instances for ( Instance* instance : getCell()->getInstances() ) { if (instance == getBlockInstance()) continue; if (instance->getPlacementStatus() == Instance::PlacementStatus::FIXED) { @@ -849,17 +867,7 @@ namespace Etesian { } } - // 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) << "x " << bloatFactor; - cmess1 << ::Dots::asString( " - Coloquinte cell bloat factor ", bf.str() ) << endl; - } - int rowHeight = (getSliceHeight() + vpitch - 1) / vpitch; - + // Translate the placeable instances for ( Occurrence occurrence : getCell()->getTerminalNetlistInstanceOccurrences(getBlockInstance()) ) { if (instanceId >= (int) instancesNb) { @@ -887,6 +895,7 @@ namespace Etesian { int xpos = instanceAb.getXMin() / hpitch; int ypos = instanceAb.getYMin() / vpitch; + // Huge hack to solve a specific DRC issue in Flexlib string masterName = getString( instance->getMasterCell()->getName() ); if (isFlexLib and not instance->isFixed() and (masterName == "buf_x8")) ++xsize; From f35339674d9e51c6d57fbbf0923dff49e6cb3d7d Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 30 Nov 2023 11:08:46 +0000 Subject: [PATCH 08/12] Use Coloquinte cell expansion instead of Etesian, so that target density is better handled --- etesian/src/EtesianEngine.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 153ab30a0..4d4b8f951 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -828,8 +828,6 @@ namespace Etesian { cmess1 << ::Dots::asString( " - Coloquinte cell bloat factor ", bf.str() ) << endl; } int rowHeight = (getSliceHeight() + vpitch - 1) / vpitch; - // Limit the maximum size of cells after bloat to avoid placement issues - int maxBloatSize = _surface->width() / 8; cmess1 << " - Building RoutingPads (transhierarchical)" << endl; //getCell()->flattenNets( Cell::Flags::BuildRings|Cell::Flags::NoClockFlatten ); @@ -900,9 +898,6 @@ namespace Etesian { if (isFlexLib and not instance->isFixed() and (masterName == "buf_x8")) ++xsize; - // Take bloat into account to compute the size - xsize = std::max(xsize, std::min(maxBloatSize, (int) (xsize * bloatFactor))); - cellX[instanceId] = xpos; cellY[instanceId] = ypos; cellWidth[instanceId] = xsize; @@ -1048,6 +1043,11 @@ namespace Etesian { cmess2 << stdCellSizes.toString(1) << endl; _circuit->setupRows(*_surface, rowHeight); + + // Apply changes to match target density variation; we add a small margin to be safer + float rowSideMarginInCellHeight = 0.3; + _circuit->expandCellsToDensity(1.0 - getDensityVariation(), rowSideMarginInCellHeight); + _circuit->check(); _placementLB = new coloquinte::PlacementSolution (); _placementUB = new coloquinte::PlacementSolution ( *_placementLB ); From a795520fc473358b3e781ade7157f541973ff31d Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 30 Nov 2023 15:48:21 +0000 Subject: [PATCH 09/12] Show placement effort in the logs --- etesian/src/EtesianEngine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 4d4b8f951..17aa05fea 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -1171,10 +1171,10 @@ namespace Etesian { cmess1 << _circuit->report() << std::endl; - cmess1 << " o Global placement." << endl; + cmess1 << " o Global placement (effort " << getPlaceEffort() << ")" << endl; globalPlace(); - cmess1 << " o Detailed Placement." << endl; + cmess1 << " o Detailed Placement (effort " << getPlaceEffort() << ")" << endl; detailedPlace(); //toHurricane(); From de92c76e4024f4d4d75b807744aebeffdeaa3f22 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 30 Nov 2023 15:58:38 +0000 Subject: [PATCH 10/12] Update etesian parameters in techno files --- crlcore/python/technos/node180/gf180mcu/mcu9t5v0.py | 2 +- crlcore/python/technos/node180/gf180mcu_c4m/StdCell3V3Lib.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crlcore/python/technos/node180/gf180mcu/mcu9t5v0.py b/crlcore/python/technos/node180/gf180mcu/mcu9t5v0.py index 283e73e7d..3b2348fa8 100644 --- a/crlcore/python/technos/node180/gf180mcu/mcu9t5v0.py +++ b/crlcore/python/technos/node180/gf180mcu/mcu9t5v0.py @@ -123,7 +123,7 @@ def _routing (): cfg.etesian.aspectRatio = 1.00 cfg.etesian.aspectRatio = [10, 1000] cfg.etesian.spaceMargin = 0.10 - cfg.etesian.uniformDensity = True + cfg.etesian.densityVariation = 0.05 cfg.etesian.routingDriven = False cfg.etesian.latchUpDistance = u(30.0 - 1.0) #cfg.etesian.diodeName = 'diode' diff --git a/crlcore/python/technos/node180/gf180mcu_c4m/StdCell3V3Lib.py b/crlcore/python/technos/node180/gf180mcu_c4m/StdCell3V3Lib.py index d7bcb0a4a..5336a2cf6 100644 --- a/crlcore/python/technos/node180/gf180mcu_c4m/StdCell3V3Lib.py +++ b/crlcore/python/technos/node180/gf180mcu_c4m/StdCell3V3Lib.py @@ -112,7 +112,7 @@ def _routing(): cfg.etesian.aspectRatio = 1.00 cfg.etesian.aspectRatio = [10, 1000] cfg.etesian.spaceMargin = 0.10 - cfg.etesian.uniformDensity = True + cfg.etesian.densityVariation = 0.05 cfg.etesian.routingDriven = False cfg.etesian.latchUpDistance = u(30.0 - 1.0) cfg.etesian.diodeName = 'diode_w1' From 83d733c4f47b327ef098070f031eaf9e3cc82fe3 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Wed, 6 Dec 2023 10:16:12 +0000 Subject: [PATCH 11/12] Fix format specifier in flute printf Fixes #40 --- flute/src/3.1/flute.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flute/src/3.1/flute.cpp b/flute/src/3.1/flute.cpp index 275dfc2dc..81106ea4d 100755 --- a/flute/src/3.1/flute.cpp +++ b/flute/src/3.1/flute.cpp @@ -1471,9 +1471,9 @@ void plottree(Tree t) int i; for (i=0; i<2*t.deg-2; i++) { - printf("%d %d\n", t.branch[i].x, t.branch[i].y); - printf("%d %d\n\n", t.branch[t.branch[i].n].x, - t.branch[t.branch[i].n].y); + printf("%lld %lld\n", (long long) t.branch[i].x, (long long) t.branch[i].y); + printf("%lld %lld\n\n", (long long) t.branch[t.branch[i].n].x, + (long long) t.branch[t.branch[i].n].y); } } From a57a517cc85e891a042407f30f057e7cb1cce133 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Wed, 6 Dec 2023 11:25:42 +0000 Subject: [PATCH 12/12] Use a maximum expanded width when using Coloquinte expansion --- etesian/src/EtesianEngine.cpp | 3 ++- subprojects/coloquinte | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 17aa05fea..26f191c32 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -1046,7 +1046,8 @@ namespace Etesian { // Apply changes to match target density variation; we add a small margin to be safer float rowSideMarginInCellHeight = 0.3; - _circuit->expandCellsToDensity(1.0 - getDensityVariation(), rowSideMarginInCellHeight); + float maxExpansionInRowWidth = 1.0 / 8.0; + _circuit->expandCellsToDensity(1.0 - getDensityVariation(), rowSideMarginInCellHeight, maxExpansionInRowWidth); _circuit->check(); _placementLB = new coloquinte::PlacementSolution (); diff --git a/subprojects/coloquinte b/subprojects/coloquinte index a54c3dfc5..07d8cc6d5 160000 --- a/subprojects/coloquinte +++ b/subprojects/coloquinte @@ -1 +1 @@ -Subproject commit a54c3dfc58c668dc4f0803c4648283c9e0f75d4c +Subproject commit 07d8cc6d5c8490e5e0dde066144a93268a6371ee