Enable the display of GCells as a density map (and not boundaries).

* Bug: In Anabatic::RawGCellsUnder, *again*, the north and east borders
    of the whole area *are* includeds (shut up disgraceful warning).
* New: In Anabatic::GCell, add a display mode to select between boundary
    display (for analogic) and density display (for numeric).
* Bug: In KatanaEngine::runGlobalRouter(), do not check if an Edge cannot
    be desatured when the vector or overloaded Edges is empty.
    (one less disgraceful warning)
* New: In GraphicKatanaEngine::drawGCell(), support for drawing the GCells
    in density mode. Use the fire scale and the MaxDensity mode.
      Setup the GCell drawing mode in GraphicKatanaEngine::initGCell().
* Change: In GraphicKatanaEngine::drawEdge(), adjust the various thresholds
    for showing the Edge and its label.
* New: In CRL Core, adds "anabatic.gcell.displayMode" to the set of Anabatic
    parameters.
      Adjust the showing threshold for GCells in "display.conf" so when the
    zoom level is low, we still can see the density map.
This commit is contained in:
Jean-Paul Chaput 2016-09-10 18:49:48 +02:00
parent d8fc626678
commit ce00b37cbf
13 changed files with 77 additions and 41 deletions

View File

@ -79,8 +79,8 @@ namespace Anabatic {
Point sourcePosition = segment->getSourcePosition(); Point sourcePosition = segment->getSourcePosition();
Point targetPosition = segment->getTargetPosition(); Point targetPosition = segment->getTargetPosition();
if ( (sourcePosition.getX() >= gcellsArea.getXMax()) if ( (sourcePosition.getX() > gcellsArea.getXMax())
or (sourcePosition.getY() >= gcellsArea.getYMax()) or (sourcePosition.getY() > gcellsArea.getYMax())
or (targetPosition.getX() <= gcellsArea.getXMin()) or (targetPosition.getX() <= gcellsArea.getXMin())
or (targetPosition.getY() <= gcellsArea.getYMin()) ) { or (targetPosition.getY() <= gcellsArea.getYMin()) ) {
cerr << Error( "RawGCellsUnder::RawGCellsUnder(): %s is completly outside the GCells area (ignored)." cerr << Error( "RawGCellsUnder::RawGCellsUnder(): %s is completly outside the GCells area (ignored)."

View File

@ -30,6 +30,7 @@
#include "crlcore/RoutingLayerGauge.h" #include "crlcore/RoutingLayerGauge.h"
#include "crlcore/AllianceFramework.h" #include "crlcore/AllianceFramework.h"
#include "anabatic/Configuration.h" #include "anabatic/Configuration.h"
#include "anabatic/GCell.h"
@ -71,6 +72,8 @@ namespace Anabatic {
, _edgeCostK (Cfg::getParamDouble("anabatic.edgeCostK",-10.0)->asDouble()) , _edgeCostK (Cfg::getParamDouble("anabatic.edgeCostK",-10.0)->asDouble())
, _edgeHInc (Cfg::getParamDouble("anabatic.edgeHInc" , 1.5)->asDouble()) , _edgeHInc (Cfg::getParamDouble("anabatic.edgeHInc" , 1.5)->asDouble())
{ {
GCell::setDisplayMode( Cfg::getParamEnumerate("anabatic.gcell.displayMode", GCell::Boundary)->asInt() );
if (cg == NULL) cg = AllianceFramework::get()->getCellGauge(); if (cg == NULL) cg = AllianceFramework::get()->getCellGauge();
if (rg == NULL) rg = AllianceFramework::get()->getRoutingGauge(); if (rg == NULL) rg = AllianceFramework::get()->getRoutingGauge();
_cg = cg->getClone(); _cg = cg->getClone();
@ -122,6 +125,8 @@ namespace Anabatic {
, _edgeCostK (other._edgeCostK) , _edgeCostK (other._edgeCostK)
, _edgeHInc (other._edgeHInc) , _edgeHInc (other._edgeHInc)
{ {
GCell::setDisplayMode( Cfg::getParamEnumerate("anabatic.gcell.displayMode", GCell::Boundary)->asInt() );
if (other._cg) _cg = other._cg->getClone(); if (other._cg) _cg = other._cg->getClone();
if (other._rg) _rg = other._rg->getClone(); if (other._rg) _rg = other._rg->getClone();
} }

View File

@ -315,12 +315,16 @@ namespace Anabatic {
string Edge::_getString () const string Edge::_getString () const
{ {
Point center ( getSource()->getCenter() );
string s = Super::_getString(); string s = Super::_getString();
s.insert( s.size()-1, " "+DbU::getValueString(_axis) ); s.insert( s.size()-1, " S:["+DbU::getValueString(center.getX()) );
s.insert( s.size()-1, " "+getString(_realOccupancy) ); s.insert( s.size()-1, " " +DbU::getValueString(center.getY()) );
s.insert( s.size()-1, "/"+getString(_capacity) ); s.insert( s.size()-1, "] " +DbU::getValueString(_axis) );
s.insert( s.size()-1, " h:"+getString(_historicCost) ); s.insert( s.size()-1, " " +getString(_realOccupancy) );
s.insert( s.size()-1, " "+getString(_flags) ); s.insert( s.size()-1, "/" +getString(_capacity) );
s.insert( s.size()-1, " h:" +getString(_historicCost) );
s.insert( s.size()-1, " " +getString(_flags) );
return s; return s;
} }

View File

@ -17,6 +17,7 @@
#include <iostream> #include <iostream>
#include "hurricane/Bug.h" #include "hurricane/Bug.h"
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
#include "hurricane/Breakpoint.h"
#include "hurricane/Contact.h" #include "hurricane/Contact.h"
#include "hurricane/RoutingPad.h" #include "hurricane/RoutingPad.h"
#include "hurricane/UpdateSession.h" #include "hurricane/UpdateSession.h"
@ -270,7 +271,12 @@ namespace Anabatic {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Anabatic::GCell". // Class : "Anabatic::GCell".
Name GCell::_extensionName = "Anabatic::GCell"; Name GCell::_extensionName = "Anabatic::GCell";
unsigned int GCell::_displayMode = GCell::Boundary;
unsigned int GCell::getDisplayMode () { return _displayMode; }
void GCell::setDisplayMode ( unsigned int mode ) { _displayMode = mode; }
GCell::GCell ( AnabaticEngine* anabatic, DbU::Unit xmin, DbU::Unit ymin ) GCell::GCell ( AnabaticEngine* anabatic, DbU::Unit xmin, DbU::Unit ymin )
@ -720,12 +726,9 @@ namespace Anabatic {
{ {
getAnabatic()->openSession(); getAnabatic()->openSession();
//const vector<GCell*>& gcells = getAnabatic()->getGCells(); DbU::Unit side = Session::getSliceHeight();
//size_t ibegin = gcells.size(); Interval hspan = getSide( Flags::Horizontal );
DbU::Unit side = Session::getSliceHeight(); Interval vspan = getSide( Flags::Vertical );
Interval hspan = getSide( Flags::Horizontal );
Interval vspan = getSide( Flags::Vertical );
if (hspan.getSize() < 3*side) { if (hspan.getSize() < 3*side) {
cerr << Error( "GCell::doGrid(): GCell is too narrow (dx:%s) to build a grid.\n" cerr << Error( "GCell::doGrid(): GCell is too narrow (dx:%s) to build a grid.\n"

View File

@ -2222,7 +2222,7 @@ namespace Anabatic {
void AnabaticEngine::_loadGrByNet () void AnabaticEngine::_loadGrByNet ()
{ {
cmess1 << " o Loading Nets global routing from Knik." << endl; cmess1 << " o Building detailed routing from global." << endl;
//cmess1 << Dots::asDouble(" - Saturation",getMeasure<double>(getCell(),"Sat.")->getData()) << endl; //cmess1 << Dots::asDouble(" - Saturation",getMeasure<double>(getCell(),"Sat.")->getData()) << endl;
startMeasures(); startMeasures();

View File

@ -75,6 +75,9 @@ namespace Anabatic {
typedef std::set< GCell*, Entity::CompareById > Set; typedef std::set< GCell*, Entity::CompareById > Set;
typedef std::vector<GCell*> Vector; typedef std::vector<GCell*> Vector;
public: public:
enum DisplayMode { Boundary = 1
, Density = 2
};
enum DensityMode { AverageHVDensity = 1 // Average between all densities. enum DensityMode { AverageHVDensity = 1 // Average between all densities.
, AverageHDensity = 2 // Average between all H densities. , AverageHDensity = 2 // Average between all H densities.
, AverageVDensity = 3 // Average between all V densities. , AverageVDensity = 3 // Average between all V densities.
@ -120,6 +123,8 @@ namespace Anabatic {
float _density; float _density;
}; };
public: public:
static unsigned int getDisplayMode ();
static void setDisplayMode ( unsigned int );
static Box getBorder ( const GCell*, const GCell* ); static Box getBorder ( const GCell*, const GCell* );
public: public:
static GCell* create ( AnabaticEngine* ); static GCell* create ( AnabaticEngine* );
@ -266,6 +271,7 @@ namespace Anabatic {
GCell& operator= ( const GCell& ); GCell& operator= ( const GCell& );
private: private:
static Name _extensionName; static Name _extensionName;
static unsigned int _displayMode;
Observable _observable; Observable _observable;
AnabaticEngine* _anabatic; AnabaticEngine* _anabatic;
Flags _flags; Flags _flags;

View File

@ -25,6 +25,10 @@ parametersTable = \
, ("anabatic.edgeWidth" ,TypeInt ,4 ) , ("anabatic.edgeWidth" ,TypeInt ,4 )
, ("anabatic.edgeCostH" ,TypeDouble ,9.0 ) , ("anabatic.edgeCostH" ,TypeDouble ,9.0 )
, ("anabatic.edgeCostK" ,TypeDouble ,-10.0 ) , ("anabatic.edgeCostK" ,TypeDouble ,-10.0 )
, ("anabatic.gcell.displayMode" ,TypeEnumerate ,1
, { 'values':( ("Boundary" , 1)
, ("Density" , 2) ) }
)
) )

View File

@ -85,7 +85,7 @@ stylesTable = \
, (Drawing, 'gmetalv' , { 'color':'200,200,255', 'pattern':'light_antihash1.8', 'border':1 }) , (Drawing, 'gmetalv' , { 'color':'200,200,255', 'pattern':'light_antihash1.8', 'border':1 })
, (Drawing, 'gcut' , { 'color':'255,255,190', 'border':1 }) , (Drawing, 'gcut' , { 'color':'255,255,190', 'border':1 })
, (Drawing, 'Anabatic::Edge' , { 'color':'255,255,190', 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':4 }) , (Drawing, 'Anabatic::Edge' , { 'color':'255,255,190', 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':4 })
, (Drawing, 'Anabatic::GCell', { 'color':'255,0,0' , 'pattern':'0000000000000000', 'threshold':0.80*scale, 'border':4 }) , (Drawing, 'Anabatic::GCell', { 'color':'255,0,0' , 'pattern':'0000000000000000', 'threshold':0.10*scale, 'border':4 })
) )
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
@ -192,7 +192,7 @@ stylesTable = \
, (Drawing, 'gmetalv' , { 'color':'200,200,255', 'pattern':'light_antihash1.8', 'border':1 }) , (Drawing, 'gmetalv' , { 'color':'200,200,255', 'pattern':'light_antihash1.8', 'border':1 })
, (Drawing, 'gcut' , { 'color':'255,255,190', 'border':1 }) , (Drawing, 'gcut' , { 'color':'255,255,190', 'border':1 })
, (Drawing, 'Anabatic::Edge' , { 'color':'255,255,190', 'pattern':'0000000000000000', 'border':4, 'threshold':0.02*scale }) , (Drawing, 'Anabatic::Edge' , { 'color':'255,255,190', 'pattern':'0000000000000000', 'border':4, 'threshold':0.02*scale })
, (Drawing, 'Anabatic::GCell', { 'color':'255,255,190', 'pattern':'0000000000000000', 'border':4, 'threshold':0.80*scale }) , (Drawing, 'Anabatic::GCell', { 'color':'255,255,190', 'pattern':'0000000000000000', 'border':4, 'threshold':0.10*scale })
) )
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------

View File

@ -8,6 +8,7 @@ layoutTable = \
, (TypeOption , "katabatic.saturateRp" , "Saturate RoutingPad" , 0, 1 ) , (TypeOption , "katabatic.saturateRp" , "Saturate RoutingPad" , 0, 1 )
, (TypeOption , "katabatic.globalLengthThreshold", "Global Length Threshold", 0, 1 ) , (TypeOption , "katabatic.globalLengthThreshold", "Global Length Threshold", 0, 1 )
, (TypeOption , "katabatic.topRoutingLayer" , "Top Routing Layer" , 0, 1 ) , (TypeOption , "katabatic.topRoutingLayer" , "Top Routing Layer" , 0, 1 )
, (TypeOption , "anabatic.gcell.displayMode" , "GCell Display Mode" , 1, 1 )
, (TypeRule ,) , (TypeRule ,)
, (TypeTitle , "Kite - Detailed Router" ) , (TypeTitle , "Kite - Detailed Router" )
, (TypeOption , "kite.hTracksReservedLocal", "Vert. Locally Reserved Tracks", 0 ) , (TypeOption , "kite.hTracksReservedLocal", "Vert. Locally Reserved Tracks", 0 )

View File

@ -172,10 +172,10 @@ namespace Katana {
dijkstra->run(); dijkstra->run();
++netCount; ++netCount;
} }
cmess2 << left << setw(6) << netCount << right; cmess2 << left << setw(6) << netCount;
const vector<Edge*>& ovEdges = getOvEdges(); const vector<Edge*>& ovEdges = getOvEdges();
cmess2 << " ovEdges:" << ovEdges.size(); cmess2 << " ovEdges:" << setw(4) << ovEdges.size();
for ( Edge* edge : ovEdges ) computeNextHCost( edge, edgeHInc ); for ( Edge* edge : ovEdges ) computeNextHCost( edge, edgeHInc );
@ -185,6 +185,7 @@ namespace Katana {
Edge* edge = ovEdges[iEdge]; Edge* edge = ovEdges[iEdge];
netCount += edge->ripup(); netCount += edge->ripup();
if (ovEdges.empty()) break;
if (ovEdges[iEdge] == edge) { if (ovEdges[iEdge] == edge) {
cerr << Error( "AnabaticEngine::globalRoute(): Unable to ripup enough segments of edge:\n" cerr << Error( "AnabaticEngine::globalRoute(): Unable to ripup enough segments of edge:\n"
" %s" " %s"
@ -196,7 +197,7 @@ namespace Katana {
dijkstra->setSearchAreaHalo( Session::getSliceHeight()*3 ); dijkstra->setSearchAreaHalo( Session::getSliceHeight()*3 );
cmess2 << " ripup:" << netCount; cmess2 << " ripup:" << setw(4) << netCount << right;
stopMeasures(); stopMeasures();
cmess2 << " " << setw(10) << Timer::getStringTime (getTimer().getCombTime()) cmess2 << " " << setw(10) << Timer::getStringTime (getTimer().getCombTime())
<< " " << setw( 6) << Timer::getStringMemory(getTimer().getIncrease()) << endl; << " " << setw( 6) << Timer::getStringMemory(getTimer().getIncrease()) << endl;

View File

@ -66,6 +66,8 @@ namespace Katana {
void GraphicKatanaEngine::initGCell ( CellWidget* widget ) void GraphicKatanaEngine::initGCell ( CellWidget* widget )
{ {
widget->getDrawingPlanes().setPen( Qt::NoPen ); widget->getDrawingPlanes().setPen( Qt::NoPen );
KatanaEngine* katana = KatanaEngine::get( widget->getCell() );
if (katana) katana->setDensityMode( GCell::MaxDensity );
} }
@ -83,28 +85,38 @@ namespace Katana {
Box bb = gcell->getBoundingBox(); Box bb = gcell->getBoundingBox();
QRect pixelBb = widget->dbuToScreenRect(bb); QRect pixelBb = widget->dbuToScreenRect(bb);
painter.setPen ( pen );
painter.setBrush( Graphics::getBrush("Anabatic::GCell",widget->getDarkening()) );
painter.drawRect( pixelBb );
if (gcell->isFlat()) return; if (gcell->isFlat()) return;
if (pixelBb.width() > 150) { if (GCell::getDisplayMode() == GCell::Density) {
QString text = QString("id:%1").arg(gcell->getId()); unsigned int density = (unsigned int)( 255.0 * gcell->getDensity() );
QFont font = Graphics::getFixedFont( QFont::Bold ); if (density > 255) density = 255;
painter.setFont(font);
pen.setWidth( 1 ); painter.setBrush( Graphics::getColorScale( ColorScale::Fire ).getBrush( density, widget->getDarkening() ) );
painter.setPen( pen ); painter.drawRect( pixelBb );
} else {
if (pixelBb.width() > 150) {
painter.setPen ( pen );
painter.setBrush( Graphics::getBrush("Anabatic::GCell",widget->getDarkening()) );
painter.drawRect( pixelBb );
painter.save (); if (pixelBb.width() > 300) {
painter.translate( widget->dbuToScreenPoint(bb.getCenter().getX(), bb.getCenter().getY()) ); QString text = QString("id:%1").arg(gcell->getId());
painter.drawRect (QRect( -75, -25, 150, 50 )); QFont font = Graphics::getFixedFont( QFont::Bold );
painter.drawText (QRect( -75, -25, 150, 50 ) painter.setFont(font);
, text
, QTextOption(Qt::AlignCenter) pen.setWidth( 1 );
); painter.setPen( pen );
painter.restore ();
painter.save ();
painter.translate( widget->dbuToScreenPoint(bb.getCenter().getX(), bb.getCenter().getY()) );
painter.drawRect (QRect( -75, -25, 150, 50 ));
painter.drawText (QRect( -75, -25, 150, 50 )
, text
, QTextOption(Qt::AlignCenter)
);
painter.restore ();
}
}
} }
} }
@ -341,7 +353,7 @@ namespace Katana {
); );
_viewer->addToMenu( "placeAndRoute.katana.stepByStep.globalRoute" _viewer->addToMenu( "placeAndRoute.katana.stepByStep.globalRoute"
, "Katana - &Global Route" , "Katana - &Global Route"
, "Run the <b>Knik</b> global router" , "Run the <b>Katana</b> global router"
, std::bind(&GraphicKatanaEngine::_globalRoute,this) , std::bind(&GraphicKatanaEngine::_globalRoute,this)
); );
_viewer->addToMenu( "placeAndRoute.katana.stepByStep.detailedRoute" _viewer->addToMenu( "placeAndRoute.katana.stepByStep.detailedRoute"

View File

@ -331,7 +331,7 @@ namespace Katana {
// size_t vTracksReservedLocal = getVTracksReservedLocal(); // size_t vTracksReservedLocal = getVTracksReservedLocal();
// if (cparanoid.enabled()) { // if (cparanoid.enabled()) {
// cparanoid << " o Post-checking Knik capacity overload h:" << hTracksReservedLocal // cparanoid << " o Post-checking Katana capacity overload h:" << hTracksReservedLocal
// << " v:." << vTracksReservedLocal << endl; // << " v:." << vTracksReservedLocal << endl;
// getGCellGrid()->checkEdgeOverflow( hTracksReservedLocal, vTracksReservedLocal ); // getGCellGrid()->checkEdgeOverflow( hTracksReservedLocal, vTracksReservedLocal );
// } // }

View File

@ -312,7 +312,7 @@ extern "C" {
, { "getToolSuccess" , (PyCFunction)PyKatanaEngine_getToolSuccess , METH_NOARGS , { "getToolSuccess" , (PyCFunction)PyKatanaEngine_getToolSuccess , METH_NOARGS
, "Returns True if the detailed routing has been successful." } , "Returns True if the detailed routing has been successful." }
, { "runGlobalRouter" , (PyCFunction)PyKatanaEngine_runGlobalRouter , METH_VARARGS , { "runGlobalRouter" , (PyCFunction)PyKatanaEngine_runGlobalRouter , METH_VARARGS
, "Run the global router (Knik)." } , "Run the global router (Katana)." }
, { "loadGlobalRouting" , (PyCFunction)PyKatanaEngine_loadGlobalRouting , METH_VARARGS , { "loadGlobalRouting" , (PyCFunction)PyKatanaEngine_loadGlobalRouting , METH_VARARGS
, "Load global routing into the detailed router." } , "Load global routing into the detailed router." }
, { "layerAssign" , (PyCFunction)PyKatanaEngine_layerAssign , METH_VARARGS , { "layerAssign" , (PyCFunction)PyKatanaEngine_layerAssign , METH_VARARGS