Separate size check for Hurricane::Contact & Hurricane::Pin.
* Change: In Hurricane::Contact, as it is the base class of Pin, a width *or* height can rightfully be null (according to the Pin orientation). Put the check in a Contact::_postCheck() function. * Change: In Hurricane::Contact, replace all the "const DbU::Unit&" parameters by simply "DbU::Unit". * Change: In Hurricane::Pin, add a dedicated _postCheck() function.
This commit is contained in:
parent
6e0593e526
commit
7feb39d056
|
@ -39,7 +39,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \function Contact* Contact::create(Net* net, const Layer* layer, const DbU::Unit& x, const DbU::Unit& y,const DbU::Unit& width = 0, const DbU::Unit& height = 0);
|
/*! \function Contact* Contact::create(Net* net, const Layer* layer, DbU::Unit x, DbU::Unit y, DbU::Unit width=0, DbU::Unit height=0);
|
||||||
* creates and returns a new contact belonging to the net
|
* creates and returns a new contact belonging to the net
|
||||||
* \c \<net\>, on the layer \c \<layer\>, of size \c \<width\>
|
* \c \<net\>, on the layer \c \<layer\>, of size \c \<width\>
|
||||||
* and \c \<height\> and located at the absolute coordinates
|
* and \c \<height\> and located at the absolute coordinates
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
* \caution Throws an exception if the layer or the net is null.
|
* \caution Throws an exception if the layer or the net is null.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function Contact* Contact::create(Component* anchor, const Layer* layer, const DbU::Unit& dx, const DbU::Unit& dy,const DbU::Unit& width = 0, const DbU::Unit& height = 0);
|
/*! \function Contact* Contact::create(Component* anchor, const Layer* layer, DbU::Unit dx, DbU::Unit dy, DbU::Unit width=0, DbU::Unit height=0);
|
||||||
* creates and returns a new contact on the layer \c \<layer\>,
|
* creates and returns a new contact on the layer \c \<layer\>,
|
||||||
* of size \c \<width\> and \c \<height\> attached upon the
|
* of size \c \<width\> and \c \<height\> attached upon the
|
||||||
* component \c \<anchor\> through an offset defined by
|
* component \c \<anchor\> through an offset defined by
|
||||||
|
@ -76,21 +76,21 @@
|
||||||
* transitory)).
|
* transitory)).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function const DbU::Unit& Contact::getDx() const;
|
/*! \function DbU::Unit Contact::getDx() const;
|
||||||
* \Return the relative abscissa of the contact.
|
* \Return the relative abscissa of the contact.
|
||||||
*
|
*
|
||||||
* \remark If you want to get the absolute one use the member function
|
* \remark If you want to get the absolute one use the member function
|
||||||
* getX() defined at the Component level.
|
* getX() defined at the Component level.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function const DbU::Unit& Contact::getDy() const;
|
/*! \function DbU::Unit Contact::getDy() const;
|
||||||
* \Return the relative ordinate of the contact.
|
* \Return the relative ordinate of the contact.
|
||||||
*
|
*
|
||||||
* \remark If you want to get the absolute one use the member function
|
* \remark If you want to get the absolute one use the member function
|
||||||
* getY() defined at the Component level.
|
* getY() defined at the Component level.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function const DbU::Unit& Contact::getWidth() const;
|
/*! \function DbU::Unit Contact::getWidth() const;
|
||||||
* \Return the contact width.
|
* \Return the contact width.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
* \Return the contact half width.
|
* \Return the contact half width.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function const DbU::Unit& Contact::getHeight() const;
|
/*! \function DbU::Unit Contact::getHeight() const;
|
||||||
* \Return the contact height.
|
* \Return the contact height.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -111,31 +111,31 @@
|
||||||
* sets the contact layer.
|
* sets the contact layer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function void Contact::setWidth(const DbU::Unit& width);
|
/*! \function void Contact::setWidth(DbU::Unit width);
|
||||||
* sets the contact width.
|
* sets the contact width.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function void Contact::setHeight(const DbU::Unit& height);
|
/*! \function void Contact::setHeight(DbU::Unit height);
|
||||||
* sets the contact height.
|
* sets the contact height.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function void Contact::setSizes(const DbU::Unit& width, const DbU::Unit& height);
|
/*! \function void Contact::setSizes(DbU::Unit width, DbU::Unit height);
|
||||||
* sets both contact width and height.
|
* sets both contact width and height.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function void Contact::setX(const DbU::Unit& x);
|
/*! \function void Contact::setX(DbU::Unit x);
|
||||||
* Allows to change the absolute abscissa of the contact (if it
|
* Allows to change the absolute abscissa of the contact (if it
|
||||||
* has a location relative to an other component, only relative
|
* has a location relative to an other component, only relative
|
||||||
* position to this last is accordingly changed).
|
* position to this last is accordingly changed).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function void Contact::setY(const DbU::Unit& y);
|
/*! \function void Contact::setY(DbU::Unit y);
|
||||||
* Allows to change the absolute ordinate of the contact (if it
|
* Allows to change the absolute ordinate of the contact (if it
|
||||||
* has a location relative to an other component, only relative
|
* has a location relative to an other component, only relative
|
||||||
* position to this last is accordingly changed).
|
* position to this last is accordingly changed).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function void Contact::setPosition(const DbU::Unit& x, const DbU::Unit& y);
|
/*! \function void Contact::setPosition(DbU::Unit x, DbU::Unit y);
|
||||||
* No description.
|
* No description.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -145,21 +145,21 @@
|
||||||
* position to this last is accordingly changed).
|
* position to this last is accordingly changed).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function void Contact::setDx(const DbU::Unit& dx);
|
/*! \function void Contact::setDx(DbU::Unit dx);
|
||||||
* Allows to change the horizontal offset of the contact.
|
* Allows to change the horizontal offset of the contact.
|
||||||
*
|
*
|
||||||
* \remark If the contact is absolute, this amounts to change its
|
* \remark If the contact is absolute, this amounts to change its
|
||||||
* absolute abscissa.
|
* absolute abscissa.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function void Contact::setDy(const DbU::Unit& dy);
|
/*! \function void Contact::setDy(DbU::Unit dy);
|
||||||
* Allows to change the vertical offset of the contact.
|
* Allows to change the vertical offset of the contact.
|
||||||
*
|
*
|
||||||
* \remark If the contact is absolute, this amounts to change its
|
* \remark If the contact is absolute, this amounts to change its
|
||||||
* absolute ordinate.
|
* absolute ordinate.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \function void Contact::setOffset(const DbU::Unit& dx, const DbU::Unit& dy);
|
/*! \function void Contact::setOffset(DbU::Unit dx, DbU::Unit dy);
|
||||||
* Allows to change the offset of the contact.
|
* Allows to change the offset of the contact.
|
||||||
*
|
*
|
||||||
* \remark If the contact is absolute, this amounts to change its
|
* \remark If the contact is absolute, this amounts to change its
|
||||||
|
|
|
@ -103,8 +103,8 @@ class Contact_Hooks : public Collection<Hook*> {
|
||||||
// Contact implementation
|
// Contact implementation
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
||||||
Contact::Contact(Net* net, const Layer* layer, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& width, const DbU::Unit& height)
|
Contact::Contact(Net* net, const Layer* layer, DbU::Unit x, DbU::Unit y, DbU::Unit width, DbU::Unit height)
|
||||||
// ****************************************************************************************************
|
// ********************************************************************************************************
|
||||||
: Inherit(net),
|
: Inherit(net),
|
||||||
_anchorHook(this),
|
_anchorHook(this),
|
||||||
_layer(layer),
|
_layer(layer),
|
||||||
|
@ -115,29 +115,10 @@ Contact::Contact(Net* net, const Layer* layer, const DbU::Unit& x, const DbU::Un
|
||||||
{
|
{
|
||||||
if (not _layer)
|
if (not _layer)
|
||||||
throw Error("Contact::Contact(): Can't create " + _TName("Contact") + ", NULL layer.");
|
throw Error("Contact::Contact(): Can't create " + _TName("Contact") + ", NULL layer.");
|
||||||
|
|
||||||
if ( _width < _layer->getMinimalSize() ) {
|
|
||||||
cerr << Warning( "Contact::Contact(): Width %s is inferior to layer minimal size %s, bumping.\n"
|
|
||||||
" (on %s)"
|
|
||||||
, DbU::getValueString(_width).c_str()
|
|
||||||
, DbU::getValueString(_layer->getMinimalSize()).c_str()
|
|
||||||
, getString(this).c_str() )
|
|
||||||
<< endl;
|
|
||||||
_width = _layer->getMinimalSize();
|
|
||||||
}
|
|
||||||
if ( _height < _layer->getMinimalSize() ) {
|
|
||||||
cerr << Warning( "Contact::Contact(): Height %s is inferior to layer minimal size %s, bumping.\n"
|
|
||||||
" (on %s)"
|
|
||||||
, DbU::getValueString(_height).c_str()
|
|
||||||
, DbU::getValueString(_layer->getMinimalSize()).c_str()
|
|
||||||
, getString(this).c_str() )
|
|
||||||
<< endl;
|
|
||||||
_height = _layer->getMinimalSize();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Contact::Contact(Net* net, Component* anchor, const Layer* layer, const DbU::Unit& dx, const DbU::Unit& dy, const DbU::Unit& width, const DbU::Unit& height)
|
Contact::Contact(Net* net, Component* anchor, const Layer* layer, DbU::Unit dx, DbU::Unit dy, DbU::Unit width, DbU::Unit height)
|
||||||
// ****************************************************************************************************
|
// *****************************************************************************************************************************
|
||||||
: Inherit(net),
|
: Inherit(net),
|
||||||
_anchorHook(this),
|
_anchorHook(this),
|
||||||
_layer(layer),
|
_layer(layer),
|
||||||
|
@ -164,29 +145,59 @@ Contact::Contact(Net* net, Component* anchor, const Layer* layer, const DbU::Uni
|
||||||
if ( _height < _layer->getMinimalSize() ) _height = _layer->getMinimalSize();
|
if ( _height < _layer->getMinimalSize() ) _height = _layer->getMinimalSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
Contact* Contact::create(Net* net, const Layer* layer, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& width, const DbU::Unit& height)
|
Contact* Contact::create(Net* net, const Layer* layer, DbU::Unit x, DbU::Unit y, DbU::Unit width, DbU::Unit height)
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************************
|
||||||
{
|
{
|
||||||
Contact* contact = new Contact(net, layer, x, y, width, height);
|
Contact* contact = new Contact(net, layer, x, y, width, height);
|
||||||
|
|
||||||
contact->_postCreate();
|
contact->_postCreate();
|
||||||
|
contact->_postCheck();
|
||||||
return contact;
|
return contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
Contact* Contact::create(Component* anchor, const Layer* layer, const DbU::Unit& dx, const DbU::Unit& dy, const DbU::Unit& width, const DbU::Unit& height)
|
Contact* Contact::create(Component* anchor, const Layer* layer, DbU::Unit dx, DbU::Unit dy, DbU::Unit width, DbU::Unit height)
|
||||||
// ****************************************************************************************************
|
// ***************************************************************************************************************************
|
||||||
{
|
{
|
||||||
if (!anchor)
|
if (!anchor)
|
||||||
throw Error("Can't create " + _TName("Contact") + " : null anchor");
|
throw Error("Can't create " + _TName("Contact") + " : null anchor");
|
||||||
|
|
||||||
Contact* contact = new Contact(anchor->getNet(), anchor, layer, dx, dy, width, height);
|
Contact* contact = new Contact(anchor->getNet(), anchor, layer, dx, dy, width, height);
|
||||||
|
|
||||||
contact->_postCreate();
|
contact->_postCreate();
|
||||||
|
contact->_postCheck();
|
||||||
return contact;
|
return contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Contact::_postCheck ()
|
||||||
|
// *************************
|
||||||
|
{
|
||||||
|
bool rvalue = true;
|
||||||
|
if (_layer->isSymbolic()) {
|
||||||
|
if (not _width ) _width = _layer->getMinimalSize();
|
||||||
|
if (not _height) _height = _layer->getMinimalSize();
|
||||||
|
} else {
|
||||||
|
if ((_width) and (_width < _layer->getMinimalSize())) {
|
||||||
|
cerr << Warning( "Contact::_postCheck(): Width %s is inferior to layer minimal size %s, bumping.\n"
|
||||||
|
" (on %s)"
|
||||||
|
, DbU::getValueString(_width).c_str()
|
||||||
|
, DbU::getValueString(_layer->getMinimalSize()).c_str()
|
||||||
|
, getString(this).c_str() )
|
||||||
|
<< endl;
|
||||||
|
_width = _layer->getMinimalSize();
|
||||||
|
rvalue = false;
|
||||||
|
}
|
||||||
|
if ((_height) and (_height < _layer->getMinimalSize())) {
|
||||||
|
cerr << Warning( "Contact::_postCheck(): Height %s is inferior to layer minimal size %s, bumping.\n"
|
||||||
|
" (on %s)"
|
||||||
|
, DbU::getValueString(_height).c_str()
|
||||||
|
, DbU::getValueString(_layer->getMinimalSize()).c_str()
|
||||||
|
, getString(this).c_str() )
|
||||||
|
<< endl;
|
||||||
|
_height = _layer->getMinimalSize();
|
||||||
|
rvalue = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rvalue;
|
||||||
|
}
|
||||||
|
|
||||||
Hooks Contact::getHooks() const
|
Hooks Contact::getHooks() const
|
||||||
// ****************************
|
// ****************************
|
||||||
{
|
{
|
||||||
|
@ -194,14 +205,14 @@ Hooks Contact::getHooks() const
|
||||||
}
|
}
|
||||||
|
|
||||||
DbU::Unit Contact::getX() const
|
DbU::Unit Contact::getX() const
|
||||||
// ***********************
|
// ****************************
|
||||||
{
|
{
|
||||||
Component* anchor = getAnchor();
|
Component* anchor = getAnchor();
|
||||||
return (!anchor) ? _dx : anchor->getX() + _dx;
|
return (!anchor) ? _dx : anchor->getX() + _dx;
|
||||||
}
|
}
|
||||||
|
|
||||||
DbU::Unit Contact::getY() const
|
DbU::Unit Contact::getY() const
|
||||||
// ***********************
|
// ****************************
|
||||||
{
|
{
|
||||||
Component* anchor = getAnchor();
|
Component* anchor = getAnchor();
|
||||||
return (!anchor) ? _dy : anchor->getY() + _dy;
|
return (!anchor) ? _dy : anchor->getY() + _dy;
|
||||||
|
@ -242,7 +253,7 @@ Component* Contact::getAnchor() const
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::translate(const DbU::Unit& dx, const DbU::Unit& dy)
|
void Contact::translate(const DbU::Unit& dx, const DbU::Unit& dy)
|
||||||
// ****************************************************
|
// **************************************************************
|
||||||
{
|
{
|
||||||
if ((dx != 0) || (dy != 0)) {
|
if ((dx != 0) || (dy != 0)) {
|
||||||
invalidate(true);
|
invalidate(true);
|
||||||
|
@ -252,7 +263,7 @@ void Contact::translate(const DbU::Unit& dx, const DbU::Unit& dy)
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::setLayer(const Layer* layer)
|
void Contact::setLayer(const Layer* layer)
|
||||||
// *********************************
|
// ***************************************
|
||||||
{
|
{
|
||||||
if (!layer)
|
if (!layer)
|
||||||
throw Error("Can't set layer : null layer");
|
throw Error("Can't set layer : null layer");
|
||||||
|
@ -263,8 +274,8 @@ void Contact::setLayer(const Layer* layer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::setWidth(const DbU::Unit& width)
|
void Contact::setWidth(DbU::Unit width)
|
||||||
// **************************************
|
// ************************************
|
||||||
{
|
{
|
||||||
if (width != _width) {
|
if (width != _width) {
|
||||||
invalidate(false);
|
invalidate(false);
|
||||||
|
@ -272,8 +283,8 @@ void Contact::setWidth(const DbU::Unit& width)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::setHeight(const DbU::Unit& height)
|
void Contact::setHeight(DbU::Unit height)
|
||||||
// ****************************************
|
// **************************************
|
||||||
{
|
{
|
||||||
if (height != _height) {
|
if (height != _height) {
|
||||||
invalidate(false);
|
invalidate(false);
|
||||||
|
@ -281,8 +292,8 @@ void Contact::setHeight(const DbU::Unit& height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::setSizes(const DbU::Unit& width, const DbU::Unit& height)
|
void Contact::setSizes(DbU::Unit width, DbU::Unit height)
|
||||||
// **********************************************************
|
// ******************************************************
|
||||||
{
|
{
|
||||||
if ((width != _width) || (height != _height)) {
|
if ((width != _width) || (height != _height)) {
|
||||||
invalidate(false);
|
invalidate(false);
|
||||||
|
@ -291,20 +302,20 @@ void Contact::setSizes(const DbU::Unit& width, const DbU::Unit& height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::setX(const DbU::Unit& x)
|
void Contact::setX(DbU::Unit x)
|
||||||
// ******************************
|
// ****************************
|
||||||
{
|
{
|
||||||
setPosition(x, getY());
|
setPosition(x, getY());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::setY(const DbU::Unit& y)
|
void Contact::setY(DbU::Unit y)
|
||||||
// ******************************
|
// ****************************
|
||||||
{
|
{
|
||||||
setPosition(getX(), y);
|
setPosition(getX(), y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::setPosition(const DbU::Unit& x, const DbU::Unit& y)
|
void Contact::setPosition(DbU::Unit x, DbU::Unit y)
|
||||||
// ****************************************************
|
// ************************************************
|
||||||
{
|
{
|
||||||
Component* anchor = getAnchor();
|
Component* anchor = getAnchor();
|
||||||
if (!anchor)
|
if (!anchor)
|
||||||
|
@ -319,20 +330,20 @@ void Contact::setPosition(const Point& position)
|
||||||
setPosition(position.getX(), position.getY());
|
setPosition(position.getX(), position.getY());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::setDx(const DbU::Unit& dx)
|
void Contact::setDx(DbU::Unit dx)
|
||||||
// ********************************
|
// ******************************
|
||||||
{
|
{
|
||||||
setOffset(dx, _dy);
|
setOffset(dx, _dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::setDy(const DbU::Unit& dy)
|
void Contact::setDy(DbU::Unit dy)
|
||||||
// ********************************
|
// ******************************
|
||||||
{
|
{
|
||||||
setOffset(_dx, dy);
|
setOffset(_dx, dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contact::setOffset(const DbU::Unit& dx, const DbU::Unit& dy)
|
void Contact::setOffset(DbU::Unit dx, DbU::Unit dy)
|
||||||
// ****************************************************
|
// ************************************************
|
||||||
{
|
{
|
||||||
if ((dx != _dx) || (dy != _dy)) {
|
if ((dx != _dx) || (dy != _dy)) {
|
||||||
invalidate(true);
|
invalidate(true);
|
||||||
|
@ -380,7 +391,7 @@ string Contact::_getString() const
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* Contact::_getRecord() const
|
Record* Contact::_getRecord() const
|
||||||
// **************************
|
// ********************************
|
||||||
{
|
{
|
||||||
Record* record = Inherit::_getRecord();
|
Record* record = Inherit::_getRecord();
|
||||||
if (record) {
|
if (record) {
|
||||||
|
@ -427,7 +438,7 @@ string Contact::AnchorHook::_getString() const
|
||||||
}
|
}
|
||||||
|
|
||||||
Hook* Contact::AnchorHook::_compToHook(Component* component)
|
Hook* Contact::AnchorHook::_compToHook(Component* component)
|
||||||
// ***************************************************************
|
// *********************************************************
|
||||||
{
|
{
|
||||||
Contact* contact = dynamic_cast<Contact*>(component);
|
Contact* contact = dynamic_cast<Contact*>(component);
|
||||||
if (not contact) {
|
if (not contact) {
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
// not, see <http://www.gnu.org/licenses/>.
|
// not, see <http://www.gnu.org/licenses/>.
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
||||||
|
#include "hurricane/Warning.h"
|
||||||
#include "hurricane/Cell.h"
|
#include "hurricane/Cell.h"
|
||||||
#include "hurricane/Pin.h"
|
#include "hurricane/Pin.h"
|
||||||
|
|
||||||
|
@ -28,8 +29,8 @@ namespace Hurricane {
|
||||||
// Pin implementation
|
// Pin implementation
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
||||||
Pin::Pin(Net* net, const Name& name, const AccessDirection& accessDirection, const PlacementStatus& placementStatus, const Layer* layer, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& width, const DbU::Unit& height)
|
Pin::Pin(Net* net, const Name& name, const AccessDirection& accessDirection, const PlacementStatus& placementStatus, const Layer* layer, DbU::Unit x, DbU::Unit y, DbU::Unit width, DbU::Unit height)
|
||||||
// ****************************************************************************************************
|
// **************************************************************************************************************************************************************************************************
|
||||||
: Inherit(net, layer, x, y, width, height),
|
: Inherit(net, layer, x, y, width, height),
|
||||||
_name(name),
|
_name(name),
|
||||||
_accessDirection(accessDirection),
|
_accessDirection(accessDirection),
|
||||||
|
@ -41,8 +42,8 @@ Pin::Pin(Net* net, const Name& name, const AccessDirection& accessDirection, con
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Pin* Pin::create(Net* net, const Name& name, const AccessDirection& accessDirection, const PlacementStatus& placementStatus, const Layer* layer, const DbU::Unit& x, const DbU::Unit& y, const DbU::Unit& width, const DbU::Unit& height)
|
Pin* Pin::create(Net* net, const Name& name, const AccessDirection& accessDirection, const PlacementStatus& placementStatus, const Layer* layer, DbU::Unit x, DbU::Unit y, DbU::Unit width, DbU::Unit height)
|
||||||
// ****************************************************************************************************
|
// **********************************************************************************************************************************************************************************************************
|
||||||
{
|
{
|
||||||
if (!net)
|
if (!net)
|
||||||
throw Error("Can't create " + _TName("Pin") + " : NULL net");
|
throw Error("Can't create " + _TName("Pin") + " : NULL net");
|
||||||
|
@ -50,14 +51,46 @@ Pin* Pin::create(Net* net, const Name& name, const AccessDirection& accessDirect
|
||||||
throw Error("Can't create " + _TName("Pin") + " : NULL layer");
|
throw Error("Can't create " + _TName("Pin") + " : NULL layer");
|
||||||
|
|
||||||
Pin* pin = new Pin(net, name, accessDirection, placementStatus, layer, x, y, width, height);
|
Pin* pin = new Pin(net, name, accessDirection, placementStatus, layer, x, y, width, height);
|
||||||
|
|
||||||
pin->_postCreate();
|
pin->_postCreate();
|
||||||
|
pin->_postCheck();
|
||||||
return pin;
|
return pin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Pin::_postCheck ()
|
||||||
|
// *********************
|
||||||
|
{
|
||||||
|
bool rvalue = true;
|
||||||
|
if ((not getLayer()->isSymbolic() or (getWidth()))
|
||||||
|
and ( (_accessDirection == AccessDirection::NORTH)
|
||||||
|
or (_accessDirection == AccessDirection::SOUTH) )
|
||||||
|
and (getWidth() < getLayer()->getMinimalSize())) {
|
||||||
|
cerr << Warning( "Pin::_postCheck(): Width %s is inferior to layer minimal size %s, bumping.\n"
|
||||||
|
" (on %s)"
|
||||||
|
, DbU::getValueString(getWidth()).c_str()
|
||||||
|
, DbU::getValueString(getLayer()->getMinimalSize()).c_str()
|
||||||
|
, getString(this).c_str() )
|
||||||
|
<< endl;
|
||||||
|
setWidth( getLayer()->getMinimalSize() );
|
||||||
|
rvalue = false;
|
||||||
|
}
|
||||||
|
if ((not getLayer()->isSymbolic() or (getHeight()))
|
||||||
|
and ( (_accessDirection == AccessDirection::WEST)
|
||||||
|
or (_accessDirection == AccessDirection::EAST) )
|
||||||
|
and getHeight() < getLayer()->getMinimalSize()) {
|
||||||
|
cerr << Warning( "Pin::_postCheck(): Height %s is inferior to layer minimal size %s, bumping.\n"
|
||||||
|
" (on %s)"
|
||||||
|
, DbU::getValueString(getHeight()).c_str()
|
||||||
|
, DbU::getValueString(getLayer()->getMinimalSize()).c_str()
|
||||||
|
, getString(this).c_str() )
|
||||||
|
<< endl;
|
||||||
|
setHeight( getLayer()->getMinimalSize() );
|
||||||
|
rvalue = false;
|
||||||
|
}
|
||||||
|
return rvalue;
|
||||||
|
}
|
||||||
|
|
||||||
void Pin::setPlacementStatus(const PlacementStatus& placementstatus)
|
void Pin::setPlacementStatus(const PlacementStatus& placementstatus)
|
||||||
// **********************************************************************
|
// *****************************************************************
|
||||||
{
|
{
|
||||||
if (placementstatus != _placementStatus) {
|
if (placementstatus != _placementStatus) {
|
||||||
invalidate(true);
|
invalidate(true);
|
||||||
|
@ -66,7 +99,7 @@ void Pin::setPlacementStatus(const PlacementStatus& placementstatus)
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pin::_postCreate()
|
void Pin::_postCreate()
|
||||||
// **********************
|
// ********************
|
||||||
{
|
{
|
||||||
getCell()->_getPinMap()._insert(this);
|
getCell()->_getPinMap()._insert(this);
|
||||||
|
|
||||||
|
@ -74,14 +107,14 @@ void Pin::_postCreate()
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pin::_preDestroy()
|
void Pin::_preDestroy()
|
||||||
// *********************
|
// ********************
|
||||||
{
|
{
|
||||||
Inherit::_preDestroy();
|
Inherit::_preDestroy();
|
||||||
getCell()->_getPinMap()._remove(this);
|
getCell()->_getPinMap()._remove(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
string Pin::_getString() const
|
string Pin::_getString() const
|
||||||
// *****************************
|
// ***************************
|
||||||
{
|
{
|
||||||
string s = Inherit::_getString();
|
string s = Inherit::_getString();
|
||||||
s.insert(s.length() - 1, " " + getString(_name));
|
s.insert(s.length() - 1, " " + getString(_name));
|
||||||
|
@ -90,7 +123,7 @@ string Pin::_getString() const
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* Pin::_getRecord() const
|
Record* Pin::_getRecord() const
|
||||||
// ************************
|
// ****************************
|
||||||
{
|
{
|
||||||
Record* record = Inherit::_getRecord();
|
Record* record = Inherit::_getRecord();
|
||||||
if (record) {
|
if (record) {
|
||||||
|
@ -101,89 +134,31 @@ Record* Pin::_getRecord() const
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
//void Pin::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
|
|
||||||
//// *************************************************************************************************************
|
|
||||||
//{
|
|
||||||
// view->FillRectangle(transformation.getBox(getBoundingBox(basicLayer)), true);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//void Pin::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
|
|
||||||
//// ******************************************************************************************
|
|
||||||
//{
|
|
||||||
// if (_width && _height) {
|
|
||||||
// if (1 < view->getScreenSize(max(_width, _height))) {
|
|
||||||
// for_each_basic_layer(basicLayer, getLayer()->getBasicLayers()) {
|
|
||||||
// basicLayer->_Fill(view, transformation.getBox(getBoundingBox(basicLayer)));
|
|
||||||
// end_for;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (view->getScale() <= 1)
|
|
||||||
// view->DrawPoint(transformation.getPoint(getPosition()), 1);
|
|
||||||
// else if (view->getScale() <= 3)
|
|
||||||
// {
|
|
||||||
// view->DrawPoint(transformation.getPoint(getPosition()), 2);
|
|
||||||
//
|
|
||||||
// if ( view->IsTextVisible() )
|
|
||||||
// {
|
|
||||||
// string text = "("
|
|
||||||
// + getString ( getValue ( getX() ) ) + ","
|
|
||||||
// + getString ( getValue ( getY() ) ) + ")";
|
|
||||||
// view->DrawString ( text,
|
|
||||||
// transformation.getBox ( getBoundingBox() ).getXMin(),
|
|
||||||
// transformation.getBox ( getBoundingBox() ).getYMax() );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// Point position = getPosition();
|
|
||||||
// view->DrawPoint(transformation.getPoint(position), 3);
|
|
||||||
// if (_width) {
|
|
||||||
// Box box = transformation.getBox(Box(position).Inflate(getHalfWidth(), 0));
|
|
||||||
// view->DrawLine(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax());
|
|
||||||
// }
|
|
||||||
// if (_height) {
|
|
||||||
// Box box = transformation.getBox(Box(position).Inflate(0, getHalfHeight()));
|
|
||||||
// view->DrawLine(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if ( view->IsTextVisible() )
|
|
||||||
// {
|
|
||||||
// string text = getString ( _name ) + "("
|
|
||||||
// + getString ( getValue ( getX() ) ) + ","
|
|
||||||
// + getString ( getValue ( getY() ) ) + ")";
|
|
||||||
// view->DrawString ( text,
|
|
||||||
// transformation.getBox ( getBoundingBox() ).getXMin(),
|
|
||||||
// transformation.getBox ( getBoundingBox() ).getYMax() );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
|
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
// Pin::AccessDirection implementation
|
// Pin::AccessDirection implementation
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
||||||
Pin::AccessDirection::AccessDirection(const Code& code)
|
Pin::AccessDirection::AccessDirection(Code code)
|
||||||
// ******************************************************
|
// *********************************************
|
||||||
: _code(code)
|
: _code(code)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Pin::AccessDirection::AccessDirection(const AccessDirection& accessDirection)
|
Pin::AccessDirection::AccessDirection(const AccessDirection& accessDirection)
|
||||||
// ****************************************************************************
|
// **************************************************************************
|
||||||
: _code(accessDirection._code)
|
: _code(accessDirection._code)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Pin::AccessDirection& Pin::AccessDirection::operator=(const AccessDirection& accessDirection)
|
Pin::AccessDirection& Pin::AccessDirection::operator=(const AccessDirection& accessDirection)
|
||||||
// **********************************************************************************************
|
// ******************************************************************************************
|
||||||
{
|
{
|
||||||
_code = accessDirection._code;
|
_code = accessDirection._code;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
string Pin::AccessDirection::_getString() const
|
string Pin::AccessDirection::_getString() const
|
||||||
// **********************************************
|
// ********************************************
|
||||||
{
|
{
|
||||||
switch (_code) {
|
switch (_code) {
|
||||||
case UNDEFINED : return "UNDEFINED";
|
case UNDEFINED : return "UNDEFINED";
|
||||||
|
@ -196,7 +171,7 @@ string Pin::AccessDirection::_getString() const
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* Pin::AccessDirection::_getRecord() const
|
Record* Pin::AccessDirection::_getRecord() const
|
||||||
// *****************************************
|
// *********************************************
|
||||||
{
|
{
|
||||||
Record* record = new Record(getString(this));
|
Record* record = new Record(getString(this));
|
||||||
record->add(getSlot("Code", (int)_code));
|
record->add(getSlot("Code", (int)_code));
|
||||||
|
@ -209,8 +184,8 @@ Record* Pin::AccessDirection::_getRecord() const
|
||||||
// Pin::PlacementStatus implementation
|
// Pin::PlacementStatus implementation
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
||||||
Pin::PlacementStatus::PlacementStatus(const Code& code)
|
Pin::PlacementStatus::PlacementStatus(Code code)
|
||||||
// ****************************************************
|
// *********************************************
|
||||||
: _code(code)
|
: _code(code)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -240,7 +215,7 @@ string Pin::PlacementStatus::_getString() const
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* Pin::PlacementStatus::_getRecord() const
|
Record* Pin::PlacementStatus::_getRecord() const
|
||||||
// ***************************************
|
// *********************************************
|
||||||
{
|
{
|
||||||
Record* record = new Record(getString(this));
|
Record* record = new Record(getString(this));
|
||||||
record->add(getSlot("Code", (int)_code));
|
record->add(getSlot("Code", (int)_code));
|
||||||
|
|
|
@ -1,174 +1,158 @@
|
||||||
// ****************************************************************************************************
|
// -*- C++ -*-
|
||||||
// File: ./hurricane/Contact.h
|
//
|
||||||
// Authors: R. Escassut
|
// Copyright (c) BULL S.A. 2000-2020, All Rights Reserved
|
||||||
// Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
|
|
||||||
//
|
//
|
||||||
// This file is part of Hurricane.
|
// This file is part of Hurricane.
|
||||||
//
|
//
|
||||||
// Hurricane is free software: you can redistribute it and/or modify it under the terms of the GNU
|
// Hurricane is free software: you can redistribute it and/or modify
|
||||||
// Lesser General Public License as published by the Free Software Foundation, either version 3 of the
|
// it under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
// License, or (at your option) any later version.
|
// License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Hurricane is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
// Hurricane is distributed in the hope that it will be useful, but
|
||||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
|
||||||
|
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
||||||
// General Public License for more details.
|
// General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the Lesser GNU General Public License along with Hurricane. If
|
// You should have received a copy of the Lesser GNU General Public
|
||||||
// not, see <http://www.gnu.org/licenses/>.
|
// License along with Hurricane. If not, see
|
||||||
// ****************************************************************************************************
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// +-----------------------------------------------------------------+
|
||||||
|
// | H U R R I C A N E |
|
||||||
|
// | V L S I B a c k e n d D a t a - B a s e |
|
||||||
|
// | |
|
||||||
|
// | Author : Remy Escassut |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Header : "./hurricane/Commons.h" |
|
||||||
|
// +-----------------------------------------------------------------+
|
||||||
|
|
||||||
#ifndef HURRICANE_CONTACT
|
|
||||||
#define HURRICANE_CONTACT
|
|
||||||
|
|
||||||
|
#pragma once
|
||||||
#include "hurricane/Component.h"
|
#include "hurricane/Component.h"
|
||||||
#include "hurricane/Contacts.h"
|
#include "hurricane/Contacts.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
// ****************************************************************************************************
|
// -------------------------------------------------------------------
|
||||||
// Contact declaration
|
// Class : "Hurricane::Contact".
|
||||||
// ****************************************************************************************************
|
|
||||||
|
|
||||||
class Contact : public Component {
|
class Contact : public Component {
|
||||||
// *****************************
|
public:
|
||||||
|
typedef Component Inherit;
|
||||||
// Types
|
public:
|
||||||
// *****
|
class AnchorHook : public Hook {
|
||||||
|
|
||||||
public: typedef Component Inherit;
|
|
||||||
|
|
||||||
public: class AnchorHook : public Hook {
|
|
||||||
// ***********************************
|
|
||||||
|
|
||||||
friend class Contact;
|
friend class Contact;
|
||||||
|
public:
|
||||||
public: typedef Hook Inherit;
|
typedef Hook Inherit;
|
||||||
|
private:
|
||||||
private: AnchorHook(Contact* contact);
|
AnchorHook ( Contact* );
|
||||||
|
public:
|
||||||
public: virtual Component* getComponent() const;
|
virtual Component* getComponent () const;
|
||||||
|
virtual bool isMaster () const { return false; };
|
||||||
public: virtual bool isMaster() const {return false;};
|
virtual std::string _getTypeName () const { return "Contact::AnchorHook"; };
|
||||||
|
virtual std::string _getString () const;
|
||||||
public: virtual string _getTypeName() const { return "Contact::AnchorHook"; };
|
static Hook* _compToHook ( Component* );
|
||||||
public: virtual string _getString() const;
|
|
||||||
public: static Hook* _compToHook(Component*);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Attributes
|
protected:
|
||||||
// **********
|
Contact ( Net* net
|
||||||
|
|
||||||
private: AnchorHook _anchorHook;
|
|
||||||
private: const Layer* _layer;
|
|
||||||
private: DbU::Unit _dx;
|
|
||||||
private: DbU::Unit _dy;
|
|
||||||
protected: DbU::Unit _width;
|
|
||||||
protected: DbU::Unit _height;
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
// ************
|
|
||||||
|
|
||||||
protected: Contact( Net* net
|
|
||||||
, const Layer* layer
|
, const Layer* layer
|
||||||
, const DbU::Unit& x
|
, DbU::Unit x
|
||||||
, const DbU::Unit& y
|
, DbU::Unit y
|
||||||
, const DbU::Unit& width = 0
|
, DbU::Unit width
|
||||||
, const DbU::Unit& height = 0
|
, DbU::Unit height
|
||||||
);
|
);
|
||||||
protected: Contact( Net* net
|
Contact ( Net* net
|
||||||
, Component* anchor
|
, Component* anchor
|
||||||
, const Layer* layer
|
, const Layer* layer
|
||||||
, const DbU::Unit& dx
|
, DbU::Unit dx
|
||||||
, const DbU::Unit& dy
|
, DbU::Unit dy
|
||||||
, const DbU::Unit& width = 0
|
, DbU::Unit width
|
||||||
, const DbU::Unit& height = 0
|
, DbU::Unit height
|
||||||
);
|
);
|
||||||
|
public:
|
||||||
public: static Contact* create( Net* net
|
static Contact* create ( Net* net
|
||||||
, const Layer* layer
|
, const Layer* layer
|
||||||
, const DbU::Unit& x
|
, DbU::Unit x
|
||||||
, const DbU::Unit& y
|
, DbU::Unit y
|
||||||
, const DbU::Unit& width = 0
|
, DbU::Unit width =0
|
||||||
, const DbU::Unit& height = 0
|
, DbU::Unit height=0
|
||||||
);
|
);
|
||||||
public: static Contact* create( Component* anchor
|
static Contact* create ( Component* anchor
|
||||||
, const Layer* layer
|
, const Layer* layer
|
||||||
, const DbU::Unit& dx
|
, DbU::Unit dx
|
||||||
, const DbU::Unit& dy
|
, DbU::Unit dy
|
||||||
, const DbU::Unit& width = 0
|
, DbU::Unit width =0
|
||||||
, const DbU::Unit& height = 0
|
, DbU::Unit height=0
|
||||||
);
|
);
|
||||||
|
public:
|
||||||
// Accessors
|
virtual Hooks getHooks () const;
|
||||||
// *********
|
virtual DbU::Unit getX () const;
|
||||||
|
virtual DbU::Unit getY () const;
|
||||||
public: virtual Hooks getHooks() const;
|
virtual Point getPosition () const;
|
||||||
public: virtual DbU::Unit getX() const;
|
virtual Box getBoundingBox () const;
|
||||||
public: virtual DbU::Unit getY() const;
|
virtual const Layer* getLayer () const {return _layer;};
|
||||||
public: virtual Point getPosition() const;
|
virtual Box getBoundingBox ( const BasicLayer* ) const;
|
||||||
public: virtual Box getBoundingBox() const;
|
Hook* getAnchorHook () { return &_anchorHook; };
|
||||||
public: virtual const Layer* getLayer() const {return _layer;};
|
Component* getAnchor () const;
|
||||||
public: virtual Box getBoundingBox(const BasicLayer* basicLayer) const;
|
DbU::Unit getDx () const { return _dx; };
|
||||||
public: Hook* getAnchorHook() {return &_anchorHook;};
|
DbU::Unit getDy () const { return _dy; };
|
||||||
public: Component* getAnchor() const;
|
DbU::Unit getWidth () const { return _width; };
|
||||||
public: const DbU::Unit& getDx() const {return _dx;};
|
DbU::Unit getHalfWidth () const { return (_width / 2); };
|
||||||
public: const DbU::Unit& getDy() const {return _dy;};
|
DbU::Unit getHeight () const { return _height; };
|
||||||
public: const DbU::Unit& getWidth() const {return _width;};
|
DbU::Unit getHalfHeight () const { return (_height / 2); };
|
||||||
public: DbU::Unit getHalfWidth() const {return (_width / 2);};
|
public:
|
||||||
public: const DbU::Unit& getHeight() const {return _height;};
|
virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy );
|
||||||
public: DbU::Unit getHalfHeight() const {return (_height / 2);};
|
void setLayer ( const Layer* );
|
||||||
|
void setWidth ( DbU::Unit );
|
||||||
// Updators
|
void setHeight ( DbU::Unit );
|
||||||
// ********
|
void setSizes ( DbU::Unit width, DbU::Unit height);
|
||||||
|
void setX ( DbU::Unit );
|
||||||
public: virtual void translate(const DbU::Unit& dx, const DbU::Unit& dy);
|
void setY ( DbU::Unit );
|
||||||
|
void setPosition ( DbU::Unit x, DbU::Unit y);
|
||||||
public: void setLayer(const Layer* layer);
|
void setPosition ( const Point& );
|
||||||
public: void setWidth(const DbU::Unit& width);
|
void setDx ( DbU::Unit );
|
||||||
public: void setHeight(const DbU::Unit& height);
|
void setDy ( DbU::Unit );
|
||||||
public: void setSizes(const DbU::Unit& width, const DbU::Unit& height);
|
void setOffset ( DbU::Unit dx, DbU::Unit dy);
|
||||||
public: void setX(const DbU::Unit& x);
|
private:
|
||||||
public: void setY(const DbU::Unit& y);
|
bool _postCheck ();
|
||||||
public: void setPosition(const DbU::Unit& x, const DbU::Unit& y);
|
protected:
|
||||||
public: void setPosition(const Point& position);
|
virtual void _preDestroy ();
|
||||||
public: void setDx(const DbU::Unit& dx);
|
public:
|
||||||
public: void setDy(const DbU::Unit& dy);
|
virtual void _toJson ( JsonWriter* ) const;
|
||||||
public: void setOffset(const DbU::Unit& dx, const DbU::Unit& dy);
|
virtual std::string _getTypeName () const { return _TName("Contact"); };
|
||||||
|
virtual std::string _getString () const;
|
||||||
// Others
|
virtual Record* _getRecord () const;
|
||||||
// ******
|
private:
|
||||||
|
AnchorHook _anchorHook;
|
||||||
protected: virtual void _preDestroy();
|
const Layer* _layer;
|
||||||
|
DbU::Unit _dx;
|
||||||
public: virtual void _toJson(JsonWriter*) const;
|
DbU::Unit _dy;
|
||||||
public: virtual string _getTypeName() const {return _TName("Contact");};
|
protected:
|
||||||
public: virtual string _getString() const;
|
DbU::Unit _width;
|
||||||
public: virtual Record* _getRecord() const;
|
DbU::Unit _height;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::Contact".
|
||||||
|
|
||||||
class JsonContact : public JsonComponent {
|
class JsonContact : public JsonComponent {
|
||||||
// ***************************************
|
public:
|
||||||
|
static void initialize ();
|
||||||
public: static void initialize();
|
JsonContact ( unsigned long flags );
|
||||||
public: JsonContact(unsigned long flags);
|
virtual std::string getTypeName () const;
|
||||||
public: virtual string getTypeName() const;
|
virtual JsonContact* clone ( unsigned long ) const;
|
||||||
public: virtual JsonContact* clone(unsigned long) const;
|
virtual void toData ( JsonStack& );
|
||||||
public: virtual void toData(JsonStack&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
|
||||||
|
} // Hurricane namespace.
|
||||||
|
|
||||||
|
|
||||||
INSPECTOR_P_SUPPORT(Hurricane::Contact);
|
INSPECTOR_P_SUPPORT(Hurricane::Contact);
|
||||||
INSPECTOR_P_SUPPORT(Hurricane::Contact::AnchorHook);
|
INSPECTOR_P_SUPPORT(Hurricane::Contact::AnchorHook);
|
||||||
|
|
||||||
|
|
||||||
#endif // HURRICANE_CONTACT
|
|
||||||
|
|
||||||
|
|
||||||
// ****************************************************************************************************
|
|
||||||
// Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
|
|
||||||
// ****************************************************************************************************
|
|
||||||
|
|
|
@ -1,167 +1,133 @@
|
||||||
// ****************************************************************************************************
|
// -*- C++ -*-
|
||||||
// File: ./hurricane/Pin.h
|
//
|
||||||
// Authors: C. Alexandre
|
// Copyright (c) BULL S.A. 2000-2020, All Rights Reserved
|
||||||
// Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
|
|
||||||
//
|
//
|
||||||
// This file is part of Hurricane.
|
// This file is part of Hurricane.
|
||||||
//
|
//
|
||||||
// Hurricane is free software: you can redistribute it and/or modify it under the terms of the GNU
|
// Hurricane is free software: you can redistribute it and/or modify
|
||||||
// Lesser General Public License as published by the Free Software Foundation, either version 3 of the
|
// it under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
// License, or (at your option) any later version.
|
// License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Hurricane is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
// Hurricane is distributed in the hope that it will be useful, but
|
||||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
|
||||||
|
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
||||||
// General Public License for more details.
|
// General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the Lesser GNU General Public License along with Hurricane. If
|
// You should have received a copy of the Lesser GNU General Public
|
||||||
// not, see <http://www.gnu.org/licenses/>.
|
// License along with Hurricane. If not, see
|
||||||
// ****************************************************************************************************
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
#ifndef HURRICANE_PIN
|
// +-----------------------------------------------------------------+
|
||||||
#define HURRICANE_PIN
|
// | H U R R I C A N E |
|
||||||
|
// | V L S I B a c k e n d D a t a - B a s e |
|
||||||
|
// | |
|
||||||
|
// | Author : Christophe Alexandre |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Header : "./hurricane/Commons.h" |
|
||||||
|
// +-----------------------------------------------------------------+
|
||||||
|
|
||||||
|
#pragma once
|
||||||
#include "hurricane/Contact.h"
|
#include "hurricane/Contact.h"
|
||||||
#include "hurricane/Pins.h"
|
#include "hurricane/Pins.h"
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
// ****************************************************************************************************
|
// Class : "Hurricane::Pin".
|
||||||
// Pin declaration
|
|
||||||
// ****************************************************************************************************
|
|
||||||
|
|
||||||
class Pin : public Contact {
|
class Pin : public Contact {
|
||||||
// ***********************
|
public:
|
||||||
|
typedef Contact Inherit;
|
||||||
// Types
|
|
||||||
// *****
|
|
||||||
|
|
||||||
public: typedef Contact Inherit;
|
|
||||||
|
|
||||||
public: class AccessDirection {
|
|
||||||
// **************************
|
|
||||||
|
|
||||||
public: enum Code {UNDEFINED=0, NORTH=1, SOUTH=2, EAST=3, WEST=4};
|
|
||||||
|
|
||||||
private: Code _code;
|
|
||||||
|
|
||||||
public: AccessDirection(const Code& code = UNDEFINED);
|
|
||||||
public: AccessDirection(const AccessDirection& accessDirection);
|
|
||||||
|
|
||||||
public: AccessDirection& operator=(const AccessDirection& accessDirection);
|
|
||||||
|
|
||||||
public: operator const Code&() const {return _code;};
|
|
||||||
|
|
||||||
public: const Code& getCode() const {return _code;};
|
|
||||||
|
|
||||||
public: string _getTypeName() const { return _TName("Pin::AccessDirection"); };
|
|
||||||
public: string _getString() const;
|
|
||||||
public: Record* _getRecord() const;
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
class AccessDirection {
|
||||||
|
public:
|
||||||
|
enum Code { UNDEFINED=0, NORTH=1, SOUTH=2, EAST=3, WEST=4 };
|
||||||
|
public:
|
||||||
|
AccessDirection ( Code code=UNDEFINED );
|
||||||
|
AccessDirection ( const AccessDirection& accessDirection );
|
||||||
|
AccessDirection& operator= ( const AccessDirection& accessDirection );
|
||||||
|
operator Code () const { return _code; };
|
||||||
|
Code getCode () const { return _code; };
|
||||||
|
std::string _getTypeName () const { return _TName("Pin::AccessDirection"); };
|
||||||
|
std::string _getString () const;
|
||||||
|
Record* _getRecord () const;
|
||||||
|
private:
|
||||||
|
Code _code;
|
||||||
};
|
};
|
||||||
|
|
||||||
public: class PlacementStatus {
|
public:
|
||||||
// **************************
|
class PlacementStatus {
|
||||||
|
public:
|
||||||
public: enum Code {UNPLACED=0, PLACED=1, FIXED=2};
|
enum Code { UNPLACED=0, PLACED=1, FIXED=2 };
|
||||||
|
public:
|
||||||
private: Code _code;
|
PlacementStatus ( Code code=UNPLACED);
|
||||||
|
PlacementStatus ( const PlacementStatus& placementstatus );
|
||||||
public: PlacementStatus(const Code& code = UNPLACED);
|
PlacementStatus& operator= ( const PlacementStatus& placementstatus );
|
||||||
public: PlacementStatus(const PlacementStatus& placementstatus);
|
operator Code () const { return _code; };
|
||||||
|
Code getCode () const { return _code; };
|
||||||
public: PlacementStatus& operator=(const PlacementStatus& placementstatus);
|
std::string _getTypeName () const { return _TName("Pin::PlacementStatus"); };
|
||||||
|
std::string _getString () const;
|
||||||
public: operator const Code&() const {return _code;};
|
Record* _getRecord () const;
|
||||||
|
private:
|
||||||
public: const Code& getCode() const {return _code;};
|
Code _code;
|
||||||
|
|
||||||
public: string _getTypeName() const { return _TName("Pin::PlacementStatus"); };
|
|
||||||
public: string _getString() const;
|
|
||||||
public: Record* _getRecord() const;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Attributes
|
protected:
|
||||||
// **********
|
Pin ( Net*
|
||||||
|
, const Name&
|
||||||
private: Name _name;
|
, const AccessDirection&
|
||||||
private: AccessDirection _accessDirection;
|
, const PlacementStatus&
|
||||||
private: PlacementStatus _placementStatus;
|
, const Layer*
|
||||||
private: Pin* _nextOfCellPinMap;
|
, DbU::Unit x
|
||||||
|
, DbU::Unit y
|
||||||
// Constructors
|
, DbU::Unit width
|
||||||
// ************
|
, DbU::Unit height
|
||||||
|
|
||||||
protected: Pin( Net* net
|
|
||||||
, const Name& name
|
|
||||||
, const AccessDirection& accessDirection
|
|
||||||
, const PlacementStatus& placementStatus
|
|
||||||
, const Layer* layer
|
|
||||||
, const DbU::Unit& x
|
|
||||||
, const DbU::Unit& y
|
|
||||||
, const DbU::Unit& width = 0
|
|
||||||
, const DbU::Unit& height = 0
|
|
||||||
);
|
);
|
||||||
public: static Pin* create( Net* net
|
public:
|
||||||
, const Name& name
|
static Pin* create ( Net*
|
||||||
, const AccessDirection& accessDirection
|
, const Name&
|
||||||
, const PlacementStatus& placementStatus
|
, const AccessDirection&
|
||||||
, const Layer* layer
|
, const PlacementStatus&
|
||||||
, const DbU::Unit& x
|
, const Layer*
|
||||||
, const DbU::Unit& y
|
, DbU::Unit x
|
||||||
, const DbU::Unit& width = 0
|
, DbU::Unit y
|
||||||
, const DbU::Unit& height = 0
|
, DbU::Unit width =0
|
||||||
|
, DbU::Unit height=0
|
||||||
);
|
);
|
||||||
|
public:
|
||||||
// Accessors
|
const Name& getName () const { return _name; };
|
||||||
// *********
|
const AccessDirection& getAccessDirection () const { return _accessDirection; };
|
||||||
|
const PlacementStatus& getPlacementStatus () const { return _placementStatus; };
|
||||||
public: const Name& getName() const {return _name;};
|
bool isUnplaced () const { return _placementStatus == PlacementStatus::UNPLACED; };
|
||||||
public: const AccessDirection& getAccessDirection() const {return _accessDirection;};
|
bool isPlaced () const { return _placementStatus == PlacementStatus::PLACED; };
|
||||||
public: const PlacementStatus& getPlacementStatus() const {return _placementStatus;};
|
bool isFixed () const { return _placementStatus == PlacementStatus::FIXED; };
|
||||||
|
void setPlacementStatus ( const PlacementStatus& );
|
||||||
// Predicates
|
protected:
|
||||||
// **********
|
virtual void _postCreate ();
|
||||||
|
virtual void _preDestroy ();
|
||||||
public: bool isUnplaced() const {return _placementStatus == PlacementStatus::UNPLACED;};
|
private:
|
||||||
public: bool isPlaced() const {return _placementStatus == PlacementStatus::PLACED;};
|
bool _postCheck ();
|
||||||
public: bool isFixed() const {return _placementStatus == PlacementStatus::FIXED;};
|
public:
|
||||||
|
virtual std::string _getTypeName () const {return _TName("Pin");};
|
||||||
// Updators
|
virtual std::string _getString () const;
|
||||||
// ********
|
virtual Record* _getRecord () const;
|
||||||
|
Pin* _getNextOfCellPinMap () const { return _nextOfCellPinMap; };
|
||||||
public: void setPlacementStatus(const PlacementStatus& placementstatus);
|
void _setNextOfCellPinMap ( Pin* pin ) { _nextOfCellPinMap = pin; };
|
||||||
|
private:
|
||||||
// Others
|
Name _name;
|
||||||
// ******
|
AccessDirection _accessDirection;
|
||||||
|
PlacementStatus _placementStatus;
|
||||||
protected: virtual void _postCreate();
|
Pin* _nextOfCellPinMap;
|
||||||
|
|
||||||
protected: virtual void _preDestroy();
|
|
||||||
|
|
||||||
public: virtual string _getTypeName() const {return _TName("Pin");};
|
|
||||||
public: virtual string _getString() const;
|
|
||||||
public: virtual Record* _getRecord() const;
|
|
||||||
|
|
||||||
public: Pin* _getNextOfCellPinMap() const {return _nextOfCellPinMap;};
|
|
||||||
|
|
||||||
public: void _setNextOfCellPinMap(Pin* pin) {_nextOfCellPinMap = pin;};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // Hurricane namespace.
|
||||||
|
|
||||||
|
|
||||||
INSPECTOR_P_SUPPORT(Hurricane::Pin);
|
INSPECTOR_P_SUPPORT(Hurricane::Pin);
|
||||||
INSPECTOR_PR_SUPPORT(Hurricane::Pin::AccessDirection);
|
INSPECTOR_PR_SUPPORT(Hurricane::Pin::AccessDirection);
|
||||||
INSPECTOR_PR_SUPPORT(Hurricane::Pin::PlacementStatus);
|
INSPECTOR_PR_SUPPORT(Hurricane::Pin::PlacementStatus);
|
||||||
|
|
||||||
|
|
||||||
#endif // HURRICANE_PIN
|
|
||||||
|
|
||||||
// ****************************************************************************************************
|
|
||||||
// Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
|
|
||||||
// ****************************************************************************************************
|
|
||||||
|
|
Loading…
Reference in New Issue