Check contacts for minimal size in real mode.

* Change: In Hurricane::Contact::Contact(), check width & hieight of
    the contact against the minimal size, if below, bellow a warning
    and increase the dimension.
      May too paranoid when used on turn in same metal (no cut).
This commit is contained in:
Jean-Paul Chaput 2020-11-25 21:51:43 +01:00
parent 29b57e86e5
commit e08bc9a407
1 changed files with 21 additions and 4 deletions

View File

@ -25,6 +25,7 @@
#include "hurricane/BasicLayer.h"
#include "hurricane/Plug.h"
#include "hurricane/Error.h"
#include "hurricane/Warning.h"
#include "hurricane/Slot.h"
namespace Hurricane {
@ -112,11 +113,27 @@ Contact::Contact(Net* net, const Layer* layer, const DbU::Unit& x, const DbU::Un
_width(width),
_height(height)
{
if (!_layer)
throw Error("Can't create " + _TName("Contact") + " : null layer");
if (not _layer)
throw Error("Contact::Contact(): Can't create " + _TName("Contact") + ", NULL layer.");
if ( _width < _layer->getMinimalSize() ) _width = _layer->getMinimalSize();
if ( _height < _layer->getMinimalSize() ) _height = _layer->getMinimalSize();
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)