2013-12-03 18:58:58 -06:00
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
|
|
|
// This file is part of the Coriolis Software.
|
Improved UpdateSession & exception catching. Start of RoutingGauge implem.
Miscellaneous:
* Change: In <crlcore>, in display.conf use the same display threshold
for both METAL2 & METAL3.
In alliance.conf, the side of VIAs in the gauge is 2l (not 3l).
In kite.conf, separate edge densities for H/V.
* Change: In <Cell>, in flattenNets() use flag as argument, not a
boolean. Do not create rings for clock or supply nets.
* Change: In <DeepNet>, in _createRoutingPads() do not create rings
for clock or supply net (duplicated policy as in Cell::flattenNets()).
* Bug: In <ControllerWidget>, at last find the bad signal disconnect
that was causing ungraceful messages.
* Change: In <knik>, in Edge display occupancy/capacity in the string
name. Improved display progress and debugging capabilities.
Improved exception catch & breakpoint managment:
* Bug: In <PaletteWidget>, in updateExtensions() replace the calls to
deleteLayer() by delete. This cause the widget to be immediatly
erased instead of waiting for the event queue to be completly
processed. This was causing the widget to be left in a incoherent
state when stoping at a breakpoint.
* Bug: In <BreakpointWidget>, in execNoModal(), flush the main event
loop (QApplication::flush()) *before* lauching the *local* event
loop. This is to ensure all widgets are in their final state when
waiting (especially <PaletteWidget>).
* Change: In <ExceptionWidget>, new method catchAllWrapper() to
execute any std::function< void() > function/method with a "try"/
"catch" wraparound and lauch the widget in case something is catch.
* New: In <hurricane>, support for a oberver pattern, backported from
<katabatic> with an Obervable capable of being linked to any
number of Obervers.
* New: In <Cell>, made it observable to detect Cell change, currently
emit two kind of signals:
- Cell::CellAboutToChange : *before* any change.
- Cell::CellChanged : *after* the change has been completed.
* New: In <UpdateSession>, in Go::invalidate() add the Cell owning the
Go to the UPDATOR_STACK (of course the cell is added only once).
In addition, when the Cell is added, send a notification of
Cell::CellAboutToChange to all it's observers. The slave instances
are also invalidated.
Conversely in UpdateSession::_preDestroy() for each invalidated
Cell send a Cell::CellChanged notification to all observer.
The UPDATOR_STACK has been slightly amended to accept Cell which
are not Gos. Prior to this, the Cell where completly excluded from
the UpdateSession mechanism, so it's instances where never actualised
of anything referring to the Cell for that matter.
Note: we use two different mechanisms to transmit a Cell change,
observers and the slave instance map. I think at some point it
should be unificated.
* Change: In <CellViewer>, make it a Cell observer to redraw when the
cell is modificated (also update the palette).
Uses the catchAllWrapper() to protect all critical actions.
* Change: In <GraphicTool>, no longer need of cellPreModificated and
cellPostModificated signals. Now done through the Cell obersvers.
* Change: In <mauka>, <etesian> & <kite> now uses the catchAllWrapper
method for protection (need to split methods in two, to be able
to pass it as argument). No longer emit cellPreModificated and
cellPostModificated.
Support for RoutingGauge in P&R:
* Bug: In <placeandroute.py>, the connection from the internal power
ring to the connectors was not done correctly. Wrong contact layers
leading to a gap.
* Change: In <BuildPowerRails>, detection of the corona signals based
on how the "pck_px" pad is connected. No longer based on name
matching.
* Change: In <placeandroute.py>, support for 2 routing metal only
(3 metal in the technology).
* Change: In <katabatic> & <kite> support for a "top layer" limitation
on the routing gauge, this allows to use only two routing metals
(METAL2 & METAL3). Work in progress.
2014-04-20 12:25:08 -05:00
|
|
|
// Copyright (c) UPMC 2012-2014, All Rights Reserved
|
2013-12-03 18:58:58 -06:00
|
|
|
//
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
// | C O R I O L I S |
|
|
|
|
// | K a t a b a t i c - Routing Toolbox |
|
|
|
|
// | |
|
|
|
|
// | Author : Jean-Paul CHAPUT |
|
|
|
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
|
|
|
// | =============================================================== |
|
|
|
|
// | C++ Module : "./AutoContactVTee.cpp" |
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <climits>
|
|
|
|
#include <sstream>
|
|
|
|
#include "hurricane/Bug.h"
|
|
|
|
#include "hurricane/Error.h"
|
|
|
|
#include "hurricane/Warning.h"
|
|
|
|
#include "hurricane/Layer.h"
|
|
|
|
#include "hurricane/ViaLayer.h"
|
|
|
|
#include "hurricane/BasicLayer.h"
|
|
|
|
#include "hurricane/Technology.h"
|
|
|
|
#include "hurricane/Net.h"
|
|
|
|
#include "hurricane/Plug.h"
|
|
|
|
#include "hurricane/Vertical.h"
|
|
|
|
#include "hurricane/Horizontal.h"
|
|
|
|
#include "hurricane/DebugSession.h"
|
|
|
|
#include "crlcore/RoutingGauge.h"
|
|
|
|
#include "katabatic/AutoContactVTee.h"
|
|
|
|
#include "katabatic/AutoVertical.h"
|
|
|
|
#include "katabatic/AutoHorizontal.h"
|
|
|
|
#include "katabatic/Session.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Katabatic {
|
|
|
|
|
|
|
|
using Hurricane::Bug;
|
|
|
|
using Hurricane::Error;
|
|
|
|
using Hurricane::DebugSession;
|
|
|
|
using Hurricane::ltracein;
|
|
|
|
using Hurricane::ltraceout;
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "Katabatic::AutoContactVTee".
|
|
|
|
|
|
|
|
|
|
|
|
AutoContactVTee* AutoContactVTee::create ( GCell* gcell, Net* net, const Layer* layer )
|
|
|
|
{
|
Improved UpdateSession & exception catching. Start of RoutingGauge implem.
Miscellaneous:
* Change: In <crlcore>, in display.conf use the same display threshold
for both METAL2 & METAL3.
In alliance.conf, the side of VIAs in the gauge is 2l (not 3l).
In kite.conf, separate edge densities for H/V.
* Change: In <Cell>, in flattenNets() use flag as argument, not a
boolean. Do not create rings for clock or supply nets.
* Change: In <DeepNet>, in _createRoutingPads() do not create rings
for clock or supply net (duplicated policy as in Cell::flattenNets()).
* Bug: In <ControllerWidget>, at last find the bad signal disconnect
that was causing ungraceful messages.
* Change: In <knik>, in Edge display occupancy/capacity in the string
name. Improved display progress and debugging capabilities.
Improved exception catch & breakpoint managment:
* Bug: In <PaletteWidget>, in updateExtensions() replace the calls to
deleteLayer() by delete. This cause the widget to be immediatly
erased instead of waiting for the event queue to be completly
processed. This was causing the widget to be left in a incoherent
state when stoping at a breakpoint.
* Bug: In <BreakpointWidget>, in execNoModal(), flush the main event
loop (QApplication::flush()) *before* lauching the *local* event
loop. This is to ensure all widgets are in their final state when
waiting (especially <PaletteWidget>).
* Change: In <ExceptionWidget>, new method catchAllWrapper() to
execute any std::function< void() > function/method with a "try"/
"catch" wraparound and lauch the widget in case something is catch.
* New: In <hurricane>, support for a oberver pattern, backported from
<katabatic> with an Obervable capable of being linked to any
number of Obervers.
* New: In <Cell>, made it observable to detect Cell change, currently
emit two kind of signals:
- Cell::CellAboutToChange : *before* any change.
- Cell::CellChanged : *after* the change has been completed.
* New: In <UpdateSession>, in Go::invalidate() add the Cell owning the
Go to the UPDATOR_STACK (of course the cell is added only once).
In addition, when the Cell is added, send a notification of
Cell::CellAboutToChange to all it's observers. The slave instances
are also invalidated.
Conversely in UpdateSession::_preDestroy() for each invalidated
Cell send a Cell::CellChanged notification to all observer.
The UPDATOR_STACK has been slightly amended to accept Cell which
are not Gos. Prior to this, the Cell where completly excluded from
the UpdateSession mechanism, so it's instances where never actualised
of anything referring to the Cell for that matter.
Note: we use two different mechanisms to transmit a Cell change,
observers and the slave instance map. I think at some point it
should be unificated.
* Change: In <CellViewer>, make it a Cell observer to redraw when the
cell is modificated (also update the palette).
Uses the catchAllWrapper() to protect all critical actions.
* Change: In <GraphicTool>, no longer need of cellPreModificated and
cellPostModificated signals. Now done through the Cell obersvers.
* Change: In <mauka>, <etesian> & <kite> now uses the catchAllWrapper
method for protection (need to split methods in two, to be able
to pass it as argument). No longer emit cellPreModificated and
cellPostModificated.
Support for RoutingGauge in P&R:
* Bug: In <placeandroute.py>, the connection from the internal power
ring to the connectors was not done correctly. Wrong contact layers
leading to a gap.
* Change: In <BuildPowerRails>, detection of the corona signals based
on how the "pck_px" pad is connected. No longer based on name
matching.
* Change: In <placeandroute.py>, support for 2 routing metal only
(3 metal in the technology).
* Change: In <katabatic> & <kite> support for a "top layer" limitation
on the routing gauge, this allows to use only two routing metals
(METAL2 & METAL3). Work in progress.
2014-04-20 12:25:08 -05:00
|
|
|
DbU::Unit viaSide = Session::getViaWidth( layer );
|
|
|
|
Contact* contact = Contact::create( net
|
|
|
|
, layer
|
|
|
|
, gcell->getCenter().getX()
|
|
|
|
, gcell->getCenter().getY()
|
|
|
|
, viaSide
|
|
|
|
, viaSide
|
|
|
|
);
|
2013-12-03 18:58:58 -06:00
|
|
|
AutoContactVTee* autoContact = new AutoContactVTee( gcell, contact );
|
|
|
|
|
|
|
|
autoContact->_postCreate();
|
|
|
|
autoContact->unsetFlags( CntInCreationStage );
|
|
|
|
|
|
|
|
ltrace(90) << "create(net*) " << autoContact << endl;
|
|
|
|
return autoContact;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AutoContactVTee::AutoContactVTee ( GCell* gcell, Contact* contact )
|
|
|
|
: AutoContact(gcell,contact)
|
|
|
|
, _horizontal1(NULL)
|
|
|
|
, _vertical1 (NULL)
|
|
|
|
, _vertical2 (NULL)
|
|
|
|
{
|
|
|
|
setFlags( CntVTee );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AutoContactVTee::~AutoContactVTee ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
AutoSegment* AutoContactVTee::getOpposite ( const AutoSegment* from ) const
|
|
|
|
{
|
|
|
|
if (from == _vertical1) return _vertical2;
|
|
|
|
if (from == _vertical2) return _vertical1;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AutoSegment* AutoContactVTee::getSegment ( unsigned int index ) const
|
|
|
|
{
|
|
|
|
switch ( index ) {
|
|
|
|
case 0: return _horizontal1;
|
|
|
|
case 2: return _vertical1;
|
|
|
|
case 3: return _vertical2;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactVTee::_invalidate ( unsigned int )
|
|
|
|
{
|
|
|
|
unsigned int flags = KbPropagate;
|
|
|
|
if (_vertical1 and _vertical2) {
|
|
|
|
if (_vertical1->isInvalidated() xor _vertical2->isInvalidated())
|
|
|
|
flags = KbNoFlags;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_vertical1 ) _vertical1 ->invalidate( flags );
|
|
|
|
if (_vertical2 ) _vertical2 ->invalidate( flags );
|
|
|
|
if (_horizontal1) _horizontal1->invalidate();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactVTee::cacheDetach ( AutoSegment* segment )
|
|
|
|
{
|
|
|
|
if (segment == _horizontal1) _horizontal1 = NULL;
|
|
|
|
else if (segment == _vertical1) _vertical1 = NULL;
|
|
|
|
else if (segment == _vertical2) _vertical2 = NULL;
|
|
|
|
else return;
|
|
|
|
|
|
|
|
setFlags( CntInvalidatedCache );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactVTee::cacheAttach ( AutoSegment* segment )
|
|
|
|
{
|
|
|
|
if (segment->getDirection() == KbVertical) {
|
|
|
|
if (not _vertical1) _vertical1 = static_cast<AutoVertical*>(segment);
|
|
|
|
else if (not _vertical2) _vertical2 = static_cast<AutoVertical*>(segment);
|
|
|
|
else {
|
|
|
|
cerr << Bug( "%s::cacheAttach() On %s,\n"
|
|
|
|
" v1 & v2 cache have not been cleared first, cancelling."
|
|
|
|
, _getTypeName().c_str(), getString(this).c_str()
|
|
|
|
) << endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else if (segment->getDirection() == KbHorizontal) {
|
|
|
|
if (_horizontal1) {
|
|
|
|
cerr << Bug( "%s::cacheAttach() On %s,\n"
|
|
|
|
" h1 cache has not been cleared first, cancelling."
|
|
|
|
, _getTypeName().c_str(), getString(this).c_str()
|
|
|
|
) << endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_horizontal1 = static_cast<AutoHorizontal*>(segment);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_vertical1 and _vertical2 and _horizontal1)
|
|
|
|
unsetFlags( CntInvalidatedCache );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactVTee::updateCache ()
|
|
|
|
{
|
|
|
|
DebugSession::open( getNet(), 80 );
|
|
|
|
|
|
|
|
ltrace(110) << "AutoContactVTee::updateCache() " << this << endl;
|
|
|
|
ltracein(110);
|
|
|
|
|
|
|
|
Component* anchor;
|
|
|
|
Horizontal** horizontals = new Horizontal* [3];
|
|
|
|
Vertical** verticals = new Vertical* [3];
|
|
|
|
|
|
|
|
_getTopology ( anchor, horizontals, verticals, 3 );
|
|
|
|
|
|
|
|
_horizontal1 = static_cast<AutoHorizontal*>( Session::lookup(horizontals[0]) );
|
|
|
|
_vertical1 = static_cast<AutoVertical *>( Session::lookup(verticals [0]) );
|
|
|
|
_vertical2 = static_cast<AutoVertical *>( Session::lookup(verticals [1]) );
|
|
|
|
|
|
|
|
string message;
|
|
|
|
if (verticals [0] == NULL) message = "VTee has less than two vertical segments.";
|
|
|
|
else if (verticals [1] == NULL) message = "VTee has less than two vertical segments.";
|
|
|
|
else if (verticals [2] != NULL) message = "VTee has more than two vertical segments.";
|
|
|
|
else if (horizontals[0] == NULL) message = "VTee is missing mandatory horizontal segment.";
|
|
|
|
else if (horizontals[1] != NULL) message = "VTee has more than one horizontal segment.";
|
|
|
|
else if ( (not _vertical1->isCreated() and not _vertical2->isCreated())
|
|
|
|
and (_vertical1->getY() != _vertical2->getY()) )
|
|
|
|
message = "VTee has misaligned vertical segments";
|
|
|
|
if (not message.empty() ) {
|
|
|
|
showTopologyError( message );
|
|
|
|
setFlags( CntBadTopology );
|
|
|
|
}
|
|
|
|
unsetFlags( CntInvalidatedCache );
|
|
|
|
|
|
|
|
ltrace(110) << "h1:" << _horizontal1 << endl;
|
|
|
|
ltrace(110) << "v1:" << _vertical1 << endl;
|
|
|
|
ltrace(110) << "v2:" << _vertical2 << endl;
|
|
|
|
|
|
|
|
delete [] horizontals;
|
|
|
|
delete [] verticals;
|
|
|
|
|
|
|
|
ltraceout(110);
|
|
|
|
DebugSession::close();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactVTee::updateGeometry ()
|
|
|
|
{
|
|
|
|
DebugSession::open( getNet(), 80 );
|
|
|
|
|
|
|
|
ltrace(110) << "AutoContactVTee::updateGeometry() " << this << endl;
|
|
|
|
ltracein(110);
|
|
|
|
|
|
|
|
if (isInvalidatedCache()) updateCache();
|
|
|
|
if (isInvalidatedCache()) {
|
|
|
|
cerr << Error( "%s::updateGeometry() %s: Unable to restore cache."
|
|
|
|
, _getTypeName().c_str(), getString(this).c_str() ) << endl;
|
|
|
|
ltraceout(110);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
base()->invalidate( false );
|
|
|
|
unsetFlags( CntInvalidated );
|
|
|
|
|
|
|
|
if (not hasBadTopology()) {
|
|
|
|
setX( getVertical1 ()->getX() );
|
|
|
|
setY( getHorizontal1()->getY() );
|
|
|
|
}
|
|
|
|
|
|
|
|
ltraceout(110);
|
|
|
|
DebugSession::close();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactVTee::updateTopology ()
|
|
|
|
{
|
|
|
|
DebugSession::open ( getNet(), 80 );
|
|
|
|
|
|
|
|
ltrace(110) << "AutoContactVTee::updateTopology() " << this << endl;
|
|
|
|
ltracein(110);
|
|
|
|
|
|
|
|
if (isInvalidatedCache()) updateCache();
|
|
|
|
if (isInvalidatedCache()) {
|
|
|
|
cerr << Error( "%s::updateGeometry() %s: Unable to restore cache."
|
|
|
|
, _getTypeName().c_str(), getString(this).c_str() ) << endl;
|
|
|
|
ltraceout(110);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (not hasBadTopology()) {
|
|
|
|
RoutingGauge* rg = Session::getRoutingGauge();
|
|
|
|
size_t depthV1 = rg->getLayerDepth( getVertical1 ()->getLayer() );
|
|
|
|
size_t depthV2 = rg->getLayerDepth( getVertical2 ()->getLayer() );
|
|
|
|
size_t depthH1 = rg->getLayerDepth( getHorizontal1()->getLayer() );
|
|
|
|
size_t minDepth = std::min( depthH1, std::min(depthV1,depthV2) );
|
|
|
|
size_t maxDepth = std::max( depthH1, std::max(depthV1,depthV2) );
|
|
|
|
size_t delta = maxDepth - minDepth;
|
|
|
|
|
|
|
|
ltrace(110) << "minDepth:" << minDepth << endl;
|
|
|
|
ltrace(110) << "maxDepth:" << maxDepth << endl;
|
|
|
|
ltrace(110) << "delta:" << delta << endl;
|
|
|
|
|
|
|
|
if ( maxDepth - minDepth > 3 ) {
|
|
|
|
showTopologyError( "Sheared VTee, layer delta exceed 3." );
|
|
|
|
setFlags( CntBadTopology );
|
|
|
|
} else {
|
|
|
|
if (depthV1 == depthV2) {
|
|
|
|
ltrace(110) << "depthV1 == depthV2 (" << depthV1 << ")" << endl;
|
|
|
|
// Dogleg on the horizontal.
|
|
|
|
switch ( delta ) {
|
|
|
|
case 0: setLayer( rg->getRoutingLayer(minDepth) ); break;
|
|
|
|
case 1: setLayer( rg->getContactLayer(minDepth) ); break;
|
|
|
|
default:
|
|
|
|
ltrace(110) << "Restore connectivity: dogleg on h1." << endl;
|
|
|
|
setLayer( rg->getContactLayer( depthV1 + ((depthV1==minDepth)?0:-1) ) );
|
|
|
|
_horizontal1 = static_cast<AutoHorizontal*>( _horizontal1->makeDogleg(this) );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// Dogleg on the vertical with the greater gap (should be equal to +/-2).
|
|
|
|
int deltaV1 = (int)depthV1 - (int)depthH1;
|
|
|
|
int deltaV2 = (int)depthV2 - (int)depthH1;
|
|
|
|
|
|
|
|
if (std::abs(deltaV1) > std::abs(deltaV2)) {
|
|
|
|
setLayer( rg->getContactLayer( depthV2 + ((depthV2<depthH1)?0:-1) ) );
|
|
|
|
//_vertical1 = static_cast<AutoVertical*>( _vertical1->makeDogleg(this) );
|
|
|
|
_vertical1->makeDogleg(this);
|
|
|
|
} else {
|
|
|
|
setLayer( rg->getContactLayer( depthV1 + ((depthV1<depthH1)?0:-1) ) );
|
|
|
|
//_vertical2 = static_cast<AutoVertical*>( _vertical2->makeDogleg(this) );
|
|
|
|
_vertical2->makeDogleg(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
Support of RoutingGauge, part 2.
In Katabatic & Kite, remove all hard-coded values related to track pitches.
* New: In <Session>, add more convenience function to access RoutingGauge
characteristics.
* New: In <AutoSegment>, <AutoContact>, add support for the "depth spin",
that is, if the source/target contacts are going "top" or "down".
Used to compute the perpandicular pitch. Need a small modification
of the revalidation mechanism. The observers of <AutoSegment> are
notified when the spin changes.
* New: In <AutoSegment>, the getPPitch() method allow to compute the
"perpandicular pitch". For now it is simply the greatest from the
source perpandicular pitch and the target perpandicular pitch.
Make uses of the "depth spin".
* New: In <TrackElement>, <TrackSegment>, cache the perpandicular pitch.
Updated through the notification from the observable.
2014-05-19 10:58:38 -05:00
|
|
|
_horizontal1->invalidate( this );
|
|
|
|
_vertical1 ->invalidate( this );
|
|
|
|
_vertical2 ->invalidate( this );
|
2013-12-03 18:58:58 -06:00
|
|
|
|
|
|
|
ltraceout(110);
|
|
|
|
DebugSession::close ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string AutoContactVTee::_getTypeName () const
|
|
|
|
{ return "ContactVTee"; }
|
|
|
|
|
|
|
|
|
|
|
|
} // Katabatic namespace.
|