2010-03-09 09:24:55 -06:00
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
|
|
|
// This file is part of the Coriolis Software.
|
2016-03-06 05:36:18 -06:00
|
|
|
// Copyright (c) UPMC 2008-2016, All Rights Reserved
|
2010-03-09 09:24:55 -06:00
|
|
|
//
|
2013-12-03 18:59:29 -06:00
|
|
|
// +-----------------------------------------------------------------+
|
2010-03-09 09:24:55 -06: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 : "./TrackMarker.cpp" |
|
2013-12-03 18:59:29 -06:00
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
#include <iomanip>
|
|
|
|
#include <sstream>
|
|
|
|
#include "hurricane/Bug.h"
|
|
|
|
#include "hurricane/Warning.h"
|
|
|
|
#include "hurricane/RoutingPad.h"
|
|
|
|
#include "hurricane/Net.h"
|
|
|
|
#include "hurricane/Name.h"
|
|
|
|
#include "crlcore/RoutingGauge.h"
|
|
|
|
#include "katabatic/GCell.h"
|
|
|
|
#include "kite/TrackMarker.h"
|
|
|
|
#include "kite/Track.h"
|
|
|
|
#include "kite/RoutingPlane.h"
|
|
|
|
#include "kite/Session.h"
|
|
|
|
#include "kite/RoutingEvent.h"
|
|
|
|
#include "kite/KiteEngine.h"
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
namespace Kite {
|
|
|
|
|
|
|
|
using std::cerr;
|
|
|
|
using std::endl;
|
|
|
|
using std::ostringstream;
|
|
|
|
using std::setprecision;
|
|
|
|
using Hurricane::Bug;
|
|
|
|
using CRL::RoutingGauge;
|
|
|
|
|
|
|
|
|
|
|
|
TrackMarker* TrackMarker::create ( RoutingPad* rp, size_t depth )
|
|
|
|
{
|
|
|
|
TrackMarker* segment = new TrackMarker ( rp, depth );
|
|
|
|
return segment;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TrackMarker::destroy ()
|
|
|
|
{
|
|
|
|
if ( !--_refcount ) delete this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TrackMarker::TrackMarker ( RoutingPad* pad, size_t depth )
|
|
|
|
: _routingPad (pad)
|
|
|
|
, _sourcePosition(0)
|
|
|
|
, _targetPosition(0)
|
|
|
|
, _track (NULL)
|
|
|
|
, _weight (0)
|
|
|
|
, _refcount (0)
|
|
|
|
{
|
|
|
|
Point sourcePoint = pad->getSourcePosition();
|
|
|
|
Point targetPoint = pad->getTargetPosition();
|
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
|
|
|
RoutingGauge* rg = Session::getRoutingGauge();
|
2010-03-09 09:24:55 -06:00
|
|
|
RoutingPlane* rp = Session::getKiteEngine()->getRoutingPlaneByIndex(depth);
|
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
|
|
|
DbU::Unit pitch = DbU::toLambda(Session::getPitch(depth));
|
2010-03-09 09:24:55 -06:00
|
|
|
unsigned int rpDirection = rg->getLayerDirection(depth);
|
|
|
|
Interval trackSpan;
|
|
|
|
|
|
|
|
if ( rpDirection == Constant::Horizontal ) {
|
|
|
|
_sourcePosition = sourcePoint.getX();
|
|
|
|
_targetPosition = targetPoint.getX();
|
|
|
|
trackSpan = Interval ( sourcePoint.getY(), targetPoint.getY() );
|
|
|
|
} else {
|
|
|
|
_sourcePosition = sourcePoint.getY();
|
|
|
|
_targetPosition = targetPoint.getY();
|
|
|
|
trackSpan = Interval ( sourcePoint.getX(), targetPoint.getX() );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( rpDirection xor rg->getLayerDirection(rg->getLayerDepth(pad->getLayer())) ) {
|
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
|
|
|
_weight = (unsigned int)(( pitch / (pitch+DbU::toLambda(trackSpan.getSize())) ) * 100.0) ;
|
2010-03-09 09:24:55 -06:00
|
|
|
} else {
|
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
|
|
|
_weight = (unsigned int)( (pitch + DbU::toLambda(trackSpan.getSize())) * 20.0 );
|
2010-03-09 09:24:55 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
Track* track = rp->getTrackByPosition ( trackSpan.getVMin() );
|
|
|
|
while ( track && (track->getAxis() <= trackSpan.getVMax()) ) {
|
|
|
|
Session::addInsertEvent ( this, track );
|
2013-12-03 18:59:29 -06:00
|
|
|
track = track->getNextTrack();
|
2010-03-09 09:24:55 -06:00
|
|
|
_refcount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Net* TrackMarker::getNet () const
|
|
|
|
{ return _routingPad->getNet(); }
|
|
|
|
|
|
|
|
|
|
|
|
string TrackMarker::_getTypeName () const
|
|
|
|
{ return "TrackMarker"; }
|
|
|
|
|
|
|
|
|
|
|
|
string TrackMarker::_getString () const
|
|
|
|
{
|
|
|
|
ostringstream s;
|
|
|
|
s << "<" << _getTypeName()
|
|
|
|
<< " " << getNet()->getName()
|
|
|
|
<< " [" << DbU::getValueString(_sourcePosition)
|
|
|
|
<< ":" << DbU::getValueString(_targetPosition)
|
|
|
|
<< " " << setprecision(3) << ((double)_weight)/100.0
|
|
|
|
<< ">";
|
|
|
|
return s.str();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Record* TrackMarker::_getRecord () const
|
|
|
|
{
|
|
|
|
Record* record = new Record ( _getString() );
|
|
|
|
record->add ( getSlot ( "_routingPad" , _routingPad ) );
|
|
|
|
record->add ( getSlot ( "_sourcePosition", _sourcePosition ) );
|
|
|
|
record->add ( getSlot ( "_targetPosition", _targetPosition ) );
|
|
|
|
record->add ( getSlot ( "_track" , _track ) );
|
|
|
|
record->add ( getSlot ( "_weight" , _weight ) );
|
|
|
|
|
|
|
|
return record;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
} // Kite namespace.
|