From a0dce4ecebef5e1ac2db079a8e2f0c658a619e7a Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 22 Aug 2010 12:37:08 +0000 Subject: [PATCH] * ./knik: - Change: In KnikEngine, calculation of saturation is now using the RoutingGauge, but still uses a hard-wired CellGauge. - Change: Obstacles are now taken into account for saturation. --- knik/src/KnikEngine.cpp | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/knik/src/KnikEngine.cpp b/knik/src/KnikEngine.cpp index c7027406..76327046 100644 --- a/knik/src/KnikEngine.cpp +++ b/knik/src/KnikEngine.cpp @@ -63,6 +63,9 @@ #include "crlcore/Utilities.h" #include "crlcore/ToolBox.h" #include "crlcore/Measures.h" +#include "crlcore/RoutingGauge.h" +#include "crlcore/RoutingLayerGauge.h" +#include "crlcore/AllianceFramework.h" #include "knik/Configuration.h" #include "knik/Edge.h" @@ -79,6 +82,10 @@ namespace Knik { using Hurricane::Warning; using CRL::addMeasure; + using CRL::RoutingGauge; + using CRL::RoutingLayerGauge; + using CRL::AllianceFramework; + //globale variables unsigned __congestion__; @@ -1228,15 +1235,33 @@ void KnikEngine::reroute() void KnikEngine::computeSymbolicWireLength () { // Ugly: hardcoded SxLib gauge characteristics. - const double normalize = (50.0 * 10 * 4) / (50 * 50) ; - Name obstacleNetName ("obstaclenet"); + + size_t hEdgeCapacity = 0; + size_t vEdgeCapacity = 0; + double gcellSide = 50.0; + + RoutingGauge* rg = AllianceFramework::get()->getRoutingGauge(); + vector::const_iterator ilayerGauge = rg->getLayerGauges().begin(); + for ( ; ilayerGauge != rg->getLayerGauges().end() ; ++ilayerGauge ) { + RoutingLayerGauge* layerGauge = (*ilayerGauge); + if ( layerGauge->getType() != Constant::Default ) continue; + + if ( layerGauge->getDirection() == Constant::Horizontal ) { + hEdgeCapacity += layerGauge->getTrackNumber ( 0, DbU::lambda(50.0) ) - 1; + } else if ( layerGauge->getDirection() == Constant::Vertical ) { + vEdgeCapacity += layerGauge->getTrackNumber ( 0, DbU::lambda(50.0) ) - 1; + } + } + +// Complete formula: unitarian Wirelength/Area for one GCell. +// (side*(hEdgeCapacity+vEdgeCapacity)) / (side * side). + const double normalize = ((double)(hEdgeCapacity+vEdgeCapacity)) / gcellSide; unsigned long long symbolicWireLength = 0; forEach ( Net*, net, getCell()->getNets() ) { if ( net->isGlobal() or net->isSupply() - or net->isClock() - or (net->getName() == obstacleNetName) ) { + or net->isClock() ) { continue; }