Take into account blockages and right shift bug in track avoidance.

* Change: In Etesian::SubSlice::getUsedVTracks(), now take blockages
    into account for used vertical tracks.
* Bug: In Etesian::SubSlice::avoidTrack(), right free interval for
    shifting was wrongly computed, effectively allowing *any* shift.
    This was creating cells overlap!
* New: In Hurricane::BasicLayer & Layer, establish a two way link
    between the blockage layer and routing layer. Now we can access
    the routing layer from the blockage.
This commit is contained in:
Jean-Paul Chaput 2022-12-16 17:17:05 +01:00
parent ca41dbd5ef
commit c85ad530c4
5 changed files with 69 additions and 26 deletions

View File

@ -56,6 +56,7 @@ namespace Etesian {
using CRL::AllianceFramework; using CRL::AllianceFramework;
using CRL::CatalogExtension; using CRL::CatalogExtension;
using CRL::getTransformation; using CRL::getTransformation;
using CRL::RoutingLayerGauge;
using Etesian::EtesianEngine; using Etesian::EtesianEngine;
@ -620,10 +621,34 @@ namespace Etesian {
size_t SubSlice::getUsedVTracks ( const Tile& tile, set<DbU::Unit>& vtracks ) size_t SubSlice::getUsedVTracks ( const Tile& tile, set<DbU::Unit>& vtracks )
{ {
DbU::Unit vpitch = _slice->getArea()->getEtesian()->getSliceStep(); RoutingGauge* rg = _slice->getArea()->getEtesian()->getGauge();
DbU::Unit vpitch = _slice->getArea()->getEtesian()->getSliceStep();
Cell* cell = tile.getMasterCell(); Cell* cell = tile.getMasterCell();
for ( Net* net : cell->getNets() ) { for ( Net* net : cell->getNets() ) {
if (not net->isExternal()) continue; if (not net->isExternal()) {
for ( Component* component : net->getComponents() ) {
if (not component->getLayer()->isBlockage()) continue;
cdebug_log(121,0) << "Looking at " << component << endl;
Vertical* v = dynamic_cast<Vertical*>( component );
if (not v) continue;
RoutingLayerGauge* rlg = rg->getLayerGauge( v->getLayer()->getRoutingLayer() );
if (not rlg) continue;
Box bb = v->getBoundingBox();
bb.inflate( -rlg->getWireWidth()/2, 0 );
Transformation transf = tile.getInstance()->getTransformation();
tile.getOccurrence().getPath().getTransformation().applyOn( transf );
transf.applyOn( bb );
cdebug_log(121,0) << "Obstacle bb " << bb << endl;
DbU::Unit xtrack = bb.getXMin() - (bb.getXMin() % vpitch);
for ( ; xtrack <= bb.getXMax() ; xtrack += vpitch ) {
cdebug_log(121,0) << "| add vtrack @" << DbU::getValueString(xtrack) << endl;
vtracks.insert( xtrack );
}
}
continue;
}
if (net->isPower() or net->isGround()) continue; if (net->isPower() or net->isGround()) continue;
for ( Component* component : NetExternalComponents::get(net) ) { for ( Component* component : NetExternalComponents::get(net) ) {
Vertical* v = dynamic_cast<Vertical*>( component ); Vertical* v = dynamic_cast<Vertical*>( component );
@ -708,29 +733,31 @@ namespace Etesian {
} }
if (iTile != endTile) { if (iTile != endTile) {
auto nextTile = iTile; auto nextTile = iTile;
--nextTile; ++nextTile;
maxDxRight = (*nextTile).getXMin() - (*iTile).getXMax(); maxDxRight = (*nextTile).getXMin() - (*iTile).getXMax();
} }
cdebug_log(121,0) << "maxDxLeft =" << DbU::getValueString(maxDxLeft ) << endl;
cdebug_log(121,0) << "maxDxRight=" << DbU::getValueString(maxDxRight) << endl;
DbU::Unit xShift = 0; DbU::Unit xShift = 0;
for ( ; xShift <= maxDxLeft ; xShift += vpitch ) { for ( ; xShift >= maxDxLeft ; xShift -= vpitch ) {
cdebug_log(121,0) << "| try left shift " << DbU::getValueString(-xShift) << endl; cdebug_log(121,0) << "| try left shift " << DbU::getValueString(xShift) << endl;
if (not usedVTracks.count( xTrack + xShift )) break; if (not usedVTracks.count( xTrack - xShift )) break;
} }
if (xShift > maxDxLeft) { if (xShift < maxDxLeft) {
xShift = - vpitch; xShift = vpitch;
for ( ; xShift > maxDxRight ; xShift -= vpitch ) { for ( ; xShift <= maxDxRight ; xShift += vpitch ) {
cdebug_log(121,0) << "| try right shift " << DbU::getValueString(-xShift) << endl; cdebug_log(121,0) << "| try right shift " << DbU::getValueString(xShift) << endl;
if (not usedVTracks.count( xTrack + xShift )) break; if (not usedVTracks.count( xTrack - xShift )) break;
} }
} }
if (xShift < maxDxRight) { if (xShift > maxDxRight) {
cerr << Error( "SubSlice::trackAvoid(): Unable to put out of the way %s." cerr << Error( "SubSlice::trackAvoid(): Unable to put out of the way %s."
, getString(*iTile).c_str() , getString(*iTile).c_str()
) << endl; ) << endl;
break; break;
} }
cdebug_log(121,0) << "Shifting " << (*iTile) << " by " << DbU::getValueString(-xShift) << endl; cdebug_log(121,0) << "Shifting " << (*iTile) << " by " << DbU::getValueString(-xShift) << endl;
(*iTile).translate( -xShift ); (*iTile).translate( xShift );
break; break;
} }

View File

@ -179,6 +179,7 @@ namespace Hurricane {
,_gds2Layer (gds2Layer) ,_gds2Layer (gds2Layer)
,_gds2Datatype (gds2Datatype) ,_gds2Datatype (gds2Datatype)
,_blockageLayer (NULL) ,_blockageLayer (NULL)
,_routingLayer (NULL)
,_realName ("<not associated>") ,_realName ("<not associated>")
,_hasGds (false) ,_hasGds (false)
{ } { }
@ -206,6 +207,10 @@ namespace Hurricane {
{ return _blockageLayer; } { return _blockageLayer; }
BasicLayer* BasicLayer::getRoutingLayer () const
{ return _routingLayer; }
BasicLayers BasicLayer::getBasicLayers () const BasicLayers BasicLayer::getBasicLayers () const
{ return BasicLayer_BasicLayers(this); } { return BasicLayer_BasicLayers(this); }
@ -279,6 +284,7 @@ namespace Hurricane {
record->add(getSlot("_material" , &_material)); record->add(getSlot("_material" , &_material));
record->add(getSlot("_realName" , &_realName)); record->add(getSlot("_realName" , &_realName));
record->add(getSlot("_blockageLayer", _blockageLayer)); record->add(getSlot("_blockageLayer", _blockageLayer));
record->add(getSlot("_routingLayer" , _routingLayer));
record->add(getSlot("_gds2Layer" , _gds2Layer)); record->add(getSlot("_gds2Layer" , _gds2Layer));
record->add(getSlot("_gds2Datatype" , _gds2Datatype)); record->add(getSlot("_gds2Datatype" , _gds2Datatype));
} }

View File

@ -75,6 +75,10 @@ namespace Hurricane {
{ return NULL; } { return NULL; }
const Layer* Layer::getRoutingLayer () const
{ return NULL; }
const Layer* Layer::getCut () const const Layer* Layer::getCut () const
{ return NULL; } { return NULL; }

View File

@ -94,11 +94,13 @@ namespace Hurricane {
inline uint32_t getGds2Datatype () const; inline uint32_t getGds2Datatype () const;
virtual BasicLayers getBasicLayers () const; virtual BasicLayers getBasicLayers () const;
virtual BasicLayer* getBlockageLayer () const; virtual BasicLayer* getBlockageLayer () const;
virtual BasicLayer* getRoutingLayer () const;
virtual const Layer* getTop () const; virtual const Layer* getTop () const;
virtual const Layer* getBottom () const; virtual const Layer* getBottom () const;
inline const Name& getRealName () const; inline const Name& getRealName () const;
// Updators // Updators
inline void setBlockageLayer ( BasicLayer* layer); inline void setBlockageLayer ( BasicLayer* layer);
inline void setRoutingLayer ( BasicLayer* layer);
inline void setGds2Layer ( uint32_t ); inline void setGds2Layer ( uint32_t );
inline void setGds2Datatype ( uint32_t ); inline void setGds2Datatype ( uint32_t );
inline void setRealName ( const char* realName); inline void setRealName ( const char* realName);
@ -115,6 +117,7 @@ namespace Hurricane {
uint32_t _gds2Layer; uint32_t _gds2Layer;
uint32_t _gds2Datatype; uint32_t _gds2Datatype;
BasicLayer* _blockageLayer; BasicLayer* _blockageLayer;
BasicLayer* _routingLayer;
Name _realName; Name _realName;
bool _hasGds; bool _hasGds;
@ -144,11 +147,18 @@ namespace Hurricane {
inline uint32_t BasicLayer::getGds2Layer () const { return _gds2Layer; } inline uint32_t BasicLayer::getGds2Layer () const { return _gds2Layer; }
inline uint32_t BasicLayer::getGds2Datatype () const { return _gds2Datatype; } inline uint32_t BasicLayer::getGds2Datatype () const { return _gds2Datatype; }
inline const Name& BasicLayer::getRealName () const { return _realName; } inline const Name& BasicLayer::getRealName () const { return _realName; }
inline void BasicLayer::setBlockageLayer ( BasicLayer* layer) { _blockageLayer = layer; layer->setBlockage(true); } inline void BasicLayer::setRoutingLayer ( BasicLayer* layer) { _routingLayer = layer; }
inline void BasicLayer::setGds2Layer ( uint32_t number ) { _gds2Layer=number; _hasGds=true; } inline void BasicLayer::setGds2Layer ( uint32_t number ) { _gds2Layer=number; _hasGds=true; }
inline void BasicLayer::setGds2Datatype ( uint32_t number ) { _gds2Datatype=number; } inline void BasicLayer::setGds2Datatype ( uint32_t number ) { _gds2Datatype=number; }
inline void BasicLayer::setRealName ( const char* realName) { _realName = realName; } inline void BasicLayer::setRealName ( const char* realName) { _realName = realName; }
inline void BasicLayer::setBlockageLayer ( BasicLayer* layer)
{
_blockageLayer = layer;
layer->setBlockage( true );
layer->setRoutingLayer( this );
}
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Hurricane::JsonBasicLayer". // Class : "Hurricane::JsonBasicLayer".

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// Copyright (c) BULL S.A. 2000-2018, All Rights Reserved // Copyright (c) BULL S.A. 2000-2022, All Rights Reserved
// //
// This file is part of Hurricane. // This file is part of Hurricane.
// //
@ -30,14 +30,12 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#ifndef HURRICANE_LAYER_H #pragma once
#define HURRICANE_LAYER_H #include "hurricane/Mask.h"
#include "hurricane/DBo.h"
#include "hurricane/Mask.h" #include "hurricane/Layers.h"
#include "hurricane/DBo.h" #include "hurricane/DbU.h"
#include "hurricane/Layers.h" #include "hurricane/BasicLayers.h"
#include "hurricane/DbU.h"
#include "hurricane/BasicLayers.h"
namespace Hurricane { namespace Hurricane {
@ -72,6 +70,7 @@ namespace Hurricane {
inline const DbU::Unit& getMinimalSpacing () const; inline const DbU::Unit& getMinimalSpacing () const;
virtual BasicLayers getBasicLayers () const = 0; virtual BasicLayers getBasicLayers () const = 0;
virtual const Layer* getBlockageLayer () const; virtual const Layer* getBlockageLayer () const;
virtual const Layer* getRoutingLayer () const;
virtual const Layer* getCut () const; virtual const Layer* getCut () const;
virtual const Layer* getTop () const; virtual const Layer* getTop () const;
virtual const Layer* getBottom () const; virtual const Layer* getBottom () const;
@ -185,6 +184,3 @@ namespace Hurricane {
INSPECTOR_P_SUPPORT(Hurricane::Layer); INSPECTOR_P_SUPPORT(Hurricane::Layer);
INSPECTOR_PR_SUPPORT(Hurricane::Layer::Mask); INSPECTOR_PR_SUPPORT(Hurricane::Layer::Mask);
#endif // HURRICANE_LAYER_H