# Kite - Detailed Router

KiteEngine.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/KiteEngine.h" |
14 // +-----------------------------------------------------------------+
15
16
17 #ifndef KITE_KITE_ENGINE_H
18 #define KITE_KITE_ENGINE_H
19
20 #include <iostream>
21
22 #include "hurricane/Name.h"
23 namespace Hurricane {
24 class Layer;
25 class Net;
26 class Cell;
27 class CellViewer;
28 }
29
30 #include "crlcore/RoutingGauge.h"
31 #include "katabatic/KatabaticEngine.h"
32
33 namespace Knik {
34 class KnikEngine;
35 }
36
37 #include "kite/Constants.h"
38 #include "kite/TrackElement.h"
39 #include "kite/Configuration.h"
40
41
42 namespace Kite {
43
44 using Hurricane::Name;
45 using Hurricane::Layer;
46 using Hurricane::Net;
47 using Hurricane::Cell;
48 using Hurricane::CellViewer;
49 using CRL::RoutingGauge;
50 using Katabatic::KatabaticEngine;
51
52 class Track;
53 class RoutingPlane;
54 class NegociateWindow;
55
56
57 // -------------------------------------------------------------------
58 // Class : "Kite::KiteEngine".
59
60 class KiteEngine : public KatabaticEngine {
61
62 public:
63 static const Name& staticGetName ();
64 static KiteEngine* create ( Cell* );
65 static KiteEngine* get ( const Cell* );
66 static void wipeoutRouting ( Cell* );
67 public:
68 inline bool useClockTree () const;
69 inline CellViewer* getViewer () const;
70 inline KatabaticEngine* base ();
71 inline Configuration* getKiteConfiguration ();
72 virtual Configuration* getConfiguration ();
73 inline Net* getBlockageNet ();
74 inline bool getToolSuccess () const;
75 inline unsigned long getEventsLimit () const;
76 inline unsigned int getRipupLimit ( unsigned int type ) const;
77 unsigned int getRipupLimit ( const TrackElement* ) const;
78 inline unsigned int getRipupCost () const;
79 inline size_t getHTracksReservedLocal () const;
80 inline size_t getVTracksReservedLocal () const;
81 inline bool profileEventCosts () const;
82 virtual const Name& getName () const;
83 inline Configuration::PostEventCb_t&
84 getPostEventCb ();
85 inline NegociateWindow* getNegociateWindow ();
86 inline size_t getRoutingPlanesSize () const;
87 RoutingPlane* getRoutingPlaneByIndex ( size_t index ) const;
88 RoutingPlane* getRoutingPlaneByLayer ( const Layer* ) const;
89 Track* getTrackByPosition ( const Layer*, DbU::Unit axis, unsigned int mode=Constant::Nearest ) const;
90 inline void printConfiguration () const;
91 void printCompletion () const;
92 void dumpMeasures ( std::ostream& ) const;
93 void dumpMeasures () const;
94 inline void setViewer ( CellViewer* );
95 inline void setPostEventCb ( Configuration::PostEventCb_t );
96 inline void setEventLimit ( unsigned long );
97 inline void setMinimumWL ( double );
98 inline void setRipupLimit ( unsigned int type, unsigned int );
99 inline void setRipupCost ( unsigned int );
100 inline void setHTracksReservedLocal ( size_t );
101 inline void setVTracksReservedLocal ( size_t );
102 void buildPowerRails ();
103 void buildPreRouteds ();
104 void protectRoutingPads ();
105 void preProcess ();
106 void setInterrupt ( bool );
107 void createGlobalGraph ( unsigned int mode );
108 virtual void createDetailedGrid ();
109 void saveGlobalSolution ();
110 void annotateGlobalGraph ();
111 void setFixedPreRouted ();
112 void runNegociate ( unsigned int flags=KtNoFlags );
113 void runGlobalRouter ( unsigned int mode );
114 virtual void loadGlobalRouting ( unsigned int method );
115 virtual void finalizeLayout ();
116 void _runKiteInit ();
117 void _gutKite ();
118 void _computeCagedConstraints ();
119 TrackElement* _lookup ( Segment* ) const;
120 inline TrackElement* _lookup ( AutoSegment* ) const;
121 bool _check ( unsigned int& overlap, const char* message=NULL ) const;
122 void _check ( Net* ) const;
123 virtual Record* _getRecord () const;
124 virtual string _getString () const;
125 virtual string _getTypeName () const;
126
127 private:
128 // Attributes.
129 static Name _toolName;
130 protected:
131 CellViewer* _viewer;
132 Knik::KnikEngine* _knik;
133 Net* _blockageNet;
134 Configuration* _configuration;
135 vector<RoutingPlane*> _routingPlanes;
136 NegociateWindow* _negociateWindow;
137 double _minimumWL;
138 mutable bool _toolSuccess;
139
140 protected:
141 // Constructors & Destructors.
142 KiteEngine ( Cell* );
143 virtual ~KiteEngine ();
144 virtual void _postCreate ();
145 virtual void _preDestroy ();
146 void _initDataBase ();
147 private:
148 KiteEngine ( const KiteEngine& );
149 KiteEngine& operator= ( const KiteEngine& );
150 };
151
152
153 // Inline Functions.
154 inline bool KiteEngine::useClockTree () const { return _configuration->useClockTree(); }
155 inline CellViewer* KiteEngine::getViewer () const { return _viewer; }
156 inline KatabaticEngine* KiteEngine::base () { return static_cast< KatabaticEngine*>(this); }
157 inline Configuration* KiteEngine::getKiteConfiguration () { return _configuration; }
158 inline Net* KiteEngine::getBlockageNet () { return _blockageNet; }
159 inline Configuration::PostEventCb_t& KiteEngine::getPostEventCb () { return _configuration->getPostEventCb(); }
160 inline bool KiteEngine::getToolSuccess () const { return _toolSuccess; }
161 inline unsigned long KiteEngine::getEventsLimit () const { return _configuration->getEventsLimit(); }
162 inline unsigned int KiteEngine::getRipupCost () const { return _configuration->getRipupCost(); }
163 inline size_t KiteEngine::getHTracksReservedLocal () const { return _configuration->getHTracksReservedLocal(); }
164 inline size_t KiteEngine::getVTracksReservedLocal () const { return _configuration->getVTracksReservedLocal(); }
165 inline bool KiteEngine::profileEventCosts () const { return _configuration->profileEventCosts(); }
166 inline unsigned int KiteEngine::getRipupLimit ( unsigned int type ) const { return _configuration->getRipupLimit(type); }
167 inline NegociateWindow* KiteEngine::getNegociateWindow () { return _negociateWindow; }
168 inline size_t KiteEngine::getRoutingPlanesSize () const { return _routingPlanes.size(); }
169 inline void KiteEngine::setViewer ( CellViewer* viewer ) { _viewer=viewer; }
170 inline void KiteEngine::setEventLimit ( unsigned long limit ) { _configuration->setEventsLimit(limit); }
171 inline void KiteEngine::setRipupLimit ( unsigned int type, unsigned int limit ) { _configuration->setRipupLimit(limit,type); }
172 inline void KiteEngine::setRipupCost ( unsigned int cost ) { _configuration->setRipupCost(cost); }
173 inline void KiteEngine::setHTracksReservedLocal ( size_t reserved ) { _configuration->setHTracksReservedLocal(reserved); }
174 inline void KiteEngine::setVTracksReservedLocal ( size_t reserved ) { _configuration->setVTracksReservedLocal(reserved); }
175 inline void KiteEngine::setMinimumWL ( double minimum ) { _minimumWL = minimum; }
176 inline void KiteEngine::setPostEventCb ( Configuration::PostEventCb_t cb ) { _configuration->setPostEventCb(cb); }
177 inline void KiteEngine::printConfiguration () const { _configuration->print(getCell()); }
178 inline TrackElement* KiteEngine::_lookup ( AutoSegment* segment ) const { return segment->getObserver<TrackElement>(); }
179
180
181 // Variables.
182 extern const char* missingRW;
183
184
185 } // Kite namespace.
186
187
188 INSPECTOR_P_SUPPORT(Kite::KiteEngine);
189
190
191 #endif // KITE_KITE_ENGINE_H
Kite::KiteEngine::staticGetName
static const Name & staticGetName()
Hurricane::Name
Hurricane::Net
Hurricane::DbU::Unit
std::int64_t Unit
Hurricane::Cell
CRL::RoutingGauge
Knik
Definition: KiteEngine.h:33
Kite::KiteEngine::getBlockageNet
Net * getBlockageNet()
Definition: KiteEngine.h:158
Kite::Track
Structure managing one routing track.
Definition: Track.h:42
Constant::Nearest
Nearest
Katabatic::AutoSegment
Kite::NegociateWindow
Perform the routing, main RoutingEvent manager.
Definition: NegociateWindow.h:92
Kite::KiteEngine::getConfiguration
virtual Configuration * getConfiguration()
Katabatic::KatabaticEngine
Kite::KiteEngine
The Kite Tool.
Definition: KiteEngine.h:60
Kite::KiteEngine::getRipupCost
unsigned int getRipupCost() const
Definition: KiteEngine.h:162
Kite::KiteEngine::create
static KiteEngine * create(Cell *)
Hurricane::Layer
Kite::RoutingPlane
Array of Tracks in one Layer.
Definition: RoutingPlane.h:34
Hurricane::Segment
Hurricane::CellViewer
Kite::KiteEngine::getEventsLimit
unsigned long getEventsLimit() const
Definition: KiteEngine.h:161
Kite::TrackElement
Abstract Class for all Elements inserted inside a Track.
Definition: TrackElement.h:100
Kite::KiteEngine::getRipupLimit
unsigned int getRipupLimit(unsigned int type) const
Definition: KiteEngine.h:166
Kite::KiteEngine::base
KatabaticEngine * base()
Definition: KiteEngine.h:156
Kite::KiteEngine::getToolSuccess
bool getToolSuccess() const
Definition: KiteEngine.h:160
Hurricane
Kite
The namespace dedicated to Kite.
Definition: Constants.h:22
Hurricane::Net
Kite::KiteEngine::getKiteConfiguration
Configuration * getKiteConfiguration()
Definition: KiteEngine.h:157