# Hurricane Documentation

# 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 #ifndef HURRICANE_ROUTINGPAD_H
33 #define HURRICANE_ROUTINGPAD_H
34
35 #include "hurricane/Component.h"
36 #include "hurricane/Occurrence.h"
37 #include "hurricane/Pin.h"
38
39
40 namespace Hurricane {
41
42 class Segment;
43
44
45 // -------------------------------------------------------------------
46 // Class : "RoutingPad".
47
48 class RoutingPad : public Component {
49 public:
50 typedef Component Inherit;
51 enum Flags { BiggestArea = (1 << 0)
52 , HighestLayer = (1 << 1)
53 , LowestLayer = (1 << 2)
54 , ComponentSelection= BiggestArea|HighestLayer|LowestLayer
55 , ShowWarning = (1 << 4)
56 };
57 public:
58 static RoutingPad* create ( Net*, Occurrence, unsigned int flags=0 );
59 static RoutingPad* create ( Pin* );
60 public:
61 // Accessors.
62 bool isPlacedOccurrence ( unsigned int flags ) const;
63 inline bool isAtTopLevel () const;
64 inline Occurrence getOccurrence () const;
65 Occurrence getPlugOccurrence ();
66 virtual const Layer* getLayer () const;
67 virtual DbU::Unit getX () const;
68 virtual DbU::Unit getY () const;
69 virtual Box getBoundingBox () const;
70 virtual Box getBoundingBox ( const BasicLayer* ) const;
71 virtual Point getCenter () const;
72 virtual Point getPosition () const;
73 Point getSourcePosition () const;
74 Point getTargetPosition () const;
75 DbU::Unit getSourceX () const;
76 DbU::Unit getSourceY () const;
77 DbU::Unit getTargetX () const;
78 DbU::Unit getTargetY () const;
79 // Mutators.
80 virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy );
81 void setExternalComponent ( Component* );
82 Component* setOnBestComponent ( unsigned int flags );
83 void restorePlugOccurrence ();
84 // Miscellaeous.
85 Component* _getEntityAsComponent () const;
86 Segment* _getEntityAsSegment () const;
87 virtual void _toJson ( JsonWriter* ) const;
88 virtual std::string _getTypeName () const {return _TName("RoutingPad");};
89 virtual std::string _getString () const;
90 virtual Record* _getRecord () const;
91 protected:
92 virtual void _postCreate ();
93 virtual void _preDestroy ();
94 private:
95 RoutingPad ( Net*, Occurrence occurrence=Occurrence() );
96 private:
97 // Attributes.
98 Occurrence _occurrence;
99 };
100
101
102 inline bool RoutingPad::isAtTopLevel () const { return _occurrence.getPath().isEmpty(); }
103 inline Occurrence RoutingPad::getOccurrence () const { return _occurrence; };
104
105
106 // -------------------------------------------------------------------
107 // Class : "JsonRoutingPad".
108
109 class JsonRoutingPad : public JsonComponent {
110 public:
111 static void initialize ();
112 JsonRoutingPad ( unsigned long flags );
113 virtual std::string getTypeName () const;
114 virtual JsonRoutingPad* clone ( unsigned long flags ) const;
115 virtual void toData ( JsonStack& );
116 };
117
118 } // End of Hurricane namespace.
119
120
121 INSPECTOR_P_SUPPORT(Hurricane::RoutingPad);
122
123 #endif // HURRICANE_ROUTINGPAD_H
Hurricane::Occurrence
Occurrence description (API)
Definition: Occurrence.h:39
Hurricane::RoutingPad::ComponentSelection
Definition: RoutingPad.h:54
Hurricane::RoutingPad::getTargetY
DbU::Unit getTargetY() const
Hurricane::BasicLayer
BasicLayer description (API)
Definition: BasicLayer.h:44
Hurricane::RoutingPad::getX
virtual DbU::Unit getX() const
Hurricane::RoutingPad::ShowWarning
Definition: RoutingPad.h:55
Hurricane::Pin
Pin description (API)
Definition: Pin.h:34
Hurricane::RoutingPad::getSourceY
DbU::Unit getSourceY() const
Hurricane::RoutingPad::getY
virtual DbU::Unit getY() const
Hurricane::Component
Component description (API)
Definition: Component.h:42
Hurricane::RoutingPad::LowestLayer
Definition: RoutingPad.h:53
Hurricane::RoutingPad::Flags
Flags
Definition: RoutingPad.h:51
Hurricane::DbU::Unit
std::int64_t Unit
Definition: DbU.h:70
Hurricane::Point
Point description (API)
Definition: Point.h:32
Hurricane::RoutingPad::getLayer
virtual const Layer * getLayer() const
Hurricane::Path::isEmpty
bool isEmpty() const
Hurricane::JsonStack
JSON Parser Stack.
Definition: JsonObject.h:249
Hurricane::RoutingPad::getTargetPosition
Point getTargetPosition() const
Hurricane::RoutingPad::create
static RoutingPad * create(Net *, Occurrence, unsigned int flags=0)
Hurricane::Box
Box description (API)
Definition: Box.h:31
Hurricane::RoutingPad::getSourceX
DbU::Unit getSourceX() const
Hurricane::RoutingPad::getCenter
virtual Point getCenter() const
Hurricane::RoutingPad::setOnBestComponent
Component * setOnBestComponent(unsigned int flags)
Hurricane::RoutingPad::BiggestArea
Definition: RoutingPad.h:51
Hurricane::RoutingPad::isPlacedOccurrence
bool isPlacedOccurrence(unsigned int flags) const
Hurricane::Layer
Layer description (API)
Definition: Layer.h:52
Hurricane::Segment
Segment description (API)
Definition: Segment.h:33
Hurricane::RoutingPad::translate
virtual void translate(const DbU::Unit &dx, const DbU::Unit &dy)
Hurricane::RoutingPad::HighestLayer
Definition: RoutingPad.h:52
Hurricane::RoutingPad::getPlugOccurrence
Occurrence getPlugOccurrence()
Hurricane::RoutingPad::getTargetX
DbU::Unit getTargetX() const
Hurricane::RoutingPad::getSourcePosition
Point getSourcePosition() const
Hurricane::RoutingPad::setExternalComponent
void setExternalComponent(Component *)
Hurricane::RoutingPad::Inherit
Component Inherit
Definition: RoutingPad.h:50
Hurricane
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5
Hurricane::RoutingPad::restorePlugOccurrence
void restorePlugOccurrence()
Hurricane::RoutingPad::getOccurrence
Occurrence getOccurrence() const
Definition: RoutingPad.h:103
Hurricane::Occurrence::getPath
Path getPath() const
Definition: Occurrence.h:69
Hurricane::RoutingPad::getBoundingBox
virtual Box getBoundingBox() const
Hurricane::Net
Net description (API)
Definition: Net.h:48
Hurricane::RoutingPad
RoutingPad description (API)
Definition: RoutingPad.h:48