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  public:
48  typedef Component Inherit;
49  static const uint32_t BiggestArea = (1 << 0);
50  static const uint32_t HighestLayer = (1 << 1);
51  static const uint32_t LowestLayer = (1 << 2);
52  static const uint32_t ShowWarning = (1 << 3);
53  static const uint32_t IsOnSegment = (1 << 4);
54  static const uint32_t IsOnPad = (1 << 5);
56  static const uint32_t HSmall = (1 << 6);
57  static const uint32_t VSmall = (1 << 7);
58  static const uint32_t Punctual = (1 << 8);
59  static const uint32_t M1Offgrid = (1 << 9);
60  static const uint32_t UserCenter = (1 << 10);
61  static const uint32_t SizeFlags = HSmall|VSmall|Punctual|M1Offgrid;
62  static const uint32_t SelectedComponent = (1 << 10);
63  public:
64  static RoutingPad* create ( Net*, Occurrence, uint32_t flags=0 );
65  static RoutingPad* create ( Pin* );
66  public:
67  // Accessors.
68  bool isPlacedOccurrence ( uint32_t flags ) const;
69  inline bool isAtTopLevel () const;
70  inline bool isHSmall () const;
71  inline bool isVSmall () const;
72  inline bool isPunctual () const;
73  inline bool isM1Offgrid () const;
74  inline bool hasUserCenter () const;
75  inline bool hasSelectedComponent () const;
76  inline Point getUserCenter () const;
77  inline uint32_t getFlags () const;
78  inline Occurrence getOccurrence () const;
80  virtual const Layer* getLayer () const;
81  virtual DbU::Unit getX () const;
82  virtual DbU::Unit getY () const;
83  virtual Box getBoundingBox () const;
84  virtual Box getBoundingBox ( const BasicLayer* ) const;
85  virtual Point getCenter () const;
86  virtual Point getPosition () const;
93  std::string getStringFlags () const;
94  // Mutators.
95  virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy );
97  Component* setOnBestComponent ( uint32_t flags );
98  inline void setUserCenter ( const Point& );
100  inline void setFlags ( uint32_t );
101  inline void unsetFlags ( uint32_t );
102  // Miscellaeous.
103  template<typename T>
104  T* _getEntityAs () const;
105  virtual void _toJson ( JsonWriter* ) const;
106  virtual std::string _getTypeName () const {return _TName("RoutingPad");};
107  virtual std::string _getString () const;
108  virtual Record* _getRecord () const;
109  protected:
110  virtual void _postCreate ();
111  virtual void _preDestroy ();
112  private:
113  RoutingPad ( Net*, Occurrence occurrence=Occurrence() );
114  private:
115  // Attributes.
116  Occurrence _occurrence;
117  uint32_t _flags;
118  Point _userCenter;
119  };
120 
121 
122  inline bool RoutingPad::isAtTopLevel () const { return _occurrence.getPath().isEmpty(); }
123  inline bool RoutingPad::isHSmall () const { return (_flags & HSmall); }
124  inline bool RoutingPad::isVSmall () const { return (_flags & VSmall); }
125  inline bool RoutingPad::isPunctual () const { return (_flags & Punctual); }
126  inline bool RoutingPad::isM1Offgrid () const { return (_flags & M1Offgrid); }
127  inline bool RoutingPad::hasSelectedComponent () const { return (_flags & SelectedComponent); }
128  inline bool RoutingPad::hasUserCenter () const { return (_flags & UserCenter); }
129  inline Point RoutingPad::getUserCenter () const { return (hasUserCenter()) ? _userCenter : getCenter(); }
130  inline uint32_t RoutingPad::getFlags () const { return _flags; }
131  inline Occurrence RoutingPad::getOccurrence () const { return _occurrence; };
132  inline void RoutingPad::setFlags ( uint32_t flags ) { _flags |= flags; }
133  inline void RoutingPad::unsetFlags ( uint32_t flags ) { _flags &= ~flags; }
134  inline void RoutingPad::setUserCenter ( const Point& center ) { _flags |= UserCenter; _userCenter = center; }
135 
136 
137  template<typename T>
138  inline T* RoutingPad::_getEntityAs () const
139  {
140  if (not _occurrence.isValid()) return nullptr;
141  return dynamic_cast<T*>( _occurrence.getEntity() );
142  }
143 
144 
145 // -------------------------------------------------------------------
146 // Class : "JsonRoutingPad".
147 
148  class JsonRoutingPad : public JsonComponent {
149  public:
150  static void initialize ();
151  JsonRoutingPad ( unsigned long flags );
152  virtual std::string getTypeName () const;
153  virtual JsonRoutingPad* clone ( unsigned long flags ) const;
154  virtual void toData ( JsonStack& );
155  };
156 
157 } // End of Hurricane namespace.
158 
159 
160 INSPECTOR_P_SUPPORT(Hurricane::RoutingPad);
BasicLayer description (API)
Definition: BasicLayer.h:42
Box description (API)
Definition: Box.h:29
Component description (API)
Definition: Component.h:43
std::int64_t Unit
Definition: DbU.h:67
Layer description (API)
Definition: Layer.h:50
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:51
static RoutingPad * create(Pin *)
Occurrence getOccurrence() const
Definition: RoutingPad.h:131
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:48
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:50
static const uint32_t ShowWarning
Definition: RoutingPad.h:52
void setExternalComponent(Component *)
static const uint32_t ComponentSelection
Definition: RoutingPad.h:55
Point getSourcePosition() const
virtual Point getCenter() const
static const uint32_t BiggestArea
Definition: RoutingPad.h:49
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 Wed Nov 20 2024 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved