Hurricane VLSI Database


RoutingPad.h
1 // -*- C++ -*-
2 //
3 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
4 //
5 // This file is part of Hurricane.
6 //
7 // Hurricane is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Lesser General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
11 //
12 // Hurricane is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
14 // TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the Lesser GNU General Public
18 // License along with Hurricane. If not, see
19 // <http://www.gnu.org/licenses/>.
20 //
21 // +-----------------------------------------------------------------+
22 // | H U R R I C A N E |
23 // | V L S I B a c k e n d D a t a - B a s e |
24 // | |
25 // | Authors : Hugo Clement & Marek Sroka |
26 // | E-mail : Jean-Paul.Chaput@lip6.fr |
27 // | =============================================================== |
28 // | C++ Header : "./hurricane/RoutingPad.h" |
29 // +-----------------------------------------------------------------+
30 
31 
32 #pragma once
33 #include "hurricane/Component.h"
34 #include "hurricane/Occurrence.h"
35 #include "hurricane/Pin.h"
36 
37 
38 namespace Hurricane {
39 
40  class Segment;
41 
42 
43 // -------------------------------------------------------------------
44 // Class : "RoutingPad".
45 
46  class RoutingPad : public Component {
47  private:
48  static FastRTTI _fastRTTI;
49  public:
50  static inline const FastRTTI& fastRTTI ();
51  virtual const FastRTTI& vfastRTTI () const;
52  public:
53  typedef Component Inherit;
54  static const uint32_t BiggestArea = (1 << 0);
55  static const uint32_t HighestLayer = (1 << 1);
56  static const uint32_t LowestLayer = (1 << 2);
57  static const uint32_t ShowWarning = (1 << 3);
58  static const uint32_t IsOnSegment = (1 << 4);
59  static const uint32_t IsOnPad = (1 << 5);
61  static const uint32_t HSmall = (1 << 6);
62  static const uint32_t VSmall = (1 << 7);
63  static const uint32_t VLarge = (1 << 8);
64  static const uint32_t Punctual = (1 << 9);
65  static const uint32_t M1Offgrid = (1 << 10);
66  static const uint32_t UserCenter = (1 << 11);
67  static const uint32_t SizeFlags = HSmall|VSmall|VLarge|Punctual|M1Offgrid;
68  static const uint32_t SelectedComponent = (1 << 11);
69  static const uint32_t RotateBottomMetal = (1 << 12);
70  public:
71  static RoutingPad* create ( Net*, Occurrence, uint32_t flags=0 );
72  static RoutingPad* create ( Pin* );
73  public:
74  // Accessors.
75  bool isPlacedOccurrence ( uint32_t flags ) const;
76  inline bool isAtTopLevel () const;
77  inline bool isHSmall () const;
78  inline bool isVSmall () const;
79  inline bool isVLarge () const;
80  inline bool isPunctual () const;
81  inline bool isM1Offgrid () const;
82  inline bool rotateBottomMetal () const;
83  inline bool hasUserCenter () const;
84  inline bool hasSelectedComponent () const;
85  inline Point getUserCenter () const;
86  inline uint32_t getFlags () const;
87  inline Occurrence getOccurrence () const;
89  virtual const Layer* getLayer () const;
90  virtual DbU::Unit getX () const;
91  virtual DbU::Unit getY () const;
92  virtual Box getBoundingBox () const;
93  virtual Box getBoundingBox ( const BasicLayer* ) const;
94  virtual Point getCenter () const;
95  virtual Point getPosition () const;
102  std::string getStringFlags () const;
103  // Mutators.
104  virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy );
106  Component* setOnBestComponent ( uint32_t flags );
107  inline void setUserCenter ( const Point& );
109  inline void setFlags ( uint32_t );
110  inline void unsetFlags ( uint32_t );
111  // Miscellaeous.
112  template<typename T>
113  T* _getEntityAs () const;
114  virtual void _toJson ( JsonWriter* ) const;
115  virtual std::string _getTypeName () const {return _TName("RoutingPad");};
116  virtual std::string _getString () const;
117  virtual Record* _getRecord () const;
118  protected:
119  virtual void _postCreate ();
120  virtual void _preDestroy ();
121  private:
122  RoutingPad ( Net*, Occurrence occurrence=Occurrence() );
123  private:
124  // Attributes.
125  Occurrence _occurrence;
126  uint32_t _flags;
127  Point _userCenter;
128  };
129 
130 
131  inline const FastRTTI& RoutingPad::fastRTTI () { return _fastRTTI; }
132 
133 
134  inline bool RoutingPad::isAtTopLevel () const { return _occurrence.getPath().isEmpty(); }
135  inline bool RoutingPad::isHSmall () const { return (_flags & HSmall); }
136  inline bool RoutingPad::isVSmall () const { return (_flags & VSmall); }
137  inline bool RoutingPad::isVLarge () const { return (_flags & VLarge); }
138  inline bool RoutingPad::isPunctual () const { return (_flags & Punctual); }
139  inline bool RoutingPad::isM1Offgrid () const { return (_flags & M1Offgrid); }
140  inline bool RoutingPad::rotateBottomMetal () const { return (_flags & RotateBottomMetal); }
141  inline bool RoutingPad::hasSelectedComponent () const { return (_flags & SelectedComponent); }
142  inline bool RoutingPad::hasUserCenter () const { return (_flags & UserCenter); }
143  inline Point RoutingPad::getUserCenter () const { return (hasUserCenter()) ? _userCenter : getCenter(); }
144  inline uint32_t RoutingPad::getFlags () const { return _flags; }
145  inline Occurrence RoutingPad::getOccurrence () const { return _occurrence; };
146  inline void RoutingPad::setFlags ( uint32_t flags ) { _flags |= flags; }
147  inline void RoutingPad::unsetFlags ( uint32_t flags ) { _flags &= ~flags; }
148  inline void RoutingPad::setUserCenter ( const Point& center ) { _flags |= UserCenter; _userCenter = center; }
149 
150 
151  template<typename T>
152  inline T* RoutingPad::_getEntityAs () const
153  {
154  if (not _occurrence.isValid()) return nullptr;
155  return dynamic_cast<T*>( _occurrence.getEntity() );
156  }
157 
158 
159 // -------------------------------------------------------------------
160 // Class : "JsonRoutingPad".
161 
162  class JsonRoutingPad : public JsonComponent {
163  public:
164  static void initialize ();
165  JsonRoutingPad ( unsigned long flags );
166  virtual std::string getTypeName () const;
167  virtual JsonRoutingPad* clone ( unsigned long flags ) const;
168  virtual void toData ( JsonStack& );
169  };
170 
171 } // End of Hurricane namespace.
172 
173 
174 INSPECTOR_P_SUPPORT(Hurricane::RoutingPad);
BasicLayer description (API)
Definition: BasicLayer.h:42
Box description (API)
Definition: Box.h:30
Component description (API)
Definition: Component.h:43
std::int64_t Unit
Definition: DbU.h:67
Layer description (API)
Definition: Layer.h:120
Net description (API)
Definition: Net.h:46
Occurrence description (API)
Definition: Occurrence.h:39
Entity * getEntity() const
Definition: Occurrence.h:68
bool isValid() const
Definition: Occurrence.h:81
Path getPath() const
Definition: Occurrence.h:69
bool isEmpty() const
Pin description (API)
Definition: Pin.h:41
Point description (API)
Definition: Point.h:30
RoutingPad description (API)
Definition: RoutingPad.h:46
static const uint32_t LowestLayer
Definition: RoutingPad.h:56
static RoutingPad * create(Pin *)
Occurrence getOccurrence() const
Definition: RoutingPad.h:145
virtual Box getBoundingBox() const
Occurrence getPlugOccurrence()
DbU::Unit getTargetX() const
DbU::Unit getTargetY() const
virtual void translate(const DbU::Unit &dx, const DbU::Unit &dy)
Component Inherit
Definition: RoutingPad.h:53
virtual DbU::Unit getX() const
DbU::Unit getSourceY() const
bool isPlacedOccurrence(uint32_t flags) const
virtual const Layer * getLayer() const
Point getTargetPosition() const
static const uint32_t HighestLayer
Definition: RoutingPad.h:55
static const uint32_t ShowWarning
Definition: RoutingPad.h:57
void setExternalComponent(Component *)
static const uint32_t ComponentSelection
Definition: RoutingPad.h:60
Point getSourcePosition() const
virtual Point getCenter() const
static const uint32_t BiggestArea
Definition: RoutingPad.h:54
DbU::Unit getSourceX() const
virtual DbU::Unit getY() const
Component * setOnBestComponent(uint32_t flags)
Contains Almost Everything.
Definition: BasicLayer.h:39


Generated by doxygen 1.9.1 on Sun Dec 14 2025 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved