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;
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 ();
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 
147  { return static_cast<Katabatic::Session*>(get("base()")); }
148 
150  { return get("getKiteEngine()")->_getKiteEngine(); }
151 
153  { return get("getBlockageNet()")->_getBlockageNet(); }
154 
156  { return get("getNegociateWindow()")->_getNegociateWindow(); }
157 
158  inline unsigned int Session::getRipupCost ()
159  { return get("getRipupCost()")->_getRipupCost(); }
160 
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
static TrackElement * lookup(Segment *)
static void addRemoveEvent(TrackElement *)
Definition: Session.h:170
static KiteEngine * getKiteEngine()
Definition: Session.h:149
std::int64_t Unit
static Katabatic::Session * base()
Definition: Session.h:146
static NegociateWindow * getNegociateWindow()
Definition: Session.h:155
static void addMoveEvent(TrackElement *, Track *)
Definition: Session.h:173
Structure managing one routing track.
Definition: Track.h:42
static Katabatic::GCell * getGCellUnder(DbU::Unit, DbU::Unit)
Definition: Session.h:161
Perform the routing, main RoutingEvent manager.
Definition: NegociateWindow.h:92
The Kite Tool.
Definition: KiteEngine.h:60
static void addSortEvent(Track *, bool forced=false)
Definition: Session.h:176
Tag part of Track with a weight.
Definition: TrackMarker.h:43
static Session * open(KiteEngine *)
Abstract Class for all Elements inserted inside a Track.
Definition: TrackElement.h:100
static size_t revalidate()
Definition: Session.h:179
static Configuration * getConfiguration()
The namespace dedicated to Kite.
Definition: Constants.h:22
static Net * getBlockageNet()
Definition: Session.h:152
static bool isEmpty()
Definition: Session.h:182
Kite update Session.
Definition: Session.h:59


Generated by doxygen 1.8.14 on Sun Nov 21 2021 Return to top of page
Kite - Detailed Router Copyright © 2008-2020 Sorbonne Universite. All rights reserved