# Kite - Detailed Router

RoutingPlane.h
1 // -*- C++ -*-
2 //
3 // This file is part of the Coriolis Software.
4 // Copyright (c) UPMC 2008-2013, 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/RoutingPlane.h" |
14 // +-----------------------------------------------------------------+
15
16
17 #ifndef KITE_ROUTING_PLANE_H
18 #define KITE_ROUTING_PLANE_H
19
20 #include "crlcore/RoutingLayerGauge.h"
21 #include "kite/Track.h"
22
23
24 namespace Kite {
25
26 using CRL::RoutingLayerGauge;
27 using Katabatic::KbDirectionMask;
28 class KiteEngine;
29
30
31 // -------------------------------------------------------------------
32 // Class : "RoutingPlane".
33
34 class RoutingPlane {
35
36 public:
37 static RoutingPlane* create ( KiteEngine*, size_t depth );
38 void destroy ();
39 inline bool isHorizontal () const;
40 inline bool isVertical () const;
41 inline KiteEngine* getKiteEngine () const;
42 inline RoutingLayerGauge* getLayerGauge () const;
43 inline unsigned int getDirection () const;
44 inline size_t getDepth () const;
45 inline DbU::Unit getAxisMin () const;
46 inline DbU::Unit getAxisMax () const;
47 inline DbU::Unit getTrackMin () const;
48 inline DbU::Unit getTrackMax () const;
49 RoutingPlane* getTop () const;
50 RoutingPlane* getBottom () const;
51 inline const Layer* getLayer () const;
52 inline const Layer* getBlockageLayer () const;
53 inline size_t getTracksSize () const;
54 inline size_t computeTracksSize () const;
55 inline DbU::Unit getTrackPosition ( size_t index ) const;
56 Track* getTrackByIndex ( size_t index ) const;
57 Track* getTrackByPosition ( DbU::Unit axis, unsigned int mode=KtNearest ) const;
58 bool _check ( unsigned int& overlaps ) const;
59 Record* _getRecord () const;
60 string _getString () const;
61 inline string _getTypeName () const;
62
63 protected:
64 // Sub-Class: TrackCompare.
65 struct TrackCompare {
66 inline bool operator() ( Track* track1, Track* track2 );
67 };
68
69 protected:
70 // Attributes.
71 KiteEngine* _kite;
72 RoutingLayerGauge* _layerGauge;
73 size_t _depth;
74 unsigned int _flags;
75 DbU::Unit _axisMin;
76 DbU::Unit _axisMax;
77 DbU::Unit _trackMin;
78 DbU::Unit _trackMax;
79 vector<Track*> _tracks;
80
81 protected:
82 // Constructors & Destructors.
83 RoutingPlane ( KiteEngine*, size_t depth );
84 ~RoutingPlane ();
85 private:
86 RoutingPlane ( const RoutingPlane& );
87 RoutingPlane& operator= ( const RoutingPlane& );
88 };
89
90
91 // Inline Functions.
92 inline bool RoutingPlane::TrackCompare::operator() ( Track* lhs, Track* rhs )
93 { return lhs->getAxis() > rhs->getAxis(); };
94
95 inline KiteEngine* RoutingPlane::getKiteEngine () const { return _kite; }
96 inline RoutingLayerGauge* RoutingPlane::getLayerGauge () const { return _layerGauge; }
97 inline unsigned int RoutingPlane::getDirection () const { return _flags & KbDirectionMask; }
98 inline size_t RoutingPlane::getDepth () const { return _depth; }
99 inline DbU::Unit RoutingPlane::getAxisMin () const { return _axisMin; }
100 inline DbU::Unit RoutingPlane::getAxisMax () const { return _axisMax; }
101 inline DbU::Unit RoutingPlane::getTrackMin () const { return _trackMin; }
102 inline DbU::Unit RoutingPlane::getTrackMax () const { return _trackMax; }
103 inline const Layer* RoutingPlane::getLayer () const { return getLayerGauge()->getLayer(); }
104 inline const Layer* RoutingPlane::getBlockageLayer () const { return getLayerGauge()->getBlockageLayer(); }
105 inline size_t RoutingPlane::getTracksSize () const { return _tracks.size(); }
106 inline string RoutingPlane::_getTypeName () const { return "RoutingPlane"; }
107
108 inline size_t RoutingPlane::computeTracksSize () const
109 { return _layerGauge->getTrackNumber(_axisMin,_axisMax); }
110
111 inline DbU::Unit RoutingPlane::getTrackPosition ( size_t index ) const
112 { return _layerGauge->getTrackPosition(_axisMin,index); }
113
114 inline bool RoutingPlane::isHorizontal () const
115 { return (getDirection() & KbHorizontal); }
116
117 inline bool RoutingPlane::isVertical () const
118 { return (getDirection() & KbVertical); }
119
120
121 } // Kite namespace.
122
123
124 INSPECTOR_P_SUPPORT(Kite::RoutingPlane);
125
126
127 #endif // KITE_ROUTING_PLANE_H
Kite::RoutingPlane::getDirection
unsigned int getDirection() const
Definition: RoutingPlane.h:97
Kite::RoutingPlane::isVertical
bool isVertical() const
Definition: RoutingPlane.h:117
Kite::RoutingPlane::getLayer
const Layer * getLayer() const
Definition: RoutingPlane.h:103
CRL::RoutingLayerGauge::getLayer
const Layer * getLayer() const
Kite::RoutingPlane::getBlockageLayer
const Layer * getBlockageLayer() const
Definition: RoutingPlane.h:104
Kite::RoutingPlane::getTracksSize
size_t getTracksSize() const
Definition: RoutingPlane.h:105
Kite::RoutingPlane::getBottom
RoutingPlane * getBottom() const
Definition: RoutingPlane.cpp:150
Kite::RoutingPlane::create
static RoutingPlane * create(KiteEngine *, size_t depth)
Definition: RoutingPlane.cpp:91
Hurricane::DbU::Unit
std::int64_t Unit
Kite::RoutingPlane::_check
bool _check(unsigned int &overlaps) const
Definition: RoutingPlane.cpp:174
Kite::RoutingPlane::isHorizontal
bool isHorizontal() const
Definition: RoutingPlane.h:114
CRL::RoutingLayerGauge::getTrackNumber
unsigned int getTrackNumber(DbU::Unit start, DbU::Unit stop) const
Kite::RoutingPlane::getKiteEngine
KiteEngine * getKiteEngine() const
Definition: RoutingPlane.h:95
Kite::RoutingPlane::getTrackMax
DbU::Unit getTrackMax() const
Definition: RoutingPlane.h:102
Kite::Track
Structure managing one routing track.
Definition: Track.h:42
Kite::RoutingPlane::getTrackMin
DbU::Unit getTrackMin() const
Definition: RoutingPlane.h:101
CRL::RoutingLayerGauge::getBlockageLayer
const Layer * getBlockageLayer() const
Kite::KiteEngine
The Kite Tool.
Definition: KiteEngine.h:60
Kite::RoutingPlane::getTrackPosition
DbU::Unit getTrackPosition(size_t index) const
Definition: RoutingPlane.h:111
Kite::RoutingPlane::getTrackByPosition
Track * getTrackByPosition(DbU::Unit axis, unsigned int mode=KtNearest) const
Definition: RoutingPlane.cpp:164
Kite::RoutingPlane::getAxisMin
DbU::Unit getAxisMin() const
Definition: RoutingPlane.h:99
Kite::RoutingPlane::getAxisMax
DbU::Unit getAxisMax() const
Definition: RoutingPlane.h:100
Kite::RoutingPlane::getLayerGauge
RoutingLayerGauge * getLayerGauge() const
Definition: RoutingPlane.h:96
Hurricane::Layer
Kite::RoutingPlane
Array of Tracks in one Layer.
Definition: RoutingPlane.h:34
Kite::RoutingPlane::computeTracksSize
size_t computeTracksSize() const
Definition: RoutingPlane.h:108
Kite::Track::getAxis
DbU::Unit getAxis() const
Definition: Track.h:192
Kite::RoutingPlane::getDepth
size_t getDepth() const
Definition: RoutingPlane.h:98
Kite::KtNearest
Definition: Constants.h:41
Kite
The namespace dedicated to Kite.
Definition: Constants.h:22
Kite::RoutingPlane::getTop
RoutingPlane * getTop() const
Definition: RoutingPlane.cpp:146
Kite::RoutingPlane::getTrackByIndex
Track * getTrackByIndex(size_t index) const
Definition: RoutingPlane.cpp:157
CRL::RoutingLayerGauge