# Kite - Detailed Router

Session.h
1 // -*- mode: C++; explicit-buffer-name: "Session.h<kite>" -*-
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/Session.h" |
14 // +-----------------------------------------------------------------+
15
16
17 #ifndef KITE_SESSION_H
18 #define KITE_SESSION_H
19
20 #include <set>
21 #include <vector>
22 #include <string>
23
24 namespace Hurricane {
25 class Record;
26 class Net;
27 class Segment;
28 }
29
30 #include "katabatic/Session.h"
31 namespace Katabatic {
32 class GCell;
33 class AutoSegment;
34 }
35
36
37 namespace Kite {
38
39 using std::set;
40 using std::vector;
41 using std::string;
42 using Hurricane::Record;
43 using Hurricane::Net;
44 using Hurricane::Segment;
45 using Hurricane::DbU;
46 using Katabatic::AutoSegment;
47
48 class Track;
49 class TrackElement;
50 class TrackMarker;
51 class NegociateWindow;
52 class Configuration;
53 class KiteEngine;
54
55
56 // -------------------------------------------------------------------
57 // Class : "Session".
58
59 class Session : public Katabatic::Session {
60
61 public:
62 typedef Katabatic::Session Super;
63
64 public:
65 static Session* open ( KiteEngine* );
66 static Session* get ( const char* message=NULL );
67 inline static Katabatic::Session* base ();
68 inline static bool isEmpty ();
69 inline static KiteEngine* getKiteEngine ();
70 static Configuration* getConfiguration ();
71 inline static Net* getBlockageNet ();
72 inline static NegociateWindow* getNegociateWindow ();
73 inline static unsigned int getRipupCost ();
74 inline static Katabatic::GCell* getGCellUnder ( DbU::Unit, DbU::Unit );
75 static void setInterrupt ( bool );
76 inline static void addInsertEvent ( TrackMarker* , Track* );
77 inline static void addInsertEvent ( TrackElement* , Track* );
78 inline static void addRemoveEvent ( TrackElement* );
79 inline static void addMoveEvent ( TrackElement* , Track* );
80 inline static void addSortEvent ( Track*, bool forced=false );
81 inline static size_t revalidate ();
82 static TrackElement* lookup ( Segment* );
83 static TrackElement* lookup ( AutoSegment* );
84 private:
85 KiteEngine* _getKiteEngine ();
86 Net* _getBlockageNet ();
87 unsigned int _getRipupCost ();
88 Katabatic::GCell* _getGCellUnder ( DbU::Unit, DbU::Unit );
89 void _doRemovalEvents ();
90 virtual size_t _revalidate ();
91 bool _isEmpty () const;
92 NegociateWindow* _getNegociateWindow ();
93 void _addInsertEvent ( TrackMarker* , Track* );
94 void _addInsertEvent ( TrackElement* , Track* );
95 void _addRemoveEvent ( TrackElement* );
96 void _addMoveEvent ( TrackElement* , Track* );
97 void _addSortEvent ( Track*, bool forced );
98 virtual Record* _getRecord () const;
99 virtual string _getTypeName () const;
100
101 protected:
102 // Internal Classes.
103 class Event {
104 public:
105 inline Event ( TrackElement*, Track* );
106 inline Event ( TrackMarker* , Track* );
107 public:
108 TrackElement* _segment;
109 TrackMarker* _marker;
110 Track* _track;
111 };
112
113 protected:
114 // Attributes.
115 vector<Event> _insertEvents;
116 vector<Event> _removeEvents;
117 set<Track*> _sortEvents;
118
119 protected:
120 // Constructors & Destructors.
121 Session ( KiteEngine* );
122 virtual ~Session ();
123 virtual void _postCreate ();
124 virtual void _preDestroy ();
125 private:
126 Session ( const Session& );
127 Session& operator= ( const Session& );
128
129 };
130
131
132 // Inline Functions.
133 inline Session::Event::Event ( TrackElement* segment , Track* track )
134 : _segment(segment)
135 , _marker (NULL)
136 , _track (track)
137 { }
138
139 inline Session::Event::Event ( TrackMarker* marker , Track* track )
140 : _segment(NULL)
141 , _marker (marker)
142 , _track (track)
143 { }
144
145
146 inline Katabatic::Session* Session::base ()
147 { return static_cast< Katabatic::Session*>(get("base()")); }
148
149 inline KiteEngine* Session::getKiteEngine ()
150 { return get("getKiteEngine()")->_getKiteEngine(); }
151
152 inline Net* Session::getBlockageNet ()
153 { return get("getBlockageNet()")->_getBlockageNet(); }
154
155 inline NegociateWindow* Session::getNegociateWindow ()
156 { return get("getNegociateWindow()")->_getNegociateWindow(); }
157
158 inline unsigned int Session::getRipupCost ()
159 { return get("getRipupCost()")->_getRipupCost(); }
160
161 inline Katabatic::GCell* Session::getGCellUnder ( DbU::Unit x, DbU::Unit y )
162 { return get("getGCellUnder()")->_getGCellUnder(x,y); }
163
164 inline void Session::addInsertEvent ( TrackMarker* marker, Track* track )
165 { get("addInsertEvent(TrackMarker*)")->_addInsertEvent(marker,track); }
166
167 inline void Session::addInsertEvent ( TrackElement* segment, Track* track )
168 { get("addInsertEvent(TrackElement*)")->_addInsertEvent(segment,track); }
169
170 inline void Session::addRemoveEvent ( TrackElement* segment )
171 { get("addRemoveEvent()")->_addRemoveEvent(segment); }
172
173 inline void Session::addMoveEvent ( TrackElement* segment, Track* track )
174 { get("addMoveEvent()")->_addMoveEvent(segment,track); }
175
176 inline void Session::addSortEvent ( Track* track, bool forced )
177 { get("addSortEvent()")->_addSortEvent(track,forced); }
178
179 inline size_t Session::revalidate ()
180 { return get("revalidate()")->_revalidate(); }
181
182 inline bool Session::isEmpty ()
183 { return get("isEmpty()")->_isEmpty(); }
184
185
186 } // Kite namespace.
187
188 #endif // KITE_SESSION_H
Katabatic::GCell
Kite::Session::lookup
static TrackElement * lookup(Segment *)
Kite::Session::addRemoveEvent
static void addRemoveEvent(TrackElement *)
Definition: Session.h:170
Hurricane::Net
Kite::Session::getKiteEngine
static KiteEngine * getKiteEngine()
Definition: Session.h:149
Hurricane::DbU::Unit
std::int64_t Unit
Kite::Session::base
static Katabatic::Session * base()
Definition: Session.h:146
Katabatic::Session
Kite::Session::getNegociateWindow
static NegociateWindow * getNegociateWindow()
Definition: Session.h:155
Kite::Session::addMoveEvent
static void addMoveEvent(TrackElement *, Track *)
Definition: Session.h:173
Kite::Track
Structure managing one routing track.
Definition: Track.h:42
Katabatic::AutoSegment
Katabatic
Kite::Session::getGCellUnder
static Katabatic::GCell * getGCellUnder(DbU::Unit, DbU::Unit)
Definition: Session.h:161
Kite::NegociateWindow
Perform the routing, main RoutingEvent manager.
Definition: NegociateWindow.h:92
Kite::KiteEngine
The Kite Tool.
Definition: KiteEngine.h:60
Kite::Session::addSortEvent
static void addSortEvent(Track *, bool forced=false)
Definition: Session.h:176
Kite::TrackMarker
Tag part of Track with a weight.
Definition: TrackMarker.h:43
Kite::Session::open
static Session * open(KiteEngine *)
Hurricane::DbU
Hurricane::Segment
Kite::TrackElement
Abstract Class for all Elements inserted inside a Track.
Definition: TrackElement.h:100
Hurricane
Kite::Session::revalidate
static size_t revalidate()
Definition: Session.h:179
Kite::Session::getConfiguration
static Configuration * getConfiguration()
Kite
The namespace dedicated to Kite.
Definition: Constants.h:22
Kite::Session::getBlockageNet
static Net * getBlockageNet()
Definition: Session.h:152
Hurricane::Net
Kite::Session::isEmpty
static bool isEmpty()
Definition: Session.h:182
Kite::Session
Kite update Session.
Definition: Session.h:59