2017-06-10 05:27:25 -05:00
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
|
|
|
// This file is part of the Coriolis Software.
|
2018-01-06 10:55:44 -06:00
|
|
|
// Copyright (c) UPMC 2008-2018, All Rights Reserved
|
2017-06-10 05:27:25 -05:00
|
|
|
//
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
// | C O R I O L I S |
|
|
|
|
// | K i t e - D e t a i l e d R o u t e r |
|
|
|
|
// | |
|
|
|
|
// | Author : Jean-Paul CHAPUT |
|
|
|
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
|
|
// | =============================================================== |
|
|
|
|
// | C++ Module : "./TrackSegmentWide.cpp" |
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
#include <limits>
|
|
|
|
#include "hurricane/Bug.h"
|
|
|
|
#include "hurricane/Warning.h"
|
|
|
|
#include "hurricane/BasicLayer.h"
|
|
|
|
#include "hurricane/Net.h"
|
|
|
|
#include "hurricane/Name.h"
|
|
|
|
#include "hurricane/RoutingPad.h"
|
|
|
|
#include "anabatic/AutoContact.h"
|
|
|
|
#include "anabatic/GCell.h"
|
|
|
|
#include "crlcore/RoutingGauge.h"
|
|
|
|
#include "katana/DataNegociate.h"
|
|
|
|
#include "katana/TrackSegmentWide.h"
|
|
|
|
#include "katana/Track.h"
|
|
|
|
#include "katana/Session.h"
|
|
|
|
#include "katana/RoutingEvent.h"
|
|
|
|
#include "katana/NegociateWindow.h"
|
|
|
|
#include "katana/KatanaEngine.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Katana {
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using Hurricane::tab;
|
|
|
|
using Hurricane::Bug;
|
|
|
|
using Hurricane::Error;
|
|
|
|
using Hurricane::BasicLayer;
|
|
|
|
using Hurricane::Net;
|
|
|
|
using Hurricane::Name;
|
|
|
|
using Hurricane::RoutingPad;
|
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
|
|
|
using Anabatic::AutoSegment;
|
2017-06-10 05:27:25 -05:00
|
|
|
using Anabatic::perpandicularTo;
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "TrackSegmentWide".
|
|
|
|
|
|
|
|
|
|
|
|
TrackSegmentWide::TrackSegmentWide ( AutoSegment* segment, Track* track, size_t trackSpan )
|
|
|
|
: Super(segment,track)
|
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
|
|
|
, _trackSpan (trackSpan)
|
|
|
|
, _trackCount(0)
|
2017-06-10 05:27:25 -05:00
|
|
|
{
|
|
|
|
cdebug_log(155,0) << "CTOR TrackSegmentWide " << (void*)this << ":" << this << endl;
|
|
|
|
cdebug_log(155,0) << " over " << (void*)segment << ":" << segment << endl;
|
|
|
|
|
|
|
|
if (not _trackSpan) {
|
|
|
|
DbU::Unit mWidth = std::max( Session::getWireWidth(getLayer()), Session::getViaWidth(getLayer()) );
|
Partial management of offgrid fixed segments in Katana.
NOTE: To myself, one more bug uncovered in the Track segments management.
This is really too complex, must find time to re-think and simplify
the whole thing.
* New: In Katana::NegociateWidow::createTrackSegment(), detect offgrid
fixed segments and insert them into tracks directly (as *wide* segment
of two tracks).
* New: In Katana::TrackSegment::create() factory method, check for offgrid
fixed segment and use a TrackSegmentWide (of 2 tracks) for them.
* New: In Katana::TrackSegmentWide CTOR, check if they are used in the
context of an offgrid segment and in that case set the track span
to two. We *do not* manage yet the case for both *wide* and *offgrid*
segments.
* Change: In Katana::PowerRails::Rails::doLayout(), do not expand blockage
rectangles over their real size. Add the guard only for real layers
segments.
* Bug: In Katana::PreProcess::propagateCagedConstraints(), when looking
for the first track index, check for out of bound value (npos).
* Bug: In Katana::Track::addOverlapCost(), before using the overlap
segment indexes, check if we are not in a free hole (get the free
interval from center).
* Bug: In Katana::Track::expandFreeInterval(), the interval was badly
computed if it was included inside segments of another (same) net.
2021-02-17 16:57:45 -06:00
|
|
|
if (segment->getWidth() <= mWidth) {
|
2017-06-10 05:27:25 -05:00
|
|
|
_trackSpan = 1;
|
Partial management of offgrid fixed segments in Katana.
NOTE: To myself, one more bug uncovered in the Track segments management.
This is really too complex, must find time to re-think and simplify
the whole thing.
* New: In Katana::NegociateWidow::createTrackSegment(), detect offgrid
fixed segments and insert them into tracks directly (as *wide* segment
of two tracks).
* New: In Katana::TrackSegment::create() factory method, check for offgrid
fixed segment and use a TrackSegmentWide (of 2 tracks) for them.
* New: In Katana::TrackSegmentWide CTOR, check if they are used in the
context of an offgrid segment and in that case set the track span
to two. We *do not* manage yet the case for both *wide* and *offgrid*
segments.
* Change: In Katana::PowerRails::Rails::doLayout(), do not expand blockage
rectangles over their real size. Add the guard only for real layers
segments.
* Bug: In Katana::PreProcess::propagateCagedConstraints(), when looking
for the first track index, check for out of bound value (npos).
* Bug: In Katana::Track::addOverlapCost(), before using the overlap
segment indexes, check if we are not in a free hole (get the free
interval from center).
* Bug: In Katana::Track::expandFreeInterval(), the interval was badly
computed if it was included inside segments of another (same) net.
2021-02-17 16:57:45 -06:00
|
|
|
if (track and (track->getAxis() != segment->getAxis())) {
|
|
|
|
_trackSpan = 2;
|
|
|
|
}
|
2017-06-10 05:27:25 -05:00
|
|
|
} 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 pitch = Session::getPitch(segment->getLayer());
|
|
|
|
DbU::Unit width = segment->getWidth() - mWidth;
|
|
|
|
|
|
|
|
_trackSpan = (size_t)(width/pitch) + 1 + ((width%pitch) ? 1 : 0);
|
2017-06-10 05:27:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TrackSegmentWide::_postCreate ()
|
|
|
|
{
|
|
|
|
Super::_postCreate();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TrackSegmentWide::~TrackSegmentWide ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TrackSegmentWide::_preDestroy ()
|
|
|
|
{
|
|
|
|
Super::_preDestroy();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
size_t TrackSegmentWide::getTrackSpan () const { return _trackSpan; }
|
|
|
|
uint32_t TrackSegmentWide::getTrackCount () const { return _trackCount; }
|
|
|
|
|
|
|
|
|
|
|
|
void TrackSegmentWide::addTrackCount ( int32_t count )
|
|
|
|
{
|
|
|
|
if (count > 0) _trackCount += count;
|
|
|
|
else {
|
|
|
|
if (-count > (int32_t)_trackCount) _trackCount = 0;
|
|
|
|
_trackCount -= -count;
|
|
|
|
}
|
|
|
|
}
|
2017-06-10 05:27:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
void TrackSegmentWide::addOverlapCost ( TrackCost& cost ) const
|
|
|
|
{
|
|
|
|
uint32_t depth = Session::getRoutingGauge()->getLayerDepth(getLayer());
|
|
|
|
bool inLocalDepth = (depth < 3);
|
|
|
|
Track* track = cost.getTrack();
|
|
|
|
|
|
|
|
if (not track) return;
|
|
|
|
|
|
|
|
cost.setFlags( (isLocal() and (depth >= 3)) ? TrackCost::LocalAndTopDepth : 0 );
|
|
|
|
cost.setFlags( (isAnalog()) ? TrackCost::Analog : 0 );
|
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
|
|
|
cost.setDistanceToFixed();
|
|
|
|
cost.incAxisWeight ( getDataNegociate()->getRoutingEvent()->getAxisWeight( track->getAxis() ) );
|
|
|
|
cost.incDeltaPerpand( getDataNegociate()->getWiringDelta( track->getAxis() ) );
|
|
|
|
|
|
|
|
cdebug_log(155,0) << "incAxisWeight:" << DbU::getValueString(track->getAxis())
|
|
|
|
<< " of " << DbU::getValueString(getDataNegociate()->getRoutingEvent()->getAxisWeight( track->getAxis() ))
|
|
|
|
<< " (sum:" << DbU::getValueString(cost.getAxisWeight()) << ")"
|
|
|
|
<< endl;
|
2017-06-10 05:27:25 -05:00
|
|
|
|
|
|
|
for ( size_t span=0 ; (span < _trackSpan) and (track != NULL) ; ++span ) {
|
|
|
|
track->addOverlapCost( cost );
|
|
|
|
// Todo: have to choose here wether we go *next* or *previous* according
|
|
|
|
// to the symmetry kind.
|
|
|
|
track = track->getNextTrack();
|
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
|
|
|
cost.selectNextTrack();
|
|
|
|
}
|
2017-06-10 05:27:25 -05:00
|
|
|
|
|
|
|
if (isGlobal()) cost.setForGlobal();
|
|
|
|
|
|
|
|
if ( inLocalDepth and (cost.getDataState() == DataNegociate::MaximumSlack) )
|
|
|
|
cost.setInfinite();
|
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
|
|
|
|
|
|
|
cost.select( 0, TrackCost::NoFlags );
|
2017-06-10 05:27:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // Katana namespace.
|