2016-07-18 07:48:37 -05:00
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
|
|
|
// This file is part of the Coriolis Software.
|
|
|
|
// Copyright (c) UPMC 2012-2016, All Rights Reserved
|
|
|
|
//
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
// | C O R I O L I S |
|
|
|
|
// | A n a b a t i c - Routing Toolbox |
|
|
|
|
// | |
|
|
|
|
// | Author : Jean-Paul CHAPUT |
|
|
|
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
|
|
|
// | =============================================================== |
|
|
|
|
// | C++ Module : "./AutoContactTerminal.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/RoutingPad.h"
|
|
|
|
#include "hurricane/Vertical.h"
|
|
|
|
#include "hurricane/Horizontal.h"
|
|
|
|
#include "hurricane/DebugSession.h"
|
|
|
|
#include "crlcore/RoutingGauge.h"
|
|
|
|
#include "anabatic/AutoContactTerminal.h"
|
|
|
|
#include "anabatic/AutoContactTurn.h"
|
|
|
|
#include "anabatic/AutoVertical.h"
|
|
|
|
#include "anabatic/AutoHorizontal.h"
|
|
|
|
#include "anabatic/Session.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Anabatic {
|
|
|
|
|
|
|
|
using std::ostringstream;
|
|
|
|
using Hurricane::Bug;
|
|
|
|
using Hurricane::Error;
|
|
|
|
using Hurricane::DebugSession;
|
|
|
|
using Hurricane::Transformation;
|
|
|
|
using Hurricane::Entity;
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "Anabatic::AutoContactTerminal".
|
|
|
|
|
|
|
|
|
|
|
|
AutoContactTerminal* AutoContactTerminal::create ( GCell* gcell
|
|
|
|
, Component* anchor
|
|
|
|
, const Layer* layer
|
|
|
|
, Point point
|
|
|
|
, DbU::Unit width
|
|
|
|
, DbU::Unit height
|
|
|
|
)
|
|
|
|
{
|
|
|
|
cdebug_log(145,1) << "AutoContactTerminal::create(... Point, ...)" << endl;
|
|
|
|
cdebug_log(145,0) << "@" << point << endl;
|
|
|
|
|
|
|
|
anchor->getBodyHook()->detach();
|
|
|
|
|
|
|
|
AutoContactTerminal* autoContact = AutoContactTerminal::create( gcell
|
|
|
|
, anchor
|
|
|
|
, layer
|
|
|
|
, point.getX(), point.getY()
|
|
|
|
, width, height
|
|
|
|
);
|
|
|
|
cdebug_tabw(145,-1);
|
|
|
|
return autoContact;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AutoContactTerminal* AutoContactTerminal::create ( GCell* gcell
|
|
|
|
, Component* anchor
|
|
|
|
, const Layer* layer
|
|
|
|
, const DbU::Unit x
|
|
|
|
, const DbU::Unit y
|
|
|
|
, const DbU::Unit width
|
|
|
|
, const DbU::Unit height
|
|
|
|
)
|
|
|
|
{
|
|
|
|
cdebug_log(145,0) << "AutoContactTerminal::create(... x, y, ...)" << endl;
|
|
|
|
cdebug_log(145,0) << "@ x:" << DbU::getValueString(x) << " y:" << DbU::getValueString(y) << endl;
|
|
|
|
|
2016-08-27 08:59:12 -05:00
|
|
|
_preCreate( gcell, anchor->getNet(), layer );
|
|
|
|
|
2016-07-18 07:48:37 -05:00
|
|
|
Point anchorPosition = anchor->getPosition();
|
|
|
|
|
|
|
|
Contact* contact = Contact::create( anchor
|
|
|
|
, layer
|
|
|
|
, x - anchorPosition.getX()
|
|
|
|
, y - anchorPosition.getY()
|
|
|
|
, width
|
|
|
|
, height
|
|
|
|
);
|
|
|
|
AutoContactTerminal* autoContact = new AutoContactTerminal( gcell, contact );
|
|
|
|
|
|
|
|
autoContact->_postCreate();
|
|
|
|
autoContact->unsetFlags( CntInCreationStage );
|
|
|
|
|
|
|
|
cdebug_log(145,0) << "create(Component*) " << autoContact << endl;
|
|
|
|
return autoContact;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AutoContactTerminal::AutoContactTerminal ( GCell* gcell, Contact* contact )
|
|
|
|
: AutoContact(gcell,contact)
|
|
|
|
, _segment (NULL)
|
|
|
|
{
|
|
|
|
setFlags( CntTerminal );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AutoContactTerminal::~AutoContactTerminal ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
Apaired segments building for symmetric routing (step 1).
* Change: In Hurricane::BaseFlags, store flags in uint64_t instead of
unsigned int because we start to need more than 32 different flags
in some tools.
* New: In ::getString() & ::getRecord() templates, add support for
std::array<>.
* Change: In CRL::ToolEngine, add support for timer (time & memory
measurements) displaced from Katabatic. This way all ToolEngine
can use this feature. The _postCreate() method display the
memory just after ToolEngine allocation.
* Change: In Etesian::EtesianEngine, make use of the ToolEngine
builtin timer (remove the local one). Forgot to call the base
class _postCreate() and _preDestroy().
* Change: In Anabatic::AnabaticEngine, make use of the ToolEngine
builtin timer (remove the local one).
* New: In Anabatic, new AutoSegments_Connecteds() collection. This
Collection allows a deterministic walkthough *all* the AutoSegments
connected either to source or target of one AutoSegment.
* New: In Anabatic::AutoContactTerminal::isEndPoint() to check if an
AutoContactTerminal is the *only one* anchored on a RoutingPad,
thus being a true "end point" and not a kind of feed-through.
* New: In Katana::KatanaEngine, added support for symmetric nets.
Created new class DataSymmetric to store symmetric information
of a net (mainly the paired AutoSegments).
Added KatanaEngine::runSymmetricRouter(), for now only build
the DataSymmetric informations. More to come...
* Change: In Katana::GraphicKatanaEngine::_runTest(), now perform
symmetric information building the non-symmetric routing.
2017-03-12 13:34:12 -05:00
|
|
|
bool AutoContactTerminal::isEndPoint () const
|
|
|
|
{
|
|
|
|
RoutingPad* rp = dynamic_cast<RoutingPad*>( getAnchor() );
|
|
|
|
return (rp->getBodyHook()->getSlaveHooks().getSize() == 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-07-18 07:48:37 -05:00
|
|
|
AutoSegment* AutoContactTerminal::getOpposite ( const AutoSegment* ) const
|
|
|
|
{ return NULL; }
|
|
|
|
|
|
|
|
|
|
|
|
AutoSegment* AutoContactTerminal::getPerpandicular ( const AutoSegment* ) const
|
|
|
|
{ return NULL; }
|
|
|
|
|
|
|
|
|
|
|
|
AutoSegment* AutoContactTerminal::getSegment ( unsigned int index ) const
|
|
|
|
{
|
|
|
|
if (_segment) {
|
|
|
|
switch ( index ) {
|
|
|
|
case 0: return (_segment->isHorizontal()) ? _segment : NULL;
|
|
|
|
case 2: return (_segment->isVertical ()) ? _segment : NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Apaired segments building for symmetric routing (step 1).
* Change: In Hurricane::BaseFlags, store flags in uint64_t instead of
unsigned int because we start to need more than 32 different flags
in some tools.
* New: In ::getString() & ::getRecord() templates, add support for
std::array<>.
* Change: In CRL::ToolEngine, add support for timer (time & memory
measurements) displaced from Katabatic. This way all ToolEngine
can use this feature. The _postCreate() method display the
memory just after ToolEngine allocation.
* Change: In Etesian::EtesianEngine, make use of the ToolEngine
builtin timer (remove the local one). Forgot to call the base
class _postCreate() and _preDestroy().
* Change: In Anabatic::AnabaticEngine, make use of the ToolEngine
builtin timer (remove the local one).
* New: In Anabatic, new AutoSegments_Connecteds() collection. This
Collection allows a deterministic walkthough *all* the AutoSegments
connected either to source or target of one AutoSegment.
* New: In Anabatic::AutoContactTerminal::isEndPoint() to check if an
AutoContactTerminal is the *only one* anchored on a RoutingPad,
thus being a true "end point" and not a kind of feed-through.
* New: In Katana::KatanaEngine, added support for symmetric nets.
Created new class DataSymmetric to store symmetric information
of a net (mainly the paired AutoSegments).
Added KatanaEngine::runSymmetricRouter(), for now only build
the DataSymmetric informations. More to come...
* Change: In Katana::GraphicKatanaEngine::_runTest(), now perform
symmetric information building the non-symmetric routing.
2017-03-12 13:34:12 -05:00
|
|
|
RoutingPad* AutoContactTerminal::getRoutingPad () const
|
|
|
|
{ return dynamic_cast<RoutingPad*>(getAnchor()); }
|
|
|
|
|
|
|
|
|
|
|
|
AutoSegments AutoContactTerminal::getRpConnecteds () const
|
|
|
|
{ return AutoSegments_OnRoutingPad(this); }
|
|
|
|
|
|
|
|
|
2016-07-18 07:48:37 -05:00
|
|
|
Box AutoContactTerminal::getNativeConstraintBox () const
|
|
|
|
{
|
|
|
|
cdebug_log(145,1) << "AutoContactTerminal::getNativeConstraintBox()" << endl;
|
|
|
|
|
2016-10-05 16:43:07 -05:00
|
|
|
if (isUserNativeConstraints()) {
|
|
|
|
cdebug_log(145,1) << " Native constraints sets by user:" << getConstraintBox() << endl;
|
|
|
|
cdebug_tabw(145,-1);
|
2016-11-09 05:20:55 -06:00
|
|
|
cdebug_tabw(145,-1);
|
2016-10-05 16:43:07 -05:00
|
|
|
return getConstraintBox();
|
|
|
|
}
|
|
|
|
|
2016-07-18 07:48:37 -05:00
|
|
|
Component* component = getAnchor();
|
|
|
|
if (component == NULL) {
|
|
|
|
cerr << Error( "%s is not anchored.", getString(this).c_str() ) << endl;
|
|
|
|
cdebug_tabw(145,-1);
|
|
|
|
return _gcell->getBoundingBox ();
|
|
|
|
}
|
|
|
|
|
|
|
|
DbU::Unit xMin;
|
|
|
|
DbU::Unit xMax;
|
|
|
|
DbU::Unit yMin;
|
|
|
|
DbU::Unit yMax;
|
|
|
|
Vertical* vertical;
|
|
|
|
Horizontal* horizontal;
|
|
|
|
RoutingPad* routingPad;
|
|
|
|
|
|
|
|
if ( (horizontal = dynamic_cast<Horizontal*>(component)) ) {
|
|
|
|
cdebug_log(145,0) << "Anchor: " << horizontal << "@" << horizontal->getSourcePosition() << endl;
|
|
|
|
xMin = horizontal->getSourcePosition().getX();
|
|
|
|
xMax = horizontal->getTargetPosition().getX();
|
|
|
|
yMin = yMax
|
|
|
|
= horizontal->getTargetPosition().getY();
|
|
|
|
} else if ( (vertical = dynamic_cast<Vertical*>(component)) ) {
|
|
|
|
cdebug_log(145,0) << "Anchor: " << vertical << "@" << vertical->getSourcePosition() << endl;
|
|
|
|
yMin = vertical->getSourcePosition().getY();
|
|
|
|
yMax = vertical->getTargetPosition().getY();
|
|
|
|
xMin = xMax
|
|
|
|
= vertical->getTargetPosition().getX();
|
|
|
|
} else if ( (routingPad = dynamic_cast<RoutingPad*>(component)) ) {
|
|
|
|
Entity* entity = routingPad->getOccurrence().getEntity();
|
|
|
|
Transformation transf = routingPad->getOccurrence().getPath().getTransformation();
|
|
|
|
cdebug_log(145,0) << "Anchor: " << routingPad << endl;
|
|
|
|
|
|
|
|
int rpOrient = 1;
|
|
|
|
switch ( transf.getOrientation() ) {
|
|
|
|
case Transformation::Orientation::R1:
|
|
|
|
case Transformation::Orientation::R3:
|
|
|
|
case Transformation::Orientation::XR:
|
|
|
|
case Transformation::Orientation::YR:
|
|
|
|
rpOrient = 2;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dynamic_cast<Horizontal*>(entity)) {
|
|
|
|
// rpOrient *is* the rotation.
|
|
|
|
} else if ( dynamic_cast<Vertical*>(entity) ) {
|
|
|
|
// rpOrient is the inverse rotation.
|
|
|
|
rpOrient = (rpOrient == 1) ? 2 : 1;
|
|
|
|
} else {
|
|
|
|
rpOrient = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch ( rpOrient ) {
|
|
|
|
case 1:
|
|
|
|
xMin = routingPad->getSourcePosition().getX();
|
|
|
|
xMax = routingPad->getTargetPosition().getX();
|
|
|
|
yMin = yMax
|
|
|
|
= routingPad->getTargetPosition().getY();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
yMin = routingPad->getSourcePosition().getY();
|
|
|
|
yMax = routingPad->getTargetPosition().getY();
|
|
|
|
xMin = xMax
|
|
|
|
= routingPad->getTargetPosition().getX();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
xMin = xMax = routingPad->getPosition().getX();
|
|
|
|
yMin = yMax = routingPad->getPosition().getY();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
xMin = xMax = component->getPosition().getX();
|
|
|
|
yMin = yMax = component->getPosition().getY();
|
|
|
|
}
|
|
|
|
|
|
|
|
order( xMin, xMax );
|
|
|
|
order( yMin, yMax );
|
|
|
|
|
Katana manage wide wires, and they can also be symmetric.
* New: In Anabatic::AutoContact and the derived classes, manages wide
wires. The contact self dimension itself according to the segments
it is connected to. Special case for the AutoContactTerminal which
also read the size of the component it is anchored upon.
New refresh method "updateSize()" and flag CntInvalidatedWidth.
to compute the size.
In AutoContactTerminal, compute the constraint box according to
the width of the segment.
* New: In Anabatic::AutoSegment, flags are now implemented as "static const"
attributes of the class. The flags are stored into a uint64_t as
they are more than 32.
Added new flag "SegWide" and associated predicates.
* Change: In GCellTopology::_doHChannel() and GCellTopology::_doVChannel(),
uses the simpler overload of AutoSegment::create() in order to detect
the wire width automatically.
* New: In Katana::Manipulator, split insertToTrack() and forceToTrack()
into a one-track method and a segment level method that iterate over
the track span of the segment.
* New: In Katana::SegmentFsm, for each cost in the table, now allow access
to a specific track. So the base functions have now two parameters:
"icost" and "itrack" (has a cost can have multiple tracks in the case
of wide segments).
* Change: In Katana::TrackElement, remove the index of the element inside
it's track, as for a wide segment it will not be meaningful for the
non-base track. This means that we have to use the Track::find()
method each time instead.
Remove the wide flag, as it is a duplicate of the one in AutoSegment.
Added a getTrackCount() method to tell the number of track the
segment is inserted into. Needed in the Track destroy step to delete
a segment only when the last track that refers it is destroyed.
Added getSymmetricAxis() to correct the computation of the symmetric
base track in case of wide segment as the base track is not centered
but the the leftmost one.
* Change: In Track::insert() insert wide segments in their whole track span.
* Change: In TrackCost, create an array of costs according to the segment
track span.
* Change: In TrackSegment::create(), now activate the factory and create
wide segments.
* Bug: In Katana::AutoSegments_Perpandicular, correct the debug indentation
problem (ever shifting to the right).
2017-07-28 08:30:22 -05:00
|
|
|
Box bb ( xMin, yMin, xMax, yMax );
|
|
|
|
|
|
|
|
if (_segment and _segment->isWide()) {
|
|
|
|
if (dynamic_cast<AutoHorizontal*>(_segment)) bb.inflate( 0, 0, 0, -_segment->getWidth() );
|
|
|
|
else bb.inflate( 0, 0, -_segment->getWidth(), 0 );
|
|
|
|
}
|
|
|
|
|
2016-10-05 16:43:07 -05:00
|
|
|
cdebug_log(145,0) << "| Using (y): "
|
Katana manage wide wires, and they can also be symmetric.
* New: In Anabatic::AutoContact and the derived classes, manages wide
wires. The contact self dimension itself according to the segments
it is connected to. Special case for the AutoContactTerminal which
also read the size of the component it is anchored upon.
New refresh method "updateSize()" and flag CntInvalidatedWidth.
to compute the size.
In AutoContactTerminal, compute the constraint box according to
the width of the segment.
* New: In Anabatic::AutoSegment, flags are now implemented as "static const"
attributes of the class. The flags are stored into a uint64_t as
they are more than 32.
Added new flag "SegWide" and associated predicates.
* Change: In GCellTopology::_doHChannel() and GCellTopology::_doVChannel(),
uses the simpler overload of AutoSegment::create() in order to detect
the wire width automatically.
* New: In Katana::Manipulator, split insertToTrack() and forceToTrack()
into a one-track method and a segment level method that iterate over
the track span of the segment.
* New: In Katana::SegmentFsm, for each cost in the table, now allow access
to a specific track. So the base functions have now two parameters:
"icost" and "itrack" (has a cost can have multiple tracks in the case
of wide segments).
* Change: In Katana::TrackElement, remove the index of the element inside
it's track, as for a wide segment it will not be meaningful for the
non-base track. This means that we have to use the Track::find()
method each time instead.
Remove the wide flag, as it is a duplicate of the one in AutoSegment.
Added a getTrackCount() method to tell the number of track the
segment is inserted into. Needed in the Track destroy step to delete
a segment only when the last track that refers it is destroyed.
Added getSymmetricAxis() to correct the computation of the symmetric
base track in case of wide segment as the base track is not centered
but the the leftmost one.
* Change: In Track::insert() insert wide segments in their whole track span.
* Change: In TrackCost, create an array of costs according to the segment
track span.
* Change: In TrackSegment::create(), now activate the factory and create
wide segments.
* Bug: In Katana::AutoSegments_Perpandicular, correct the debug indentation
problem (ever shifting to the right).
2017-07-28 08:30:22 -05:00
|
|
|
<< DbU::getValueString(bb.getYMin()) << " "
|
|
|
|
<< DbU::getValueString(bb.getYMax()) << endl;
|
2016-07-18 07:48:37 -05:00
|
|
|
|
|
|
|
cdebug_tabw(145,-1);
|
Katana manage wide wires, and they can also be symmetric.
* New: In Anabatic::AutoContact and the derived classes, manages wide
wires. The contact self dimension itself according to the segments
it is connected to. Special case for the AutoContactTerminal which
also read the size of the component it is anchored upon.
New refresh method "updateSize()" and flag CntInvalidatedWidth.
to compute the size.
In AutoContactTerminal, compute the constraint box according to
the width of the segment.
* New: In Anabatic::AutoSegment, flags are now implemented as "static const"
attributes of the class. The flags are stored into a uint64_t as
they are more than 32.
Added new flag "SegWide" and associated predicates.
* Change: In GCellTopology::_doHChannel() and GCellTopology::_doVChannel(),
uses the simpler overload of AutoSegment::create() in order to detect
the wire width automatically.
* New: In Katana::Manipulator, split insertToTrack() and forceToTrack()
into a one-track method and a segment level method that iterate over
the track span of the segment.
* New: In Katana::SegmentFsm, for each cost in the table, now allow access
to a specific track. So the base functions have now two parameters:
"icost" and "itrack" (has a cost can have multiple tracks in the case
of wide segments).
* Change: In Katana::TrackElement, remove the index of the element inside
it's track, as for a wide segment it will not be meaningful for the
non-base track. This means that we have to use the Track::find()
method each time instead.
Remove the wide flag, as it is a duplicate of the one in AutoSegment.
Added a getTrackCount() method to tell the number of track the
segment is inserted into. Needed in the Track destroy step to delete
a segment only when the last track that refers it is destroyed.
Added getSymmetricAxis() to correct the computation of the symmetric
base track in case of wide segment as the base track is not centered
but the the leftmost one.
* Change: In Track::insert() insert wide segments in their whole track span.
* Change: In TrackCost, create an array of costs according to the segment
track span.
* Change: In TrackSegment::create(), now activate the factory and create
wide segments.
* Bug: In Katana::AutoSegments_Perpandicular, correct the debug indentation
problem (ever shifting to the right).
2017-07-28 08:30:22 -05:00
|
|
|
return bb;
|
2016-07-18 07:48:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Replace "unsigned int" by "Flags" in all AutoSegments collections.
* Change: In Anabatic::AutoSegments collections, change the type of all
the flags that where in "unsigned int" (32 bits) to Flags (uint64_t)
as there is now more than 32 flags for functions.
* New: In Ababatic::Constants, added new flag Flags::WithPerpands, which
makes the number of flags tip over 32 bits, thus making mandatory
to uses Flags and not unsigned int.
* New: In Anabatic::AutoSegments_Perpandiculars, manage a new flag
Flags::WithDoglegs to allow to propagate through global segments that
are connecteds via doglegs on local segments. Meaning that there is
a good chance that they could be aligned.
Slighly change the way we propagate on aligned segments: no longer
check for VTee or HTee, but only for same direction and layer as
master.
* New: In Anabatic & Katana, replace all the "int", "long" and their
variants by the less implementation ambiguous "int32_t", "int64_t"
(and variant). This should help to better detect bit trucation in
flags.
Use the type to give a hint about the flags kind:
- Type "Flags", for flags shared among Anabatic & Katana
functions/methods (may also appear in some objects states).
- Type "uint32_t" for flags belonging to an object internal
state of from Hurricane functions flags (those should be
grouped in a Flag subclass in a perfect world).
2017-05-16 07:53:33 -05:00
|
|
|
void AutoContactTerminal::_invalidate ( Flags flags )
|
2016-07-18 07:48:37 -05:00
|
|
|
{
|
|
|
|
if (_segment) _segment->invalidate();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactTerminal::cacheDetach ( AutoSegment* segment )
|
|
|
|
{
|
|
|
|
if (_segment == segment) {
|
|
|
|
_segment = NULL;
|
|
|
|
setFlags( CntInvalidatedCache );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactTerminal::cacheAttach ( AutoSegment* segment )
|
|
|
|
{
|
|
|
|
if (_segment) {
|
|
|
|
cerr << Bug( "%s::cacheAttach() On %s,\n"
|
|
|
|
" cache has not been cleared first, cancelled."
|
|
|
|
, _getTypeName().c_str(), getString(this).c_str()
|
|
|
|
) << endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_segment = segment;
|
|
|
|
unsetFlags( CntInvalidatedCache );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactTerminal::updateCache ()
|
|
|
|
{
|
|
|
|
DebugSession::open( getNet(), 140, 150 );
|
|
|
|
|
|
|
|
cdebug_log(145,1) << _getTypeName() << "::updateCache() " << this << endl;
|
|
|
|
|
|
|
|
Component* anchor;
|
|
|
|
Horizontal** horizontals = new Horizontal* [2];
|
|
|
|
Vertical** verticals = new Vertical* [2];
|
|
|
|
|
|
|
|
_getTopology( base(), anchor, horizontals, verticals, 2 );
|
|
|
|
|
|
|
|
if (anchor == NULL)
|
|
|
|
showTopologyError( "Terminal is missing an anchor (RoutingPad or Component)." );
|
|
|
|
|
|
|
|
size_t count = 0;
|
|
|
|
if (horizontals[0] != NULL) ++count;
|
|
|
|
if (horizontals[1] != NULL) ++count;
|
|
|
|
if (verticals [0] != NULL) ++count;
|
|
|
|
if (verticals [1] != NULL) ++count;
|
|
|
|
if (count > 1) {
|
|
|
|
showTopologyError( "Terminal has more than one segment." );
|
|
|
|
}
|
|
|
|
if (horizontals[0] != NULL ) {
|
|
|
|
_segment = Session::lookup( horizontals[0] );
|
|
|
|
} else {
|
|
|
|
_segment = Session::lookup( verticals[0] );
|
|
|
|
}
|
|
|
|
if (_segment == NULL) {
|
|
|
|
ostringstream os;
|
|
|
|
os << this << ", AutoSegment lookup failed for:"
|
|
|
|
<< "\n h1: " << horizontals[0]
|
|
|
|
<< "\n v1: " << verticals[0];
|
|
|
|
|
|
|
|
delete [] horizontals;
|
|
|
|
delete [] verticals;
|
|
|
|
|
|
|
|
showTopologyError( os.str() );
|
|
|
|
throw Error( os.str() );
|
|
|
|
}
|
|
|
|
unsetFlags( CntInvalidatedCache );
|
|
|
|
cdebug_log(145,0) << "seg:" << _segment << endl;
|
|
|
|
|
|
|
|
delete [] horizontals;
|
|
|
|
delete [] verticals;
|
|
|
|
|
|
|
|
cdebug_tabw(145,-1);
|
|
|
|
DebugSession::close();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactTerminal::updateGeometry ()
|
|
|
|
{
|
|
|
|
DebugSession::open( getNet(), 140, 150 );
|
|
|
|
|
|
|
|
cdebug_log(145,1) << _getTypeName() << "::updateGeometry() " << this << endl;
|
|
|
|
|
|
|
|
if (isInvalidatedCache()) updateCache();
|
|
|
|
if (isInvalidatedCache()) {
|
|
|
|
cerr << Error( "%s::updateGeometry() %s: Unable to restore cache."
|
|
|
|
, _getTypeName().c_str(), getString(this).c_str() ) << endl;
|
|
|
|
cdebug_tabw(145,-1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
base()->invalidate( false );
|
|
|
|
unsetFlags( CntInvalidated );
|
|
|
|
|
|
|
|
ostringstream message;
|
|
|
|
if (not hasBadTopology()) {
|
Katana manage wide wires, and they can also be symmetric.
* New: In Anabatic::AutoContact and the derived classes, manages wide
wires. The contact self dimension itself according to the segments
it is connected to. Special case for the AutoContactTerminal which
also read the size of the component it is anchored upon.
New refresh method "updateSize()" and flag CntInvalidatedWidth.
to compute the size.
In AutoContactTerminal, compute the constraint box according to
the width of the segment.
* New: In Anabatic::AutoSegment, flags are now implemented as "static const"
attributes of the class. The flags are stored into a uint64_t as
they are more than 32.
Added new flag "SegWide" and associated predicates.
* Change: In GCellTopology::_doHChannel() and GCellTopology::_doVChannel(),
uses the simpler overload of AutoSegment::create() in order to detect
the wire width automatically.
* New: In Katana::Manipulator, split insertToTrack() and forceToTrack()
into a one-track method and a segment level method that iterate over
the track span of the segment.
* New: In Katana::SegmentFsm, for each cost in the table, now allow access
to a specific track. So the base functions have now two parameters:
"icost" and "itrack" (has a cost can have multiple tracks in the case
of wide segments).
* Change: In Katana::TrackElement, remove the index of the element inside
it's track, as for a wide segment it will not be meaningful for the
non-base track. This means that we have to use the Track::find()
method each time instead.
Remove the wide flag, as it is a duplicate of the one in AutoSegment.
Added a getTrackCount() method to tell the number of track the
segment is inserted into. Needed in the Track destroy step to delete
a segment only when the last track that refers it is destroyed.
Added getSymmetricAxis() to correct the computation of the symmetric
base track in case of wide segment as the base track is not centered
but the the leftmost one.
* Change: In Track::insert() insert wide segments in their whole track span.
* Change: In TrackCost, create an array of costs according to the segment
track span.
* Change: In TrackSegment::create(), now activate the factory and create
wide segments.
* Bug: In Katana::AutoSegments_Perpandicular, correct the debug indentation
problem (ever shifting to the right).
2017-07-28 08:30:22 -05:00
|
|
|
Box anchorBb = getAnchor()->getBoundingBox();
|
|
|
|
anchorBb.inflate( Session::getViaWidth (getAnchor()->getLayer())
|
|
|
|
- Session::getWireWidth(getAnchor()->getLayer()) );
|
|
|
|
|
2016-07-18 07:48:37 -05:00
|
|
|
if (_segment->isHorizontal()) {
|
Katana manage wide wires, and they can also be symmetric.
* New: In Anabatic::AutoContact and the derived classes, manages wide
wires. The contact self dimension itself according to the segments
it is connected to. Special case for the AutoContactTerminal which
also read the size of the component it is anchored upon.
New refresh method "updateSize()" and flag CntInvalidatedWidth.
to compute the size.
In AutoContactTerminal, compute the constraint box according to
the width of the segment.
* New: In Anabatic::AutoSegment, flags are now implemented as "static const"
attributes of the class. The flags are stored into a uint64_t as
they are more than 32.
Added new flag "SegWide" and associated predicates.
* Change: In GCellTopology::_doHChannel() and GCellTopology::_doVChannel(),
uses the simpler overload of AutoSegment::create() in order to detect
the wire width automatically.
* New: In Katana::Manipulator, split insertToTrack() and forceToTrack()
into a one-track method and a segment level method that iterate over
the track span of the segment.
* New: In Katana::SegmentFsm, for each cost in the table, now allow access
to a specific track. So the base functions have now two parameters:
"icost" and "itrack" (has a cost can have multiple tracks in the case
of wide segments).
* Change: In Katana::TrackElement, remove the index of the element inside
it's track, as for a wide segment it will not be meaningful for the
non-base track. This means that we have to use the Track::find()
method each time instead.
Remove the wide flag, as it is a duplicate of the one in AutoSegment.
Added a getTrackCount() method to tell the number of track the
segment is inserted into. Needed in the Track destroy step to delete
a segment only when the last track that refers it is destroyed.
Added getSymmetricAxis() to correct the computation of the symmetric
base track in case of wide segment as the base track is not centered
but the the leftmost one.
* Change: In Track::insert() insert wide segments in their whole track span.
* Change: In TrackCost, create an array of costs according to the segment
track span.
* Change: In TrackSegment::create(), now activate the factory and create
wide segments.
* Bug: In Katana::AutoSegments_Perpandicular, correct the debug indentation
problem (ever shifting to the right).
2017-07-28 08:30:22 -05:00
|
|
|
DbU::Unit axis = _segment->getY();
|
|
|
|
if (_segment->isWide()) {
|
|
|
|
axis += (- _segment->getWidth() + Session::getWireWidth(_segment->getLayer())) / 2;
|
|
|
|
setHeight( _segment->getContactWidth() );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (not getUConstraints(Flags::Vertical).contains(axis)) {
|
2016-07-18 07:48:37 -05:00
|
|
|
cdebug_log(145,0) << "Cached: " << _segment << endl;
|
Katana manage wide wires, and they can also be symmetric.
* New: In Anabatic::AutoContact and the derived classes, manages wide
wires. The contact self dimension itself according to the segments
it is connected to. Special case for the AutoContactTerminal which
also read the size of the component it is anchored upon.
New refresh method "updateSize()" and flag CntInvalidatedWidth.
to compute the size.
In AutoContactTerminal, compute the constraint box according to
the width of the segment.
* New: In Anabatic::AutoSegment, flags are now implemented as "static const"
attributes of the class. The flags are stored into a uint64_t as
they are more than 32.
Added new flag "SegWide" and associated predicates.
* Change: In GCellTopology::_doHChannel() and GCellTopology::_doVChannel(),
uses the simpler overload of AutoSegment::create() in order to detect
the wire width automatically.
* New: In Katana::Manipulator, split insertToTrack() and forceToTrack()
into a one-track method and a segment level method that iterate over
the track span of the segment.
* New: In Katana::SegmentFsm, for each cost in the table, now allow access
to a specific track. So the base functions have now two parameters:
"icost" and "itrack" (has a cost can have multiple tracks in the case
of wide segments).
* Change: In Katana::TrackElement, remove the index of the element inside
it's track, as for a wide segment it will not be meaningful for the
non-base track. This means that we have to use the Track::find()
method each time instead.
Remove the wide flag, as it is a duplicate of the one in AutoSegment.
Added a getTrackCount() method to tell the number of track the
segment is inserted into. Needed in the Track destroy step to delete
a segment only when the last track that refers it is destroyed.
Added getSymmetricAxis() to correct the computation of the symmetric
base track in case of wide segment as the base track is not centered
but the the leftmost one.
* Change: In Track::insert() insert wide segments in their whole track span.
* Change: In TrackCost, create an array of costs according to the segment
track span.
* Change: In TrackSegment::create(), now activate the factory and create
wide segments.
* Bug: In Katana::AutoSegments_Perpandicular, correct the debug indentation
problem (ever shifting to the right).
2017-07-28 08:30:22 -05:00
|
|
|
message << "Terminal horizontal segment Y " << DbU::getValueString(axis)
|
2016-07-18 07:48:37 -05:00
|
|
|
<< " axis is outside RoutingPad " << getUConstraints(Flags::Vertical) << ".";
|
|
|
|
|
Anabatic transient commit 18. Port of Kite (Katana), Yeah, Baby! Yeah!
* Bug: In Hurricane, in StaticObservable::getObserver(), if the slot
pointer is NULL, do not try to access the owner. Returns NULL, so
the caller can be aware of the situation...
* Change: In Hurricane, in BreakpointWidget & ExceptionWidget some
cosmetic changes (fonts and window sizes).
* Bug: In Anabatic, In AutoHorizontal::getConstraints(), take into account
the constraints from the source AutoContact, as it holds the constraints
transmitted by the RoutingPads and sets up by propageConstraintsFromRp().
It is likely to be a bug affecting the original Katabatic as well.
* Change: In Anabatic, in RawGCellsUnder(), check that the segment is not
completly oustside the cell abutment box and truncate the coordinates
to the part that is inside. Use the "shrink" if we reach the east/north
border.
* Change: In Anabatic, in Configuration, no more decorator because we will
use a true derived relationship. Katana *derives* from *Anabatic* and do
not *decorate* it, so the Configuration can do the same. It also implies
that we directly create a Katana engine, not an Anabatic one.
* Change: In Anabatic, in Session, do not allow the opening of the Session
in a standalone fashion (with a static method). Instead it must be opened
using the relevant method of the Anabatic/Katana engine. This ensure we
are opening the right Session type.
* Change: In Anabatic, in AutoSegment_Aligneds() collection the seed segment
is not part of the collection by default, but will be included if the
Flags::WithSelf is set.
* Change: In Configuration, all the flags value are now defined in two steps.
Declared in the header and initialized in the module. This is to prevent
the fact that on some cases, in relation with the Python "extern C" part
modules, we need a true allocated variable. It was causing weird linking
problems.
A side effect is that they can no longer be used as entry is switches,
have to replace them by if/else.
* New: In Anabatic, new GCell::getNeighborAt() utility function.
* Bug: In Anabatic, in GCell::doGrid(), tag all the GCells of the grid with
the grid type... Back annote all the edges capacity (north & east) with
the reserved local capacity.
* New: Complete portage of Kite over Anabatic. The new engine is christened
"Katana" for Kite-Analogic. When it's capabilities and performances
will be on a part with Kite, it is to completly replace it (and take
back the "Kite" name). Preliminary tests seems to show that, contrary
to intuition (because built on a more complex/slower grid), it is even
slightly faster than Kite 8-).
2016-08-15 09:30:13 -05:00
|
|
|
Interval intv;
|
|
|
|
_segment->getConstraints( intv );
|
|
|
|
message << "\n Segment constraints: " << intv << endl;
|
|
|
|
|
Replace "unsigned int" by "Flags" in all AutoSegments collections.
* Change: In Anabatic::AutoSegments collections, change the type of all
the flags that where in "unsigned int" (32 bits) to Flags (uint64_t)
as there is now more than 32 flags for functions.
* New: In Ababatic::Constants, added new flag Flags::WithPerpands, which
makes the number of flags tip over 32 bits, thus making mandatory
to uses Flags and not unsigned int.
* New: In Anabatic::AutoSegments_Perpandiculars, manage a new flag
Flags::WithDoglegs to allow to propagate through global segments that
are connecteds via doglegs on local segments. Meaning that there is
a good chance that they could be aligned.
Slighly change the way we propagate on aligned segments: no longer
check for VTee or HTee, but only for same direction and layer as
master.
* New: In Anabatic & Katana, replace all the "int", "long" and their
variants by the less implementation ambiguous "int32_t", "int64_t"
(and variant). This should help to better detect bit trucation in
flags.
Use the type to give a hint about the flags kind:
- Type "Flags", for flags shared among Anabatic & Katana
functions/methods (may also appear in some objects states).
- Type "uint32_t" for flags belonging to an object internal
state of from Hurricane functions flags (those should be
grouped in a Flag subclass in a perfect world).
2017-05-16 07:53:33 -05:00
|
|
|
Flags flags = Flags::NoFlags;
|
2016-07-18 07:48:37 -05:00
|
|
|
if (_segment->isCreated()) flags |= Flags::CParanoid;
|
|
|
|
showTopologyError( message.str(), flags );
|
|
|
|
} else
|
|
|
|
setY( _segment->getY() );
|
|
|
|
} else {
|
Katana manage wide wires, and they can also be symmetric.
* New: In Anabatic::AutoContact and the derived classes, manages wide
wires. The contact self dimension itself according to the segments
it is connected to. Special case for the AutoContactTerminal which
also read the size of the component it is anchored upon.
New refresh method "updateSize()" and flag CntInvalidatedWidth.
to compute the size.
In AutoContactTerminal, compute the constraint box according to
the width of the segment.
* New: In Anabatic::AutoSegment, flags are now implemented as "static const"
attributes of the class. The flags are stored into a uint64_t as
they are more than 32.
Added new flag "SegWide" and associated predicates.
* Change: In GCellTopology::_doHChannel() and GCellTopology::_doVChannel(),
uses the simpler overload of AutoSegment::create() in order to detect
the wire width automatically.
* New: In Katana::Manipulator, split insertToTrack() and forceToTrack()
into a one-track method and a segment level method that iterate over
the track span of the segment.
* New: In Katana::SegmentFsm, for each cost in the table, now allow access
to a specific track. So the base functions have now two parameters:
"icost" and "itrack" (has a cost can have multiple tracks in the case
of wide segments).
* Change: In Katana::TrackElement, remove the index of the element inside
it's track, as for a wide segment it will not be meaningful for the
non-base track. This means that we have to use the Track::find()
method each time instead.
Remove the wide flag, as it is a duplicate of the one in AutoSegment.
Added a getTrackCount() method to tell the number of track the
segment is inserted into. Needed in the Track destroy step to delete
a segment only when the last track that refers it is destroyed.
Added getSymmetricAxis() to correct the computation of the symmetric
base track in case of wide segment as the base track is not centered
but the the leftmost one.
* Change: In Track::insert() insert wide segments in their whole track span.
* Change: In TrackCost, create an array of costs according to the segment
track span.
* Change: In TrackSegment::create(), now activate the factory and create
wide segments.
* Bug: In Katana::AutoSegments_Perpandicular, correct the debug indentation
problem (ever shifting to the right).
2017-07-28 08:30:22 -05:00
|
|
|
DbU::Unit axis = _segment->getX();
|
|
|
|
if (_segment->isWide()) {
|
|
|
|
axis += (- _segment->getWidth() + Session::getWireWidth(_segment->getLayer())) / 2;
|
|
|
|
setWidth ( _segment->getContactWidth() );
|
|
|
|
setHeight( anchorBb.getHeight() );
|
|
|
|
|
|
|
|
cdebug_log(145,0) << "Contact for wide segment." << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (not getUConstraints(Flags::Horizontal).contains(axis)) {
|
2016-07-18 07:48:37 -05:00
|
|
|
cdebug_log(145,0) << "Cached: " << _segment << endl;
|
Katana manage wide wires, and they can also be symmetric.
* New: In Anabatic::AutoContact and the derived classes, manages wide
wires. The contact self dimension itself according to the segments
it is connected to. Special case for the AutoContactTerminal which
also read the size of the component it is anchored upon.
New refresh method "updateSize()" and flag CntInvalidatedWidth.
to compute the size.
In AutoContactTerminal, compute the constraint box according to
the width of the segment.
* New: In Anabatic::AutoSegment, flags are now implemented as "static const"
attributes of the class. The flags are stored into a uint64_t as
they are more than 32.
Added new flag "SegWide" and associated predicates.
* Change: In GCellTopology::_doHChannel() and GCellTopology::_doVChannel(),
uses the simpler overload of AutoSegment::create() in order to detect
the wire width automatically.
* New: In Katana::Manipulator, split insertToTrack() and forceToTrack()
into a one-track method and a segment level method that iterate over
the track span of the segment.
* New: In Katana::SegmentFsm, for each cost in the table, now allow access
to a specific track. So the base functions have now two parameters:
"icost" and "itrack" (has a cost can have multiple tracks in the case
of wide segments).
* Change: In Katana::TrackElement, remove the index of the element inside
it's track, as for a wide segment it will not be meaningful for the
non-base track. This means that we have to use the Track::find()
method each time instead.
Remove the wide flag, as it is a duplicate of the one in AutoSegment.
Added a getTrackCount() method to tell the number of track the
segment is inserted into. Needed in the Track destroy step to delete
a segment only when the last track that refers it is destroyed.
Added getSymmetricAxis() to correct the computation of the symmetric
base track in case of wide segment as the base track is not centered
but the the leftmost one.
* Change: In Track::insert() insert wide segments in their whole track span.
* Change: In TrackCost, create an array of costs according to the segment
track span.
* Change: In TrackSegment::create(), now activate the factory and create
wide segments.
* Bug: In Katana::AutoSegments_Perpandicular, correct the debug indentation
problem (ever shifting to the right).
2017-07-28 08:30:22 -05:00
|
|
|
message << "Terminal vertical segment X" << DbU::getValueString(axis)
|
2016-07-18 07:48:37 -05:00
|
|
|
<< " axis is outside RoutingPad " << getUConstraints(Flags::Horizontal) << ".";
|
|
|
|
|
Replace "unsigned int" by "Flags" in all AutoSegments collections.
* Change: In Anabatic::AutoSegments collections, change the type of all
the flags that where in "unsigned int" (32 bits) to Flags (uint64_t)
as there is now more than 32 flags for functions.
* New: In Ababatic::Constants, added new flag Flags::WithPerpands, which
makes the number of flags tip over 32 bits, thus making mandatory
to uses Flags and not unsigned int.
* New: In Anabatic::AutoSegments_Perpandiculars, manage a new flag
Flags::WithDoglegs to allow to propagate through global segments that
are connecteds via doglegs on local segments. Meaning that there is
a good chance that they could be aligned.
Slighly change the way we propagate on aligned segments: no longer
check for VTee or HTee, but only for same direction and layer as
master.
* New: In Anabatic & Katana, replace all the "int", "long" and their
variants by the less implementation ambiguous "int32_t", "int64_t"
(and variant). This should help to better detect bit trucation in
flags.
Use the type to give a hint about the flags kind:
- Type "Flags", for flags shared among Anabatic & Katana
functions/methods (may also appear in some objects states).
- Type "uint32_t" for flags belonging to an object internal
state of from Hurricane functions flags (those should be
grouped in a Flag subclass in a perfect world).
2017-05-16 07:53:33 -05:00
|
|
|
Flags flags = Flags::NoFlags;
|
2016-07-18 07:48:37 -05:00
|
|
|
if (_segment->isCreated()) flags |= Flags::CParanoid;
|
|
|
|
showTopologyError( message.str(), flags );
|
|
|
|
} else
|
|
|
|
setX( _segment->getX() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cdebug_tabw(145,-1);
|
|
|
|
DebugSession::close();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AutoContactTerminal::updateTopology ()
|
|
|
|
{
|
|
|
|
DebugSession::open( getNet(), 140, 150 );
|
|
|
|
|
|
|
|
cdebug_log(145,1) << _getTypeName() << "::updateTopology() " << this << endl;
|
|
|
|
|
|
|
|
if (isInvalidatedCache()) updateCache();
|
|
|
|
if (isInvalidatedCache()) {
|
|
|
|
cerr << Error( "%s::updateGeometry() %s: Unable to restore cache."
|
|
|
|
, _getTypeName().c_str(), getString(this).c_str() ) << endl;
|
|
|
|
cdebug_tabw(145,-1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
RoutingGauge* rg = Session::getRoutingGauge();
|
|
|
|
size_t anchorDepth = rg->getLayerDepth( (_flags & CntIgnoreAnchor) ? getLayer()
|
|
|
|
: getAnchor()->getLayer() );
|
|
|
|
size_t segmentDepth = rg->getLayerDepth( _segment->getLayer() );
|
|
|
|
size_t delta = abssub( anchorDepth, segmentDepth );
|
|
|
|
|
|
|
|
if (delta > 3) {
|
|
|
|
showTopologyError( "Sheared Terminal, layer delta exceed 3." );
|
|
|
|
setFlags( CntBadTopology );
|
|
|
|
} else {
|
|
|
|
if (delta > 1) {
|
|
|
|
//_segment = _segment->makeDogleg( this );
|
|
|
|
_segment->makeDogleg( this );
|
|
|
|
cdebug_log(145,0) << "Update seg: " << _segment << endl;
|
|
|
|
delta = abssub( anchorDepth, rg->getLayerDepth( _segment->getLayer() ) );
|
|
|
|
}
|
|
|
|
else if (delta == 0) setLayer( rg->getRoutingLayer(anchorDepth) );
|
|
|
|
else if (delta == 1) setLayer( rg->getContactLayer(std::min(anchorDepth,segmentDepth)) );
|
|
|
|
}
|
|
|
|
_segment->invalidate( this );
|
|
|
|
|
|
|
|
cdebug_tabw(145,-1);
|
|
|
|
DebugSession::close();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-10-05 16:43:07 -05:00
|
|
|
void AutoContactTerminal::forceOnGrid ( Point gridPoint )
|
|
|
|
{
|
|
|
|
setFlags( CntUserNativeConstraints );
|
|
|
|
setConstraintBox( Box(gridPoint) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-07-18 07:48:37 -05:00
|
|
|
string AutoContactTerminal::_getTypeName () const
|
|
|
|
{ return "ContactTerminal"; }
|
|
|
|
|
|
|
|
|
|
|
|
} // Anabatic namespace.
|