# Kite - Detailed Router

TrackSegment.h
1 // -*- C++ -*-
2 //
3 // This file is part of the Coriolis Software.
4 // Copyright (c) UPMC 2008-2018, All Rights Reserved
5 //
6 // +-----------------------------------------------------------------+
7 // | C O R I O L I S |
8 // | K i t e - D e t a i l e d R o u t e r |
9 // | |
10 // | Author : Jean-Paul CHAPUT |
11 // | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
12 // | =============================================================== |
13 // | C++ Header : "./kite/TrackSegment.h" |
14 // +-----------------------------------------------------------------+
15
16
17 #ifndef KITE_TRACK_SEGMENT_H
18 #define KITE_TRACK_SEGMENT_H
19
20 #include <set>
21 #include <functional>
22 #include "kite/TrackElement.h"
23
24
25 namespace Kite {
26
27 using std::string;
28 using std::map;
29 using std::set;
30 using std::binary_function;
31 using Hurricane::Record;
32 using Hurricane::Interval;
33 using Hurricane::DbU;
34 using Hurricane::Net;
35 using Hurricane::Layer;
36 using Katabatic::AutoSegment;
37
38 class DataNegociate;
39 class Track;
40 class TrackCost;
41
42
43 // -------------------------------------------------------------------
44 // Class : "TrackSegment".
45
46 class TrackSegment : public TrackElement {
47 public:
48 class CompareById : public binary_function<const TrackSegment*,const TrackSegment*,bool> {
49 public:
50 inline bool operator() ( const TrackSegment* lhs, const TrackSegment* rhs );
51 };
52
53 public:
54 static TrackElement* create ( AutoSegment*, Track*, bool& created );
55 static size_t getAllocateds ();
56 public:
57 // Wrapped AutoSegment Functions (when applicable).
58 virtual AutoSegment* base () const;
59 virtual bool isFixed () const;
60 virtual bool isHorizontal () const;
61 virtual bool isVertical () const;
62 virtual bool isLocal () const;
63 virtual bool isGlobal () const;
64 virtual bool isBipoint () const;
65 virtual bool isTerminal () const;
66 virtual bool isStrongTerminal ( unsigned int flags=0 ) const;
67 virtual bool isStrap () const;
68 virtual bool isSlackened () const;
69 virtual bool isDogleg () const;
70 virtual bool isReduced () const;
71 virtual bool isUTurn () const;
72 virtual bool isUserDefined () const;
73 // Predicates.
74 virtual bool canDogleg ();
75 virtual bool canDogleg ( Interval );
76 virtual bool canDogleg ( Katabatic::GCell*, unsigned int flags=0 );
77 virtual bool canPivotUp ( float reserve ) const;
78 virtual bool canPivotDown ( float reserve ) const;
79 virtual bool canMoveUp ( float reserve, unsigned int flags ) const;
80 virtual bool canSlacken () const;
81 virtual float getMaxUnderDensity ( unsigned int flags ) const;
82 virtual unsigned long getId () const;
83 virtual unsigned int getDirection () const;
84 virtual Net* getNet () const;
85 virtual const Layer* getLayer () const;
86 virtual DbU::Unit getPitch () const;
87 virtual DbU::Unit getPPitch () const;
88 virtual unsigned long getFreedomDegree () const;
89 virtual unsigned int getDoglegLevel () const;
90 virtual TrackElement* getNext () const;
91 virtual TrackElement* getPrevious () const;
92 virtual TrackElement* getParent () const;
93 virtual DbU::Unit getAxis () const;
94 virtual Interval getFreeInterval () const;
95 virtual Interval getSourceConstraints () const;
96 virtual Interval getTargetConstraints () const;
97 virtual DataNegociate* getDataNegociate ( unsigned int flags=KtDataSelf ) const;
98 virtual TrackElement* getCanonical ( Interval& );
99 virtual size_t getGCells ( Katabatic::GCellVector& ) const;
100 virtual TrackElement* getSourceDogleg ();
101 virtual TrackElement* getTargetDogleg ();
102 virtual TrackElements getPerpandiculars ();
103 virtual size_t getPerpandicularsBound ( set<TrackElement*>& );
104 // Mutators.
105 virtual void setTrack ( Track* );
106 virtual void updateFreedomDegree ();
107 virtual void setDoglegLevel ( unsigned int );
108 virtual void swapTrack ( TrackElement* );
109 virtual void reschedule ( unsigned int level );
110 virtual void detach ();
111 virtual void invalidate ();
112 virtual void revalidate ();
113 virtual void updatePPitch ();
114 virtual void setAxis ( DbU::Unit, unsigned int flags );
115 virtual TrackElement* makeDogleg ();
116 virtual TrackElement* makeDogleg ( Katabatic::GCell*, TrackElement*& perpandicular, TrackElement*& parallel );
117 virtual TrackElement* makeDogleg ( Interval, unsigned int& flags );
118 virtual void _postDoglegs ( TrackElement*& perpandicular, TrackElement*& parallel );
119 virtual bool moveAside ( unsigned int flags );
120 virtual bool slacken ( unsigned int flags=KbNoFlags );
121 virtual bool moveUp ( unsigned int flags );
122 virtual bool moveDown ( unsigned int flags );
123 #if THIS_IS_DISABLED
124 virtual void desalignate ();
125 #endif
126 virtual bool _check () const;
127 virtual Record* _getRecord () const;
128 virtual string _getString () const;
129 virtual string _getTypeName () const;
130
131 protected:
132 // Attributes.
133 static size_t _allocateds;
134 AutoSegment* _base;
135 unsigned long _freedomDegree;
136 DbU::Unit _ppitch;
137 DataNegociate* _data;
138 unsigned int _dogLegLevel:4;
139
140 protected:
141 // Constructors & Destructors.
142 TrackSegment ( AutoSegment*, Track* ) ;
143 virtual ~TrackSegment ();
144 virtual void _postCreate ();
145 virtual void _preDestroy ();
146 private:
147 TrackSegment ( const TrackSegment& );
148 TrackSegment& operator= ( const TrackSegment& );
149
150 };
151
152
153 inline bool TrackSegment::CompareById::operator() ( const TrackSegment* lhs, const TrackSegment* rhs )
154 { return lhs->getId() < rhs->getId(); }
155
156
157 typedef set<TrackSegment*,TrackSegment::CompareById> TrackSegmentSet;
158
159
160 } // Kite namespace.
161
162
163 INSPECTOR_P_SUPPORT(Kite::TrackSegment);
164
165 #endif // KITE_TRACK_SEGMENT_H
Kite::TrackSegment::getTargetDogleg
virtual TrackElement * getTargetDogleg()
Definition: TrackSegment.cpp:528
Katabatic::GCell
Kite::TrackSegment
Derived Katabatic::AutoSegment for the router.
Definition: TrackSegment.h:46
Kite::TrackSegment::getMaxUnderDensity
virtual float getMaxUnderDensity(unsigned int flags) const
Definition: TrackSegment.cpp:408
Kite::TrackSegment::isLocal
virtual bool isLocal() const
Definition: TrackSegment.cpp:151
Kite::TrackSegment::isFixed
virtual bool isFixed() const
Definition: TrackSegment.cpp:148
Kite::TrackSegment::revalidate
virtual void revalidate()
Definition: TrackSegment.cpp:331
Kite::TrackSegment::getPrevious
virtual TrackElement * getPrevious() const
Definition: TrackSegment.cpp:197
Kite::TrackSegment::create
static TrackElement * create(AutoSegment *, Track *, bool &created)
Definition: TrackSegment.cpp:125
Kite::TrackSegment::getAxis
virtual DbU::Unit getAxis() const
Definition: TrackSegment.cpp:170
Kite::TrackSegment::invalidate
virtual void invalidate()
Definition: TrackSegment.cpp:178
Kite::TrackSegment::getNext
virtual TrackElement * getNext() const
Definition: TrackSegment.cpp:190
Hurricane::Net
Kite::TrackSegment::getPerpandiculars
virtual TrackElements getPerpandiculars()
Definition: TrackSegment.cpp:176
Kite::TrackSegment::swapTrack
virtual void swapTrack(TrackElement *)
Definition: TrackSegment.cpp:350
Kite::TrackSegment::makeDogleg
virtual TrackElement * makeDogleg()
Definition: TrackSegment.cpp:705
Hurricane::DbU::Unit
std::int64_t Unit
Kite::TrackSegment::getParent
virtual TrackElement * getParent() const
Definition: TrackSegment.cpp:204
Kite::Track
Structure managing one routing track.
Definition: Track.h:42
Hurricane::Interval
Kite::TrackSegment::getDoglegLevel
virtual unsigned int getDoglegLevel() const
Definition: TrackSegment.cpp:172
Kite::TrackSegment::getNet
virtual Net * getNet() const
Definition: TrackSegment.cpp:166
Katabatic::AutoSegment
Kite::TrackSegment::canDogleg
virtual bool canDogleg()
Definition: TrackSegment.cpp:545
Kite::TrackSegment::getCanonical
virtual TrackElement * getCanonical(Interval &)
Definition: TrackSegment.cpp:175
Kite::TrackSegment::isSlackened
virtual bool isSlackened() const
Definition: TrackSegment.cpp:157
Kite::TrackSegment::getId
virtual unsigned long getId() const
Definition: TrackSegment.cpp:164
Kite::TrackSegment::getDataNegociate
virtual DataNegociate * getDataNegociate(unsigned int flags=KtDataSelf) const
Definition: TrackSegment.cpp:181
Kite::KtDataSelf
Definition: Constants.h:40
Kite::TrackSegment::detach
virtual void detach()
Definition: TrackSegment.cpp:321
Kite::TrackSegment::reschedule
virtual void reschedule(unsigned int level)
Definition: TrackSegment.cpp:392
Kite::TrackSegment::isTerminal
virtual bool isTerminal() const
Definition: TrackSegment.cpp:154
Kite::TrackSegment::getLayer
virtual const Layer * getLayer() const
Definition: TrackSegment.cpp:167
Hurricane::DbU
Kite::TrackSegment::isBipoint
virtual bool isBipoint() const
Definition: TrackSegment.cpp:153
Hurricane::Layer
Kite::TrackSegment::setTrack
virtual void setTrack(Track *)
Definition: TrackSegment.cpp:317
Kite::TrackSegment::_check
virtual bool _check() const
Definition: TrackSegment.cpp:825
Kite::TrackElement
Abstract Class for all Elements inserted inside a Track.
Definition: TrackElement.h:100
Kite::TrackSegment::_postDoglegs
virtual void _postDoglegs(TrackElement *&perpandicular, TrackElement *&parallel)
Definition: TrackSegment.cpp:758
Kite::TrackSegment::getFreeInterval
virtual Interval getFreeInterval() const
Definition: TrackSegment.cpp:214
Kite::TrackSegment::isDogleg
virtual bool isDogleg() const
Definition: TrackSegment.cpp:158
Kite::TrackSegment::getDirection
virtual unsigned int getDirection() const
Definition: TrackSegment.cpp:165
Kite::TrackSegment::isStrap
virtual bool isStrap() const
Definition: TrackSegment.cpp:156
Kite::TrackSegment::setAxis
virtual void setAxis(DbU::Unit, unsigned int flags)
Definition: TrackSegment.cpp:343
Kite
The namespace dedicated to Kite.
Definition: Constants.h:22
Kite::TrackSegment::getTargetConstraints
virtual Interval getTargetConstraints() const
Definition: TrackSegment.cpp:174
Kite::TrackSegment::setDoglegLevel
virtual void setDoglegLevel(unsigned int)
Definition: TrackSegment.cpp:295
Kite::TrackSegment::getSourceConstraints
virtual Interval getSourceConstraints() const
Definition: TrackSegment.cpp:173
Kite::TrackSegment::isGlobal
virtual bool isGlobal() const
Definition: TrackSegment.cpp:152
Kite::TrackSegment::getGCells
virtual size_t getGCells(Katabatic::GCellVector &) const
Definition: TrackSegment.cpp:225
Kite::TrackSegment::getFreedomDegree
virtual unsigned long getFreedomDegree() const
Definition: TrackSegment.cpp:171
Kite::DataNegociate
Algorimthmic datas associated the TrackSegment.
Definition: DataNegociate.h:50
Hurricane::Net
Kite::TrackSegment::getSourceDogleg
virtual TrackElement * getSourceDogleg()
Definition: TrackSegment.cpp:511
Kite::TrackSegment::updateFreedomDegree
virtual void updateFreedomDegree()
Definition: TrackSegment.cpp:306
Kite::TrackSegment::isVertical
virtual bool isVertical() const
Definition: TrackSegment.cpp:150
Kite::TrackSegment::isHorizontal
virtual bool isHorizontal() const
Definition: TrackSegment.cpp:149