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 targetPosition = segment->getTargetPosition();
if ( (sourcePosition.getX() >= gcellsArea.getXMax())
or (sourcePosition.getY() >= gcellsArea.getYMax())
if ( (sourcePosition.getX() > gcellsArea.getXMax())
or (sourcePosition.getY() > gcellsArea.getYMax())
or (targetPosition.getX() <= gcellsArea.getXMin())
or (targetPosition.getY() <= gcellsArea.getYMin()) ) {
cerr << Error( "RawGCellsUnder::RawGCellsUnder(): %s is completly outside the GCells area (ignored)."

View File

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

View File

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

View File

@ -17,6 +17,7 @@
#include <iostream>
#include "hurricane/Bug.h"
#include "hurricane/Warning.h"
#include "hurricane/Breakpoint.h"
#include "hurricane/Contact.h"
#include "hurricane/RoutingPad.h"
#include "hurricane/UpdateSession.h"
@ -270,7 +271,12 @@ namespace Anabatic {
// -------------------------------------------------------------------
// 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 )
@ -720,12 +726,9 @@ namespace Anabatic {
{
getAnabatic()->openSession();
//const vector<GCell*>& gcells = getAnabatic()->getGCells();
//size_t ibegin = gcells.size();
DbU::Unit side = Session::getSliceHeight();
Interval hspan = getSide( Flags::Horizontal );
Interval vspan = getSide( Flags::Vertical );
DbU::Unit side = Session::getSliceHeight();
Interval hspan = getSide( Flags::Horizontal );
Interval vspan = getSide( Flags::Vertical );
if (hspan.getSize() < 3*side) {
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 ()
{
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;
startMeasures();

View File

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

View File

@ -25,6 +25,10 @@ parametersTable = \
, ("anabatic.edgeWidth" ,TypeInt ,4 )
, ("anabatic.edgeCostH" ,TypeDouble ,9.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, 'gcut' , { 'color':'255,255,190', 'border':1 })
, (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, 'gcut' , { 'color':'255,255,190', 'border':1 })
, (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.globalLengthThreshold", "Global Length Threshold", 0, 1 )
, (TypeOption , "katabatic.topRoutingLayer" , "Top Routing Layer" , 0, 1 )
, (TypeOption , "anabatic.gcell.displayMode" , "GCell Display Mode" , 1, 1 )
, (TypeRule ,)
, (TypeTitle , "Kite - Detailed Router" )
, (TypeOption , "kite.hTracksReservedLocal", "Vert. Locally Reserved Tracks", 0 )

View File

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

View File

@ -66,6 +66,8 @@ namespace Katana {
void GraphicKatanaEngine::initGCell ( CellWidget* widget )
{
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();
QRect pixelBb = widget->dbuToScreenRect(bb);
painter.setPen ( pen );
painter.setBrush( Graphics::getBrush("Anabatic::GCell",widget->getDarkening()) );
painter.drawRect( pixelBb );
if (gcell->isFlat()) return;
if (pixelBb.width() > 150) {
QString text = QString("id:%1").arg(gcell->getId());
QFont font = Graphics::getFixedFont( QFont::Bold );
painter.setFont(font);
if (GCell::getDisplayMode() == GCell::Density) {
unsigned int density = (unsigned int)( 255.0 * gcell->getDensity() );
if (density > 255) density = 255;
pen.setWidth( 1 );
painter.setPen( pen );
painter.setBrush( Graphics::getColorScale( ColorScale::Fire ).getBrush( density, widget->getDarkening() ) );
painter.drawRect( pixelBb );
} else {
if (pixelBb.width() > 150) {
painter.setPen ( pen );
painter.setBrush( Graphics::getBrush("Anabatic::GCell",widget->getDarkening()) );
painter.drawRect( pixelBb );
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 ();
if (pixelBb.width() > 300) {
QString text = QString("id:%1").arg(gcell->getId());
QFont font = Graphics::getFixedFont( QFont::Bold );
painter.setFont(font);
pen.setWidth( 1 );
painter.setPen( pen );
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"
, "Katana - &Global Route"
, "Run the <b>Knik</b> global router"
, "Run the <b>Katana</b> global router"
, std::bind(&GraphicKatanaEngine::_globalRoute,this)
);
_viewer->addToMenu( "placeAndRoute.katana.stepByStep.detailedRoute"

View File

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

View File

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