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
38namespace Hurricane {
39
40 class Segment;
41
42
43// -------------------------------------------------------------------
44// Class : "RoutingPad".
45
46 class RoutingPad : public Component {
47 public:
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 VLarge = (1 << 8);
59 static const uint32_t Punctual = (1 << 9);
60 static const uint32_t M1Offgrid = (1 << 10);
61 static const uint32_t UserCenter = (1 << 11);
62 static const uint32_t SizeFlags = HSmall|VSmall|VLarge|Punctual|M1Offgrid;
63 static const uint32_t SelectedComponent = (1 << 11);
64 static const uint32_t RotateBottomMetal = (1 << 12);
65 public:
66 static RoutingPad* create ( Net*, Occurrence, uint32_t flags=0 );
67 static RoutingPad* create ( Pin* );
68 public:
69 // Accessors.
70 bool isPlacedOccurrence ( uint32_t flags ) const;
71 inline bool isAtTopLevel () const;
72 inline bool isHSmall () const;
73 inline bool isVSmall () const;
74 inline bool isVLarge () const;
75 inline bool isPunctual () const;
76 inline bool isM1Offgrid () const;
77 inline bool rotateBottomMetal () const;
78 inline bool hasUserCenter () const;
79 inline bool hasSelectedComponent () const;
80 inline Point getUserCenter () const;
81 inline uint32_t getFlags () const;
82 inline Occurrence getOccurrence () const;
84 virtual const Layer* getLayer () const;
85 virtual DbU::Unit getX () const;
86 virtual DbU::Unit getY () const;
87 virtual Box getBoundingBox () const;
88 virtual Box getBoundingBox ( const BasicLayer* ) const;
89 virtual Point getCenter () const;
90 virtual Point getPosition () const;
97 std::string getStringFlags () const;
98 // Mutators.
99 virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy );
102 inline void setUserCenter ( const Point& );
104 inline void setFlags ( uint32_t );
105 inline void unsetFlags ( uint32_t );
106 // Miscellaeous.
107 template<typename T>
108 T* _getEntityAs () const;
109 virtual void _toJson ( JsonWriter* ) const;
110 virtual std::string _getTypeName () const {return _TName("RoutingPad");};
111 virtual std::string _getString () const;
112 virtual Record* _getRecord () const;
113 protected:
114 virtual void _postCreate ();
115 virtual void _preDestroy ();
116 private:
118 private:
119 // Attributes.
120 Occurrence _occurrence;
121 uint32_t _flags;
122 Point _userCenter;
123 };
124
125
126 inline bool RoutingPad::isAtTopLevel () const { return _occurrence.getPath().isEmpty(); }
127 inline bool RoutingPad::isHSmall () const { return (_flags & HSmall); }
128 inline bool RoutingPad::isVSmall () const { return (_flags & VSmall); }
129 inline bool RoutingPad::isVLarge () const { return (_flags & VLarge); }
130 inline bool RoutingPad::isPunctual () const { return (_flags & Punctual); }
131 inline bool RoutingPad::isM1Offgrid () const { return (_flags & M1Offgrid); }
132 inline bool RoutingPad::rotateBottomMetal () const { return (_flags & RotateBottomMetal); }
133 inline bool RoutingPad::hasSelectedComponent () const { return (_flags & SelectedComponent); }
134 inline bool RoutingPad::hasUserCenter () const { return (_flags & UserCenter); }
135 inline Point RoutingPad::getUserCenter () const { return (hasUserCenter()) ? _userCenter : getCenter(); }
136 inline uint32_t RoutingPad::getFlags () const { return _flags; }
137 inline Occurrence RoutingPad::getOccurrence () const { return _occurrence; };
138 inline void RoutingPad::setFlags ( uint32_t flags ) { _flags |= flags; }
139 inline void RoutingPad::unsetFlags ( uint32_t flags ) { _flags &= ~flags; }
140 inline void RoutingPad::setUserCenter ( const Point& center ) { _flags |= UserCenter; _userCenter = center; }
141
142
143 template<typename T>
144 inline T* RoutingPad::_getEntityAs () const
145 {
146 if (not _occurrence.isValid()) return nullptr;
147 return dynamic_cast<T*>( _occurrence.getEntity() );
148 }
149
150
151// -------------------------------------------------------------------
152// Class : "JsonRoutingPad".
153
154 class JsonRoutingPad : public JsonComponent {
155 public:
156 static void initialize ();
157 JsonRoutingPad ( unsigned long flags );
158 virtual std::string getTypeName () const;
159 virtual JsonRoutingPad* clone ( unsigned long flags ) const;
160 virtual void toData ( JsonStack& );
161 };
162
163} // End of Hurricane namespace.
164
165
166INSPECTOR_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
Generic Collection auto-pointer.
Definition Collection.h:235
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:51
static RoutingPad * create(Pin *)
Occurrence getOccurrence() const
Definition RoutingPad.h:137
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.10.0 on Fri Sep 27 2024 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved