In Dijkstra.cpp/.h:

- GlobalRouting takes into account self symmetries and symmetries in pair of nets according to an axis. Self symmetries are symmetries considering one net symmetric to an axis. During the materialize step, they are routed symmetrically according to the axis. Symmetries in pair of nets follow the same principle but with 2 nets.

In LocalGlobalRouting.cpp:
- Minor bug fixed
- Verbose commented

in NetRoutingProperty.cpp/.h:
- Some flags methods  methods added
This commit is contained in:
EricLaoGitHub 2017-03-08 17:49:23 +01:00
parent 086e40ec7d
commit 345ca78ade
5 changed files with 593 additions and 330 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2409,30 +2409,30 @@ namespace {
if (i == 0){
if (h){
cerr << "case i=0, h" << endl;
cdebug_log(145,0) << "case i=0, h" << endl;
ac = AutoContactHTee::create( _gcell, _net, Session::getContactLayer(2) );
ac->setX(_gcell->getXMin());
ac->setY(_gcell->getYMin() + _gcell->getHeight()/2);
firstH = true;
} else if (v){
cerr << "case i=0, v" << endl;
cdebug_log(145,0) << "case i=0, v" << endl;
ac = AutoContactTurn::create( _gcell, _net, Session::getContactLayer(1) );
ac->setX(v->getX());
ac->setY(_gcell->getYMin() + _gcell->getHeight()/2);
}
} else if (i == hooks.size()-1){
if (h){
cerr << "case i=last, h" << endl;
cdebug_log(145,0) << "case i=last, h" << endl;
ac = autoContacts[i-1];
} else if (v){
cerr << "case i=last, v" << endl;
cdebug_log(145,0) << "case i=last, v" << endl;
ac = AutoContactTurn::create( _gcell, _net, Session::getContactLayer(1) );
ac->setX(v->getX());
ac->setY(_gcell->getYMin() + _gcell->getHeight()/2);
}
} else {
if ((i == 1)&&(firstH)){
cerr << "case i=1, first was H" << endl;
cdebug_log(145,0) << "case i=1, first was H" << endl;
ac = autoContacts[i-1];
if (v) ac->setX(v->getX());
else {
@ -2441,7 +2441,7 @@ namespace {
<< endl;
}
} else {
cerr << "case i=1, first was V" << endl;
cdebug_log(145,0) << "case i=1, first was V" << endl;
ac = AutoContactHTee::create( _gcell, _net, Session::getContactLayer(2) );
ac->setX(v->getX());
ac->setY(_gcell->getYMin() + _gcell->getHeight()/2);
@ -2680,9 +2680,7 @@ namespace {
} else {
cdebug_log(145,0) << "case i=X, first was H"<< endl;
ac = AutoContactVTee::create( _gcell, _net, Session::getContactLayer(1) );
cerr << "1" << endl;
ac->setX(_gcell->getXMin() + _gcell->getWidth()/2);
cerr << "2" << endl;
ac->setY(h->getY());
}
}
@ -2931,7 +2929,7 @@ namespace {
forks.push( getSegmentOppositeHook( _south ), source );
targetContact = target;
} else {
cerr << Warning( "Something is wrong with the globals and the fromHook in this Strut."
cerr << Warning( "Something is wrong with the globals and the fromHook in this Strut 1."
, getString(_gcell).c_str() )
<< endl;
}
@ -2942,7 +2940,7 @@ namespace {
} else if ( _south and (_fromHook != _south) ){
forks.push( getSegmentOppositeHook( _south ), target );
} else {
cerr << Warning( "Something is wrong with the globals and the fromHook in this Strut."
cerr << Warning( "Something is wrong with the globals and the fromHook in this Strut 2."
, getString(_gcell).c_str() )
<< endl;
}
@ -2981,7 +2979,7 @@ namespace {
forks.push( getSegmentOppositeHook( _west ), source );
targetContact = target;
} else {
cerr << Warning( "Something is wrong with the globals and the fromHook in this Strut."
cerr << Warning( "Something is wrong with the globals and the fromHook in this Strut. 3"
, getString(_gcell).c_str() )
<< endl;
}
@ -2993,7 +2991,7 @@ namespace {
} else if ( _west and (_fromHook != _west) ){
forks.push( getSegmentOppositeHook( _west ), target );
} else {
cerr << Warning( "Something is wrong with the globals and the fromHook in this Strut."
cerr << Warning( "Something is wrong with the globals and the fromHook in this Strut. 4"
, getString(_gcell).c_str() )
<< endl;
}
@ -3013,7 +3011,7 @@ namespace {
cdebug_log(145,0) << "[Create global segment]: " << globalSegment << endl;
} else {
cerr << Warning( "Something is wrong with the globals in this Strut."
cerr << Warning( "Something is wrong with the globals in this Strut. 5 "
, getString(_gcell).c_str() )
<< endl;
}
@ -3064,10 +3062,8 @@ namespace {
} else if ((_north != NULL) && (_south != NULL) && (_west != NULL)){
cdebug_log(145,0) << "Case NSW " << endl;
xtee = AutoContactHTee::create( _gcell, _net, Session::getContactLayer(1) );
cerr << "1" << endl;
if (_north->getComponent()->getX() < _south->getComponent()->getX()){
cerr << "2" << endl;
xtee->setX(_north->getComponent()->getX());
turn->setX(_south->getComponent()->getX());
if ( _north and (_fromHook != _north) ) forks.push( getSegmentOppositeHook( _north ), xtee );
@ -3076,7 +3072,6 @@ namespace {
else targetContact = turn;
} else {
cerr << "3" << endl;
xtee->setX(_south->getComponent()->getX());
turn->setX(_north->getComponent()->getX());
if ( _north and (_fromHook != _north) ) forks.push( getSegmentOppositeHook( _north ), turn );
@ -3084,7 +3079,6 @@ namespace {
if ( _south and (_fromHook != _south) ) forks.push( getSegmentOppositeHook( _south ), xtee );
else targetContact = xtee;
}
cerr << "4" << endl;
turn->setY(_west->getComponent()->getY());
xtee->setY(_west->getComponent()->getY());
if ( _west and (_fromHook != _west) ) forks.push( getSegmentOppositeHook( _west ), xtee );
@ -3181,7 +3175,7 @@ namespace {
cdebug_log(145,0) << "[Create global segment]: " << globalSegment << endl;
} else {
cerr << Warning( "Something is wrong with the globals in this Strut."
cerr << Warning( "Something is wrong with the globals in this Strut. 6"
, getString(_gcell).c_str() )
<< endl;
}
@ -3374,7 +3368,7 @@ namespace {
cdebug_log(145,0) << "[Create global segment]: " << globalSegment2 << endl;
}
} else {
cerr << Warning( "Something is wrong with the number of globals in this Strut."
cerr << Warning( "Something is wrong with the number of globals in this Strut. 7"
, getString(_gcell).c_str() )
<< endl;
}

View File

@ -38,6 +38,43 @@ namespace Anabatic {
class AnabaticEngine;
// -------------------------------------------------------------------
// Class : "Anabatic::Symmetry".
class Symmetry
{
public:
enum iFlag { None = 0
, sHorizontal = (1<<0)
, sVertical = (1<<1)
, sCFound = (1<<2)
};
private:
Symmetry(unsigned int, DbU::Unit);
~Symmetry();
public:
static Symmetry* create(unsigned int, DbU::Unit);
public:
unsigned int getType () const;
inline DbU::Unit getValue() const;
inline bool isCFound() const;
inline void setAsH();
inline void setAsV();
inline void setFound();
private:
unsigned int _flags;
DbU::Unit _value;
};
inline void Symmetry::setAsH () { _flags = ((_flags & ~(0x3)) | sHorizontal); }
inline void Symmetry::setAsV () { _flags = ((_flags & ~(0x3)) | sVertical ); }
inline void Symmetry::setFound () { _flags |= sCFound; }
inline DbU::Unit Symmetry::getValue () const { return _value; }
inline bool Symmetry::isCFound () const { return _flags & sCFound; }
// -------------------------------------------------------------------
// Class : "Anabatic::IntervalC".
@ -106,8 +143,9 @@ namespace Anabatic {
enum FlagR { NoRestriction = 0
, NRestricted = (1<<0)
, SRestricted = (1<<1)
, ERestricted = (1<<2)
, ERestricted = (1<<2)
, WRestricted = (1<<3)
, AxisTarget = (1<<4)
};
public:
static DbU::Unit unreached;
@ -195,6 +233,10 @@ namespace Anabatic {
inline void printInterval () const ;
void setIntervals ( Vertex* );
void resetIntervals ();
inline void setFlags ( unsigned int );
inline bool isAxisTarget () const;
inline void unsetFlags ( unsigned int );
inline void setAxisTarget ();
// Inspector support.
@ -286,10 +328,10 @@ namespace Anabatic {
inline void Vertex::setRestricted () { _flags |= 0xF; }
inline void Vertex::clearRestriction () { _flags &= ~(0xF); }
inline void Vertex::setNRestricted () { _flags |= 0x1; }
inline void Vertex::setSRestricted () { _flags |= 0x2; }
inline void Vertex::setERestricted () { _flags |= 0x4; }
inline void Vertex::setWRestricted () { _flags |= 0x8; }
inline void Vertex::setNRestricted () { _flags |= NRestricted; }
inline void Vertex::setSRestricted () { _flags |= SRestricted; }
inline void Vertex::setERestricted () { _flags |= ERestricted; }
inline void Vertex::setWRestricted () { _flags |= WRestricted; }
inline unsigned int Vertex::getFlags () const { return _flags; }
inline void Vertex::setIAxis ( DbU::Unit axis ) { _interv->setAxis(axis); }
@ -313,6 +355,9 @@ namespace Anabatic {
inline void Vertex::setIRangeFrom( DbU::Unit min, DbU::Unit max ) { _intervfrom->setRange(min, max); }
inline void Vertex::printInterval() const { _interv->print(); }
inline void Vertex::setAxisTarget() { _flags |= AxisTarget; }
inline bool Vertex::isAxisTarget () const { return (_flags & AxisTarget); }
inline void Vertex::unsetFlags ( unsigned int mask ) { _flags &= ~mask; }
// -------------------------------------------------------------------
// Class : "Anabatic::PriorityQueue".
@ -386,9 +431,10 @@ namespace Anabatic {
// Mode sub-classe.
class Mode : public Hurricane::BaseFlags {
public:
enum Flag { NoMode = 0
, Standart = (1<<0)
, Monotonic = (1<<1)
enum Flag { NoMode = 0
, Standart = (1<<0)
, Monotonic = (1<<1)
, AxisTarget = (1<<2)
};
public:
inline Mode ( unsigned int flags=NoMode );
@ -410,7 +456,7 @@ namespace Anabatic {
template<typename DistanceT>
inline DistanceT* setDistance ( DistanceT );
inline void setSearchAreaHalo ( DbU::Unit );
void load ( Net* );
void load ( Net* net );
void run ( Mode mode=Mode::Standart );
private:
Dijkstra ( const Dijkstra& );
@ -427,6 +473,14 @@ namespace Anabatic {
void _toSources ( Vertex*, int connexId );
void _getConnecteds ( Vertex*, VertexSet& );
void _checkEdges () const;
void _createSelfSymSeg ( Segment* );
inline void setAxisTarget ();
inline bool needAxisTarget () const;
inline void setFlags ( unsigned int );
inline void unsetFlags ( unsigned int );
void setAxisTargets ();
void unsetAxisTargets ();
private:
AnabaticEngine* _anabatic;
vector<Vertex*> _vertexes;
@ -440,6 +494,7 @@ namespace Anabatic {
DbU::Unit _searchAreaHalo;
int _connectedsId;
PriorityQueue _queue;
unsigned int _flags;
};
@ -455,6 +510,9 @@ namespace Anabatic {
template<typename DistanceT>
inline DistanceT* Dijkstra::setDistance ( DistanceT cb ) { _distanceCb = cb; return _distanceCb.target<DistanceT>(); }
inline void Dijkstra::setFlags ( unsigned int mask ) { _flags |= mask; }
inline bool Dijkstra::needAxisTarget () const { return (_flags & Mode::AxisTarget); }
inline void Dijkstra::unsetFlags ( unsigned int mask ) { _flags &= ~mask; }
} // Anabatic namespace.

View File

@ -28,6 +28,14 @@ namespace Hurricane {
// -------------------------------------------------------------------
// Class : "NetRoutingState"
DbU::Unit NetRoutingState::getSymValue( DbU::Unit v ) const
{
if (v < _axis) {
return _axis + (_axis-v);
} else return _axis;
}
string NetRoutingState::_getString () const
{
string s;

View File

@ -60,6 +60,7 @@ namespace Hurricane {
inline bool isSymHorizontal () const;
inline bool isSymVertical () const;
inline bool isSymMaster () const;
inline bool isSymSlave () const;
inline Net* getNet () const;
inline Net* getSymNet () const;
inline DbU::Unit getSymAxis () const;
@ -68,6 +69,8 @@ namespace Hurricane {
inline void setSymAxis ( DbU::Unit );
inline void setFlags ( unsigned int mask );
inline void unsetFlags ( unsigned int mask );
inline bool isSelfSym () const;
DbU::Unit getSymValue ( DbU::Unit ) const;
std::string _getString () const;
Record* _getRecord () const;
private:
@ -102,7 +105,9 @@ namespace Hurricane {
inline void NetRoutingState::unsetFlags ( unsigned int mask ) { _flags &= ~mask; }
inline void NetRoutingState::setNet ( Net* net ) { _net = net; }
inline void NetRoutingState::setSymNet ( Net* symNet ) { _symNet = symNet; }
inline void NetRoutingState::setSymAxis ( DbU::Unit axis ) { _axis = axis; }
inline void NetRoutingState::setSymAxis ( DbU::Unit axis ) { _axis = axis; }
inline bool NetRoutingState::isSelfSym () const { return ( (_symNet == NULL) and (isSymmetric()) ); }
inline bool NetRoutingState::isSymSlave () const { return ( (_symNet != NULL) and (!isSymMaster()) ); }
// -------------------------------------------------------------------