Hurricane VLSI Database


Contact.h
1 // -*- C++ -*-
2 //
3 // Copyright (c) BULL S.A. 2000-2020, 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 // | Author : Remy Escassut |
26 // | E-mail : Jean-Paul.Chaput@lip6.fr |
27 // | =============================================================== |
28 // | C++ Header : "./hurricane/Commons.h" |
29 // +-----------------------------------------------------------------+
30 
31 
32 #pragma once
33 #include "hurricane/Component.h"
34 #include "hurricane/Contacts.h"
35 
36 
37 namespace Hurricane {
38 
39 
40 // -------------------------------------------------------------------
41 // Class : "Hurricane::Contact".
42 
43  class Contact : public Component {
44  private:
45  static FastRTTI _fastRTTI;
46  public:
47  static inline const FastRTTI& fastRTTI ();
48  virtual const FastRTTI& vfastRTTI () const;
49  public:
50  typedef Component Inherit;
51  const uint64_t NoFlags = 0;
52  const uint64_t RotateTopMetal = (1 << 0);
53  const uint64_t RotateBottomMetal = (1 << 1);
54  const uint64_t AllRotate = RotateTopMetal|RotateBottomMetal;
55  public:
56  class AnchorHook : public Hook {
57  friend class Contact;
58  public:
59  typedef Hook Inherit;
60  private:
61  AnchorHook ( Contact* );
62  public:
63  virtual Component* getComponent () const;
64  virtual bool isMaster () const { return false; };
65  virtual std::string _getTypeName () const { return "Contact::AnchorHook"; };
66  virtual std::string _getString () const;
67  static Hook* _compToHook ( Component* );
68  };
69 
70  protected:
71  Contact ( Net* net
72  , const Layer* layer
73  , DbU::Unit x
74  , DbU::Unit y
75  , DbU::Unit width
76  , DbU::Unit height
77  );
78  Contact ( Net* net
79  , Component* anchor
80  , const Layer* layer
81  , DbU::Unit dx
82  , DbU::Unit dy
83  , DbU::Unit width
84  , DbU::Unit height
85  );
86  public:
87  static inline void enableCheckMinSize ();
88  static inline void disableCheckMinSize ();
89  static Contact* create ( Net* net
90  , const Layer* layer
91  , DbU::Unit x
92  , DbU::Unit y
93  , DbU::Unit width =0
94  , DbU::Unit height=0
95  );
96  static Contact* create ( Component* anchor
97  , const Layer* layer
98  , DbU::Unit dx
99  , DbU::Unit dy
100  , DbU::Unit width =0
101  , DbU::Unit height=0
102  );
103  public:
104  inline bool isRotatedTopMetal () const;
105  inline bool isRotatedBottomMetal () const;
106  virtual Hooks getHooks () const;
107  virtual DbU::Unit getX () const;
108  virtual DbU::Unit getY () const;
109  virtual Point getPosition () const;
110  virtual Box getBoundingBox () const;
111  virtual const Layer* getLayer () const {return _layer;};
112  virtual Box getBoundingBox ( const BasicLayer* ) const;
113  Hook* getAnchorHook () { return &_anchorHook; };
114  Component* getAnchor () const;
115  DbU::Unit getDx () const { return _dx; };
116  DbU::Unit getDy () const { return _dy; };
117  DbU::Unit getWidth () const { return _width; };
118  DbU::Unit getHalfWidth () const { return (_width / 2); };
119  DbU::Unit getHeight () const { return _height; };
120  DbU::Unit getHalfHeight () const { return (_height / 2); };
121  public:
122  virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy );
123  void setLayer ( const Layer* );
124  void setWidth ( DbU::Unit );
126  void setSizes ( DbU::Unit width, DbU::Unit height);
127  void setX ( DbU::Unit );
128  void setY ( DbU::Unit );
130  void setPosition ( const Point& );
131  void setDx ( DbU::Unit );
132  void setDy ( DbU::Unit );
133  void setOffset ( DbU::Unit dx, DbU::Unit dy);
134  inline void setRotatedTopMetal ( bool state );
135  inline void setRotatedBottomMetal ( bool state );
136  private:
137  bool _postCheck ();
138  protected:
139  virtual void _preDestroy ();
140  public:
141  virtual void _toJson ( JsonWriter* ) const;
142  virtual std::string _getTypeName () const { return _TName("Contact"); };
143  virtual std::string _getString () const;
144  virtual Record* _getRecord () const;
145  private:
146  static bool _checkMinSize;
147  AnchorHook _anchorHook;
148  const Layer* _layer;
149  uint64_t _flags;
150  DbU::Unit _dx;
151  DbU::Unit _dy;
152  protected:
153  DbU::Unit _width;
154  DbU::Unit _height;
155  };
156 
157 
158  inline const FastRTTI& Contact::fastRTTI () { return _fastRTTI; }
159 
160  inline void Contact::enableCheckMinSize () { _checkMinSize=true; }
161  inline void Contact::disableCheckMinSize () { _checkMinSize=false; }
162  inline bool Contact::isRotatedTopMetal () const { return _flags & RotateTopMetal; }
163  inline bool Contact::isRotatedBottomMetal () const { return _flags & RotateBottomMetal; }
164 
165  inline void Contact::setRotatedTopMetal ( bool state )
166  { if (state) _flags |= RotateTopMetal; else _flags &= ~RotateTopMetal; }
167 
168  inline void Contact::setRotatedBottomMetal ( bool state )
169  { if (state) _flags |= RotateBottomMetal; else _flags &= ~RotateBottomMetal; }
170 
171 
172 // -------------------------------------------------------------------
173 // Class : "Hurricane::JsonContact".
174 
175  class JsonContact : public JsonComponent {
176  public:
177  static void initialize ();
178  JsonContact ( unsigned long flags );
179  virtual std::string getTypeName () const;
180  virtual JsonContact* clone ( unsigned long ) const;
181  virtual void toData ( JsonStack& );
182  };
183 
184 
185 } // Hurricane namespace.
186 
187 
188 INSPECTOR_P_SUPPORT(Hurricane::Contact);
189 INSPECTOR_P_SUPPORT(Hurricane::Contact::AnchorHook);
BasicLayer description (API)
Definition: BasicLayer.h:42
Box description (API)
Definition: Box.h:30
Component description (API)
Definition: Component.h:43
Definition: Contact.h:56
Contact description (API)
Definition: Contact.h:43
DbU::Unit getHeight() const
Definition: Contact.h:119
void setWidth(DbU::Unit)
void setSizes(DbU::Unit width, DbU::Unit height)
void setY(DbU::Unit)
static Contact * create(Component *anchor, const Layer *layer, DbU::Unit dx, DbU::Unit dy, DbU::Unit width=0, DbU::Unit height=0)
Hook * getAnchorHook()
Definition: Contact.h:113
Component Inherit
Definition: Contact.h:50
DbU::Unit getHalfWidth() const
Definition: Contact.h:118
void setX(DbU::Unit)
void setOffset(DbU::Unit dx, DbU::Unit dy)
void setHeight(DbU::Unit)
DbU::Unit getWidth() const
Definition: Contact.h:117
void setDx(DbU::Unit)
DbU::Unit getDx() const
Definition: Contact.h:115
Component * getAnchor() const
static Contact * create(Net *net, const Layer *layer, DbU::Unit x, DbU::Unit y, DbU::Unit width=0, DbU::Unit height=0)
void setDy(DbU::Unit)
void setPosition(DbU::Unit x, DbU::Unit y)
DbU::Unit getHalfHeight() const
Definition: Contact.h:120
void setLayer(const Layer *)
void setPosition(const Point &)
DbU::Unit getDy() const
Definition: Contact.h:116
std::int64_t Unit
Definition: DbU.h:67
Generic Collection auto-pointer.
Definition: Collection.h:235
Hook description (API)
Definition: Hook.h:34
Layer description (API)
Definition: Layer.h:120
Net description (API)
Definition: Net.h:46
Point description (API)
Definition: Point.h:30
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