From e08bc9a40702f218bc408f0846c9c6e332d8c473 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 25 Nov 2020 21:51:43 +0100 Subject: [PATCH] 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). --- hurricane/src/hurricane/Contact.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/hurricane/src/hurricane/Contact.cpp b/hurricane/src/hurricane/Contact.cpp index 5e1e2214..8285d0d7 100644 --- a/hurricane/src/hurricane/Contact.cpp +++ b/hurricane/src/hurricane/Contact.cpp @@ -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)