17 #ifndef KATABATIC_GCELL_H 18 #define KATABATIC_GCELL_H 25 #include "hurricane/DbU.h" 26 #include "hurricane/Point.h" 27 #include "hurricane/Box.h" 28 #include "hurricane/Interval.h" 29 #include "hurricane/ExtensionGo.h" 35 #include "crlcore/RoutingLayerGauge.h" 36 #include "katabatic/Constants.h" 37 #include "katabatic/AutoSegments.h" 46 using std::binary_function;
47 using Hurricane::_TName;
48 using Hurricane::Record;
54 using Hurricane::ExtensionGo;
62 enum GCellFunctionFlags { NoUpdate = 0x00000001 };
68 enum GCellFlag { GCellInvalidated = 0x00000001
69 , GCellSaturated = 0x00000002
70 , GCellUnderIoPad = 0x00000004
74 class GCell :
public ExtensionGo {
77 class CompareByIndex :
public binary_function<const GCell*,const GCell*,bool> {
79 bool operator() (
const GCell* lhs,
const GCell* rhs );
88 class CompareByKey :
public binary_function<const GCell*,const GCell*,bool> {
90 bool operator() (
const GCell* lhs,
const GCell* rhs );
98 inline Key (
GCell*,
unsigned int depth );
101 inline void update (
unsigned int depth );
102 friend bool operator< (
const Key&,
const Key& );
109 static bool areDensityConnex (
GCell* a,
GCell* b );
119 inline bool isUnderIoPad ()
const;
121 bool hasFreeTrack (
size_t depth,
float reserve )
const;
123 inline unsigned int getDepth ()
const;
124 inline unsigned int getIndex ()
const;
125 unsigned int getRow ()
const;
131 void getDensities (
float* )
const;
134 inline Point getCenter ()
const;
142 float getDensity (
unsigned int flags=0 )
const;
143 float getAverageHVDensity ()
const;
144 float getMaxHVDensity ()
const;
145 inline float getCDensity (
unsigned int flags=0 )
const;
146 inline float getWDensity (
unsigned int depth,
unsigned int flags=0 )
const;
151 inline const vector<AutoSegment*>&
getHSegments ()
const;
152 inline const vector<AutoSegment*>&
getVSegments ()
const;
153 inline const vector<AutoContact*>&
getContacts ()
const;
174 inline void updateKey (
unsigned int depth );
175 bool stepBalance (
unsigned int depth,
SetIndex& invalidateds );
179 ,
unsigned int flags=0 );
181 , set<Net*>& globalNets
183 inline void invalidateCt ();
184 inline void setUnderIoPad ();
185 void truncDensities ();
187 Record* _getRecord ()
const;
188 string _getString ()
const;
189 inline string _getTypeName ()
const;
190 void _xmlWrite ( ostream& o )
const;
194 static const Name _goName;
195 static size_t _allocateds;
200 vector<AutoSegment*> _vsegments;
201 vector<AutoSegment*> _hsegments;
202 vector<AutoContact*> _contacts;
209 float* _feedthroughs;
210 float* _fragmentations;
211 float* _globalsCount;
222 inline void _postCreate ();
223 inline void _preDestroy ();
239 inline bool GCell::isUnderIoPad ()
const {
return _flags&GCellUnderIoPad; }
243 inline Point GCell::getCenter ()
const {
return _box.
getCenter(); }
251 inline string GCell::_getTypeName ()
const {
return _TName(
"GCell"); }
252 inline void GCell::invalidateCt () { _flags |= GCellInvalidated; }
253 inline void GCell::setUnderIoPad() { _flags |= GCellUnderIoPad; }
279 {
return (depth<_depth) ? _blockages[depth] : 0; }
282 { invalidateCt(); _vsegments.push_back(segment); }
285 { invalidateCt(); _hsegments.push_back(segment); }
288 { invalidateCt(); _contacts.push_back(contact); }
292 inline bool GCell::CompareByIndex::operator() (
const GCell* lhs,
const GCell* rhs )
305 float difference = lhs._density - rhs._density;
306 if (difference != 0.0)
return (difference > 0.0);
320 inline bool empty ()
const;
321 inline size_t size ()
const;
322 inline const std::set<GCell*,GCell::CompareByKey>&
324 inline void insert (
GCell* );
325 inline void erase (
GCell* );
326 inline void unqueue (
GCell* );
330 std::set<GCell*,GCell::CompareByKey> _set;
347 string getVectorString (
float*,
size_t );
350 typedef std::vector<GCell*> GCellVector;
359 #endif // KATABATIC_GCELL_H DbU::Unit getY() const
Definition: GCell.h:245
GCell Density Comparison Functor.
Definition: GCell.h:81
void addContact(AutoContact *)
Definition: GCell.h:287
void insert(GCell *)
Definition: GCell.h:337
const DbU::Unit & getXMax() const
unsigned int getRow() const
Definition: GCell.cpp:461
virtual void translate(const DbU::Unit &, const DbU::Unit &)
Definition: GCell.cpp:1272
unsigned int getColumn() const
Definition: GCell.cpp:465
const vector< AutoContact * > & getContacts() const
Definition: GCell.h:250
AutoSegments getHStartSegments()
Definition: GCell.cpp:497
const vector< AutoSegment * > & getVSegments() const
Definition: GCell.h:248
float getVCapacity() const
Definition: GCell.cpp:539
CompareByDensity(unsigned int depth)
Definition: GCell.cpp:271
void updateContacts()
Definition: GCell.cpp:742
AutoSegments getVStopSegments()
Definition: GCell.cpp:515
bool empty() const
Definition: GCell.h:335
static DbU::Unit getTopRightShrink()
Definition: GCell.cpp:453
const DbU::Unit & getYMax() const
float getDensity(unsigned int flags=0) const
Definition: GCell.cpp:572
AutoSegments getStopSegments(unsigned int direction)
Definition: GCell.h:260
bool isAboveDensity(float threshold) const
Definition: GCell.cpp:400
void removeVSegment(AutoSegment *)
Definition: GCell.cpp:715
virtual const Name & getName() const
Definition: GCell.cpp:457
GCell * getGCell() const
Definition: GCell.h:299
size_t updateDensity()
Definition: GCell.cpp:750
unsigned int getDepth() const
Definition: GCell.h:241
Interval getSide(unsigned int) const
Definition: GCell.cpp:485
bool hasFreeTrack(size_t depth, float reserve) const
Definition: GCell.cpp:984
const std::set< GCell *, GCell::CompareByKey > & getGCells() const
Definition: GCell.h:340
void erase(GCell *)
Definition: GCell.h:338
void rpDesaturate(set< Net *> &)
Definition: GCell.cpp:1102
const DbU::Unit & getXMin() const
size_t checkDensity() const
Definition: GCell.cpp:938
GCell * getDown() const
Definition: GCell.cpp:481
GCell Grid.
Definition: GCellGrid.h:42
float getFeedthroughs(unsigned int depth) const
Definition: GCell.h:272
GCell Index Comparison Functor.
Definition: GCell.h:77
void removeContact(AutoContact *)
Definition: GCell.cpp:657
AutoSegments getStartSegments(unsigned int direction)
Definition: GCell.h:257
Routing Global Cell.
Definition: GCell.h:74
size_t getRoutingPads(set< RoutingPad *> &)
Definition: GCell.cpp:521
Abstract base class for AutoSegment.
Definition: AutoSegment.h:104
set< GCell *, CompareByIndex > SetIndex
Definition: GCell.h:105
bool isSaturated() const
Definition: GCell.h:237
The namespace dedicated to Katabatic.
Definition: Katabatic.dox:13
bool stepDesaturate(unsigned int depth, set< Net *> &, AutoSegment *&moved, unsigned int flags=0)
Definition: GCell.cpp:1130
const vector< AutoSegment * > & getHSegments() const
Definition: GCell.h:249
GCellGrid * getGCellGrid() const
Definition: GCell.h:240
static const Name & getStaticName()
Definition: GCell.cpp:445
unsigned int getIndex() const
Definition: GCell.h:242
AutoSegments getHStopSegments()
Definition: GCell.cpp:509
DbU::Unit getXMax() const
Definition: GCell.h:246
void update(unsigned int depth)
Definition: GCell.h:300
bool stepNetDesaturate(unsigned int depth, set< Net *> &globalNets, SetIndex &invalidateds)
Definition: GCell.cpp:1226
size_t size() const
Definition: GCell.h:336
static size_t getAllocateds()
Definition: GCell.cpp:449
DbU::Unit getBlockage(unsigned int depth) const
Definition: GCell.h:278
GCell * getUp() const
Definition: GCell.cpp:477
float getFragmentation(unsigned int depth) const
Definition: GCell.h:269
Definition: Constants.h:27
float getDensity() const
Definition: GCell.h:298
DbU::Unit getYMax() const
Definition: GCell.h:247
Key(GCell *, unsigned int depth)
Definition: GCell.h:297
bool checkEdgeSaturation(size_t hreserved, size_t vreserved) const
Definition: GCell.cpp:1034
void updateKey(unsigned int depth)
Definition: GCell.h:255
GCell Set, sorted by density.
Definition: GCell.h:315
GCell Key - Density Cache.
Definition: GCell.h:93
GCell * getLeft() const
Definition: GCell.cpp:469
float getWDensity(unsigned int depth, unsigned int flags=0) const
Definition: GCell.h:266
bool isValid() const
Definition: GCell.h:238
DbU::Unit getX() const
Definition: GCell.h:244
const Key & getKey() const
Definition: GCell.h:254
float getGlobalsCount(unsigned int depth) const
Definition: GCell.h:275
void unqueue(GCell *)
Definition: GCell.h:339
GCell * getRight() const
Definition: GCell.cpp:473
void addVSegment(AutoSegment *)
Definition: GCell.h:281
const DbU::Unit & getYMin() const
float getCDensity(unsigned int flags=0) const
Definition: GCell.h:263
void addBlockage(unsigned int depth, DbU::Unit)
Definition: GCell.cpp:631
float getHCapacity() const
Definition: GCell.cpp:533
AutoSegments getVStartSegments()
Definition: GCell.cpp:503
void removeHSegment(AutoSegment *)
Definition: GCell.cpp:688
void addHSegment(AutoSegment *)
Definition: GCell.h:284
virtual Box getBoundingBox() const
Definition: GCell.cpp:1266