Place the Net in the cell.
Rename place function from Place() to place().
This commit is contained in:
parent
392accdf27
commit
0bec26f739
|
@ -36,8 +36,7 @@
|
||||||
//
|
//
|
||||||
// $Id$
|
// $Id$
|
||||||
//
|
//
|
||||||
// x-----------------------------------------------------------------x
|
// +-----------------------------------------------------------------+
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
// | C O R I O L I S |
|
||||||
// | Alliance / Hurricane Interface |
|
// | Alliance / Hurricane Interface |
|
||||||
// | |
|
// | |
|
||||||
|
@ -45,12 +44,10 @@
|
||||||
// | E-mail : Christian.Masson@lip6.fr |
|
// | E-mail : Christian.Masson@lip6.fr |
|
||||||
// | =============================================================== |
|
// | =============================================================== |
|
||||||
// | C++ Module : "./ApParser.cpp" |
|
// | C++ Module : "./ApParser.cpp" |
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
// | |
|
||||||
// | 05/06/2008 - Jean-Paul Chaput |
|
// | 05/06/2008 - Jean-Paul Chaput |
|
||||||
// | Complete rewrite & simplification. |
|
// | Complete rewrite & simplification. |
|
||||||
// x-----------------------------------------------------------------x
|
// +-----------------------------------------------------------------+
|
||||||
|
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -846,6 +843,8 @@ namespace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
placeNets(_cell);
|
||||||
} catch ( Error& e ) {
|
} catch ( Error& e ) {
|
||||||
if ( e.what() != "[ERROR] ApParser processed" )
|
if ( e.what() != "[ERROR] ApParser processed" )
|
||||||
cerr << e.what() << endl;
|
cerr << e.what() << endl;
|
||||||
|
|
|
@ -3,25 +3,21 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
// $Id$
|
// $Id$
|
||||||
//
|
//
|
||||||
// x-----------------------------------------------------------------x
|
// +-----------------------------------------------------------------+
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
// | 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 |
|
// | Alliance / Hurricane Interface |
|
||||||
// | |
|
// | |
|
||||||
// | Author : Jean-Paul CHAPUT |
|
// | Author : Jean-Paul CHAPUT |
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
// | =============================================================== |
|
// | =============================================================== |
|
||||||
// | C++ Header : "./ToolBox.h" |
|
// | C++ Header : "./crlcore/ToolBox.h" |
|
||||||
// | *************************************************************** |
|
// +-----------------------------------------------------------------+
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __CRL_TOOLBOX_H__
|
#ifndef __CRL_TOOLBOX_H__
|
||||||
|
@ -46,11 +42,11 @@ namespace CRL {
|
||||||
using Hurricane::Occurrence;
|
using Hurricane::Occurrence;
|
||||||
|
|
||||||
Component* getBestExternalComponent ( Net* );
|
Component* getBestExternalComponent ( Net* );
|
||||||
void PlaceNet ( Net* );
|
bool placeNet ( Net* );
|
||||||
void PlaceNets ( Cell* );
|
void placeNets ( Cell* );
|
||||||
void PlaceMasterNets ( const Library* );
|
void placeMasterNets ( const Library* );
|
||||||
void PlacePlug ( Plug* );
|
void placePlug ( Plug* );
|
||||||
void PlacePlugs ( Cell* );
|
void placePlugs ( Cell* );
|
||||||
void createPartRing2 ( Net& );
|
void createPartRing2 ( Net& );
|
||||||
void createPartRing ( Cell*, Name nom );
|
void createPartRing ( Cell*, Name nom );
|
||||||
void createPlugsRing ( Net& );
|
void createPlugsRing ( Net& );
|
||||||
|
@ -61,8 +57,9 @@ namespace CRL {
|
||||||
Transformation getTransformation ( const Box& abox, const DbU::Unit& x, const DbU::Unit& y, const Transformation::Orientation& orientation );
|
Transformation getTransformation ( const Box& abox, const DbU::Unit& x, const DbU::Unit& y, const Transformation::Orientation& orientation );
|
||||||
bool isNoInstancePlacedOrFixed ( Cell* );
|
bool isNoInstancePlacedOrFixed ( Cell* );
|
||||||
Occurrence getRootNetOccurrence ( const Occurrence& netoccurrence );
|
Occurrence getRootNetOccurrence ( const Occurrence& netoccurrence );
|
||||||
void ConnectPlugHooks ( Cell* );
|
void connectPlugHooks ( Cell* );
|
||||||
size_t getInstancesCount ( const Cell* cell );
|
size_t getInstancesCount ( const Cell* cell );
|
||||||
|
void setNetsPosition ( Cell* );
|
||||||
|
|
||||||
} // End of CRL namespace.
|
} // End of CRL namespace.
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,13 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
// $Id$
|
// $Id$
|
||||||
//
|
//
|
||||||
// x-----------------------------------------------------------------x
|
// +-----------------------------------------------------------------+
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
// | C O R I O L I S |
|
||||||
// | Alliance / Hurricane Interface |
|
// | Alliance / Hurricane Interface |
|
||||||
// | |
|
// | |
|
||||||
|
@ -17,10 +16,7 @@
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
// | =============================================================== |
|
// | =============================================================== |
|
||||||
// | C++ Module : "./ToolBox.cpp" |
|
// | C++ Module : "./ToolBox.cpp" |
|
||||||
// | *************************************************************** |
|
// +-----------------------------------------------------------------+
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#include "hurricane/Plug.h"
|
#include "hurricane/Plug.h"
|
||||||
|
@ -73,61 +69,73 @@ Component* getBestExternalComponent ( Net* net )
|
||||||
{
|
{
|
||||||
Component* bestComponent = NULL;
|
Component* bestComponent = NULL;
|
||||||
|
|
||||||
for_each_component ( component, NetExternalComponents::get(net) ) {
|
forEach ( Component*, icomponent, NetExternalComponents::get(net) ) {
|
||||||
if ( !bestComponent ) { bestComponent = component; continue; }
|
if ( !bestComponent ) { bestComponent = *icomponent; continue; }
|
||||||
if ( /*IsOnTop(component->getLayer(),bestComponent->getLayer())
|
if ( /*IsOnTop(component->getLayer(),bestComponent->getLayer())
|
||||||
|| */ ( getArea(component) > getArea(bestComponent) ) ) {
|
|| */ ( getArea(*icomponent) > getArea(bestComponent) ) ) {
|
||||||
bestComponent = component;
|
bestComponent = *icomponent;
|
||||||
}
|
}
|
||||||
end_for
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return bestComponent;
|
return bestComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PlaceNet ( Net* net )
|
bool placeNet ( Net* net )
|
||||||
{
|
{
|
||||||
assert ( net );
|
assert(net);
|
||||||
|
|
||||||
Component* bestComponent = getBestExternalComponent ( net );
|
if ( not net->isExternal() ) return false;
|
||||||
|
Component* bestComponent = getBestExternalComponent(net);
|
||||||
|
|
||||||
if ( bestComponent )
|
if ( bestComponent ) {
|
||||||
net->setPosition ( bestComponent->getCenter() );
|
net->setPosition(bestComponent->getCenter());
|
||||||
}
|
return true;
|
||||||
|
|
||||||
|
|
||||||
void PlaceNets ( Cell* cell )
|
|
||||||
{
|
|
||||||
assert ( cell );
|
|
||||||
|
|
||||||
for_each_net ( net, cell->getExternalNets() ) {
|
|
||||||
PlaceNet ( net );
|
|
||||||
end_for
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PlaceMasterNets ( const Library* library )
|
void placeNets ( Cell* cell )
|
||||||
|
{
|
||||||
|
assert(cell);
|
||||||
|
|
||||||
|
UpdateSession::open();
|
||||||
|
|
||||||
|
vector<Net*> unplaceds;
|
||||||
|
|
||||||
|
forEach ( Net*, inet, cell->getExternalNets() ) {
|
||||||
|
if ( !placeNet(*inet) ) unplaceds.push_back(*inet);
|
||||||
|
}
|
||||||
|
|
||||||
|
Point abCenter = cell->getAbutmentBox().getCenter();
|
||||||
|
for ( size_t i=0 ; i<unplaceds.size() ; ++i ) {
|
||||||
|
unplaceds[i]->setPosition(abCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateSession::close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void placeMasterNets ( const Library* library )
|
||||||
{
|
{
|
||||||
assert ( library );
|
assert ( library );
|
||||||
|
|
||||||
for_each_cell ( cell, library->getCells() ) {
|
for_each_cell ( cell, library->getCells() ) {
|
||||||
PlaceNets ( cell );
|
placeNets ( cell );
|
||||||
end_for
|
end_for
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PlacePlug (Plug* plug)
|
void placePlug (Plug* plug)
|
||||||
{
|
{
|
||||||
assert ( plug );
|
assert ( plug );
|
||||||
|
|
||||||
PlaceNet ( plug->getMasterNet() );
|
placeNet ( plug->getMasterNet() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PlacePlugs ( Cell* cell )
|
void placePlugs ( Cell* cell )
|
||||||
{
|
{
|
||||||
assert ( cell );
|
assert ( cell );
|
||||||
|
|
||||||
|
@ -135,7 +143,7 @@ void PlacePlugs ( Cell* cell )
|
||||||
|
|
||||||
for_each_net ( net, cell->getNets() ) {
|
for_each_net ( net, cell->getNets() ) {
|
||||||
for_each_plug ( plug, net->getPlugs() ) {
|
for_each_plug ( plug, net->getPlugs() ) {
|
||||||
PlacePlug ( plug );
|
placePlug ( plug );
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
end_for
|
end_for
|
||||||
|
|
Loading…
Reference in New Issue