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
37namespace Hurricane {
38
39
40// -------------------------------------------------------------------
41// Class : "Hurricane::Contact".
42
43 class Contact : public Component {
44 public:
46 const uint64_t NoFlags = 0;
47 const uint64_t RotateTopMetal = (1 << 0);
48 const uint64_t RotateBottomMetal = (1 << 1);
49 const uint64_t AllRotate = RotateTopMetal|RotateBottomMetal;
50 public:
51 class AnchorHook : public Hook {
52 friend class Contact;
53 public:
54 typedef Hook Inherit;
55 private:
57 public:
58 virtual Component* getComponent () const;
59 virtual bool isMaster () const { return false; };
60 virtual std::string _getTypeName () const { return "Contact::AnchorHook"; };
61 virtual std::string _getString () const;
62 static Hook* _compToHook ( Component* );
63 };
64
65 protected:
66 Contact ( Net* net
67 , const Layer* layer
68 , DbU::Unit x
69 , DbU::Unit y
72 );
73 Contact ( Net* net
75 , const Layer* layer
80 );
81 public:
82 static inline void enableCheckMinSize ();
83 static inline void disableCheckMinSize ();
84 static Contact* create ( Net* net
85 , const Layer* layer
86 , DbU::Unit x
87 , DbU::Unit y
88 , DbU::Unit width =0
90 );
92 , const Layer* layer
95 , DbU::Unit width =0
97 );
98 public:
99 inline bool isRotatedTopMetal () const;
100 inline bool isRotatedBottomMetal () const;
101 virtual Hooks getHooks () const;
102 virtual DbU::Unit getX () const;
103 virtual DbU::Unit getY () const;
104 virtual Point getPosition () const;
105 virtual Box getBoundingBox () const;
106 virtual const Layer* getLayer () const {return _layer;};
107 virtual Box getBoundingBox ( const BasicLayer* ) const;
108 Hook* getAnchorHook () { return &_anchorHook; };
110 DbU::Unit getDx () const { return _dx; };
111 DbU::Unit getDy () const { return _dy; };
112 DbU::Unit getWidth () const { return _width; };
113 DbU::Unit getHalfWidth () const { return (_width / 2); };
114 DbU::Unit getHeight () const { return _height; };
115 DbU::Unit getHalfHeight () const { return (_height / 2); };
116 public:
117 virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy );
118 void setLayer ( const Layer* );
122 void setX ( DbU::Unit );
123 void setY ( DbU::Unit );
125 void setPosition ( const Point& );
126 void setDx ( DbU::Unit );
127 void setDy ( DbU::Unit );
129 inline void setRotatedTopMetal ( bool state );
130 inline void setRotatedBottomMetal ( bool state );
131 private:
132 bool _postCheck ();
133 protected:
134 virtual void _preDestroy ();
135 public:
136 virtual void _toJson ( JsonWriter* ) const;
137 virtual std::string _getTypeName () const { return _TName("Contact"); };
138 virtual std::string _getString () const;
139 virtual Record* _getRecord () const;
140 private:
141 static bool _checkMinSize;
142 AnchorHook _anchorHook;
143 const Layer* _layer;
144 uint64_t _flags;
145 DbU::Unit _dx;
146 DbU::Unit _dy;
147 protected:
148 DbU::Unit _width;
149 DbU::Unit _height;
150 };
151
152
153 inline void Contact::enableCheckMinSize () { _checkMinSize=true; }
154 inline void Contact::disableCheckMinSize () { _checkMinSize=false; }
155 inline bool Contact::isRotatedTopMetal () const { return _flags & RotateTopMetal; }
156 inline bool Contact::isRotatedBottomMetal () const { return _flags & RotateBottomMetal; }
157
158 inline void Contact::setRotatedTopMetal ( bool state )
159 { if (state) _flags |= RotateTopMetal; else _flags &= ~RotateTopMetal; }
160
161 inline void Contact::setRotatedBottomMetal ( bool state )
162 { if (state) _flags |= RotateBottomMetal; else _flags &= ~RotateBottomMetal; }
163
164
165// -------------------------------------------------------------------
166// Class : "Hurricane::JsonContact".
167
168 class JsonContact : public JsonComponent {
169 public:
170 static void initialize ();
171 JsonContact ( unsigned long flags );
172 virtual std::string getTypeName () const;
173 virtual JsonContact* clone ( unsigned long ) const;
174 virtual void toData ( JsonStack& );
175 };
176
177
178} // Hurricane namespace.
179
180
181INSPECTOR_P_SUPPORT(Hurricane::Contact);
182INSPECTOR_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:51
Contact description (API)
Definition Contact.h:43
DbU::Unit getHeight() const
Definition Contact.h:114
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:108
Component Inherit
Definition Contact.h:45
DbU::Unit getHalfWidth() const
Definition Contact.h:113
void setX(DbU::Unit)
void setOffset(DbU::Unit dx, DbU::Unit dy)
void setHeight(DbU::Unit)
DbU::Unit getWidth() const
Definition Contact.h:112
void setDx(DbU::Unit)
DbU::Unit getDx() const
Definition Contact.h:110
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:115
void setLayer(const Layer *)
void setPosition(const Point &)
DbU::Unit getDy() const
Definition Contact.h:111
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.10.0 on Fri Sep 27 2024 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved