Kite - Detailed Router


DataNegociate.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@lip6.fr |
12 // | =============================================================== |
13 // | C++ Header : "./kite/DataNegociate.h" |
14 // +-----------------------------------------------------------------+
15 
16 
17 #ifndef KITE_DATA_NEGOCIATE_H
18 #define KITE_DATA_NEGOCIATE_H
19 
20 #include <string>
21 #include <iostream>
22 
23 namespace Hurricane {
24  class Record;
25 }
26 
27 #include "kite/TrackElement.h"
28 namespace Katabatic {
29  class AutoSegment;
30 }
31 
32 
33 namespace Kite {
34 
35  using std::string;
36  using std::cerr;
37  using std::endl;
38  using Hurricane::Record;
40 
41  class Track;
42  class TrackElement;
43  class RoutingEvent;
44 
45 
46 // -------------------------------------------------------------------
47 // Class : "DataNegociate".
48 
49 
50  class DataNegociate {
51  public:
53  , Minimize = 2
54  , Dogleg = 3
55  , Slacken = 4
59  , MoveUp = 8
62  , Repair =11
63  };
64  public:
66  ~DataNegociate ();
67  inline bool hasRoutingEvent () const;
68  inline RoutingEvent* getRoutingEvent () const;
69  inline TrackElement* getTrackSegment () const;
70  inline TrackElement* getChildSegment () const;
71  inline Track* getTrack () const;
72  inline DbU::Unit getLeftMinExtend () const;
73  inline DbU::Unit getRightMinExtend () const;
74  inline unsigned int getTerminals () const;
75  inline Net* getNet () const;
76  inline unsigned int getState () const;
77  inline unsigned int getStateCount () const;
78  inline unsigned int getRipupCount () const;
79  inline unsigned int getStateAndRipupCount () const;
80  DbU::Unit getWiringDelta ( DbU::Unit axis ) const;
81  inline const vector<TrackElement*>& getPerpandiculars () const;
82  inline const Interval& getPerpandicularFree () const;
83  inline void setState ( unsigned int, unsigned int flags=0 );
84  inline void setRoutingEvent ( RoutingEvent* );
85  inline void setChildSegment ( TrackElement* );
86  inline void setRipupCount ( unsigned int );
87  inline void incRipupCount ();
88  inline void decRipupCount ();
89  inline void resetRipupCount ();
90  inline void resetStateCount ();
91  void update ();
92  static string getStateString ( DataNegociate* );
93  Record* _getRecord () const;
94  string _getString () const;
95  inline string _getTypeName () const;
96  protected:
97  // Attributes.
98  TrackElement* _trackSegment;
99  TrackElement* _childSegment;
100  RoutingEvent* _routingEvent;
101  Net* _net;
102  unsigned int _state : 5;
103  unsigned int _stateCount : 5;
104  unsigned int _terminals : 5;
105  unsigned int _ripupCount : 16;
106  DbU::Unit _leftMinExtend;
107  DbU::Unit _rightMinExtend;
108  vector<DbU::Unit> _attractors;
109  vector<TrackElement*> _perpandiculars;
110  Interval _perpandicularFree;
111  Interval _reduceRanges[2];
112  private:
113  DataNegociate ( const DataNegociate& );
114  DataNegociate& operator= ( const DataNegociate& );
115  };
116 
117 
118 // Inline Functions.
119  inline bool DataNegociate::hasRoutingEvent () const { return _routingEvent != NULL; }
120  inline RoutingEvent* DataNegociate::getRoutingEvent () const { return _routingEvent; }
121  inline TrackElement* DataNegociate::getTrackSegment () const { return _trackSegment; }
122  inline TrackElement* DataNegociate::getChildSegment () const { return _childSegment; }
123  inline Track* DataNegociate::getTrack () const { return _trackSegment->getTrack(); }
124  inline unsigned int DataNegociate::getState () const { return _state; }
125  inline unsigned int DataNegociate::getTerminals () const { return _terminals; }
126  inline unsigned int DataNegociate::getRipupCount () const { return _ripupCount; }
127  inline DbU::Unit DataNegociate::getLeftMinExtend () const { return _leftMinExtend; }
128  inline DbU::Unit DataNegociate::getRightMinExtend () const { return _rightMinExtend; }
129  inline Net* DataNegociate::getNet () const { return _net; }
130  inline const vector<TrackElement*>& DataNegociate::getPerpandiculars () const { return _perpandiculars; }
131  inline const Interval& DataNegociate::getPerpandicularFree () const { return _perpandicularFree; }
132  inline unsigned int DataNegociate::getStateCount () const { return _stateCount; }
133  inline void DataNegociate::resetStateCount () { _stateCount=0; }
134  inline void DataNegociate::setRoutingEvent ( RoutingEvent* event ) { _routingEvent = event; }
135  inline void DataNegociate::setChildSegment ( TrackElement* child ) { _childSegment = child; }
136  inline void DataNegociate::setRipupCount ( unsigned int count ) { _ripupCount = count; }
137  inline void DataNegociate::incRipupCount () { _ripupCount++; }
138  inline void DataNegociate::decRipupCount () { if (_ripupCount) _ripupCount--; }
139  inline void DataNegociate::resetRipupCount () { _ripupCount = 0; }
140  inline string DataNegociate::_getTypeName () const { return "DataNegociate"; }
141 
142  inline void DataNegociate::setState ( unsigned int state, unsigned int flags )
143  {
144  if ( (_state != state) or (flags & KtResetCount) ) {
145  //std::cerr << "Changing state to:" << state << std::endl;
146  _state = state;
147  _stateCount = 1;
148  } else
149  _stateCount++;
150  }
151 
152  inline unsigned int DataNegociate::getStateAndRipupCount () const
153  { return (_state << 4) + _ripupCount; }
154 
155 
156 } // Kite namespace.
157 
158 #endif // KITE_DATA_NEGOCIATE_H
Atomic Placement Request for a TrackSegment.
Definition: RoutingEvent.h:55
Definition: DataNegociate.h:60
TrackElement * getTrackSegment() const
Definition: DataNegociate.h:121
SlackState
Definition: DataNegociate.h:52
unsigned int getRipupCount() const
Definition: DataNegociate.h:126
Definition: DataNegociate.h:57
void setState(unsigned int, unsigned int flags=0)
Definition: DataNegociate.h:142
void decRipupCount()
Definition: DataNegociate.h:138
void setRipupCount(unsigned int)
Definition: DataNegociate.h:136
Definition: DataNegociate.h:52
std::int64_t Unit
unsigned int getStateCount() const
Definition: DataNegociate.h:132
bool hasRoutingEvent() const
Definition: DataNegociate.h:119
unsigned int getTerminals() const
Definition: DataNegociate.h:125
void setRoutingEvent(RoutingEvent *)
Definition: DataNegociate.h:134
unsigned int getStateAndRipupCount() const
Definition: DataNegociate.h:152
Definition: DataNegociate.h:56
Net * getNet() const
Definition: DataNegociate.h:129
Structure managing one routing track.
Definition: Track.h:42
Definition: DataNegociate.h:62
Definition: Constants.h:43
void resetStateCount()
Definition: DataNegociate.h:133
RoutingEvent * getRoutingEvent() const
Definition: DataNegociate.h:120
DbU::Unit getWiringDelta(DbU::Unit axis) const
Definition: DataNegociate.cpp:67
unsigned int getState() const
Definition: DataNegociate.h:124
DbU::Unit getLeftMinExtend() const
Definition: DataNegociate.h:127
void update()
Definition: DataNegociate.cpp:82
Definition: DataNegociate.h:54
Definition: DataNegociate.h:59
const Interval & getPerpandicularFree() const
Definition: DataNegociate.h:131
void incRipupCount()
Definition: DataNegociate.h:137
Abstract Class for all Elements inserted inside a Track.
Definition: TrackElement.h:100
Definition: DataNegociate.h:55
Track * getTrack() const
Definition: DataNegociate.h:123
Definition: DataNegociate.h:61
Definition: DataNegociate.h:53
Track * getTrack() const
Definition: TrackElement.h:238
The namespace dedicated to Kite.
Definition: Constants.h:22
DbU::Unit getRightMinExtend() const
Definition: DataNegociate.h:128
Definition: DataNegociate.h:58
Algorimthmic datas associated the TrackSegment.
Definition: DataNegociate.h:50
void resetRipupCount()
Definition: DataNegociate.h:139


Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
Kite - Detailed Router Copyright © 2008-2016 UPMC. All rights reserved