diff --git a/crlcore/src/ccore/alliance/ap/ApParser.cpp b/crlcore/src/ccore/alliance/ap/ApParser.cpp index 28470a93..ada9d7c0 100644 --- a/crlcore/src/ccore/alliance/ap/ApParser.cpp +++ b/crlcore/src/ccore/alliance/ap/ApParser.cpp @@ -36,8 +36,7 @@ // // $Id$ // -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | C O R I O L I S | // | Alliance / Hurricane Interface | // | | @@ -45,12 +44,10 @@ // | E-mail : Christian.Masson@lip6.fr | // | =============================================================== | // | C++ Module : "./ApParser.cpp" | -// | *************************************************************** | -// | U p d a t e s | // | | // | 05/06/2008 - Jean-Paul Chaput | // | Complete rewrite & simplification. | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #include @@ -846,6 +843,8 @@ namespace { } } } + + placeNets(_cell); } catch ( Error& e ) { if ( e.what() != "[ERROR] ApParser processed" ) cerr << e.what() << endl; diff --git a/crlcore/src/ccore/crlcore/ToolBox.h b/crlcore/src/ccore/crlcore/ToolBox.h index f9590a09..8c90582a 100644 --- a/crlcore/src/ccore/crlcore/ToolBox.h +++ b/crlcore/src/ccore/crlcore/ToolBox.h @@ -3,25 +3,21 @@ // -*- C++ -*- // // 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$ // -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | 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 | // | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | =============================================================== | -// | C++ Header : "./ToolBox.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// | C++ Header : "./crlcore/ToolBox.h" | +// +-----------------------------------------------------------------+ #ifndef __CRL_TOOLBOX_H__ @@ -46,11 +42,11 @@ namespace CRL { using Hurricane::Occurrence; Component* getBestExternalComponent ( Net* ); - void PlaceNet ( Net* ); - void PlaceNets ( Cell* ); - void PlaceMasterNets ( const Library* ); - void PlacePlug ( Plug* ); - void PlacePlugs ( Cell* ); + bool placeNet ( Net* ); + void placeNets ( Cell* ); + void placeMasterNets ( const Library* ); + void placePlug ( Plug* ); + void placePlugs ( Cell* ); void createPartRing2 ( Net& ); void createPartRing ( Cell*, Name nom ); 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 ); bool isNoInstancePlacedOrFixed ( Cell* ); Occurrence getRootNetOccurrence ( const Occurrence& netoccurrence ); - void ConnectPlugHooks ( Cell* ); + void connectPlugHooks ( Cell* ); size_t getInstancesCount ( const Cell* cell ); + void setNetsPosition ( Cell* ); } // End of CRL namespace. diff --git a/crlcore/src/ccore/toolbox/ToolBox.cpp b/crlcore/src/ccore/toolbox/ToolBox.cpp index 8455c076..9a909fb8 100644 --- a/crlcore/src/ccore/toolbox/ToolBox.cpp +++ b/crlcore/src/ccore/toolbox/ToolBox.cpp @@ -2,14 +2,13 @@ // -*- C++ -*- // // 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$ // -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | C O R I O L I S | // | Alliance / Hurricane Interface | // | | @@ -17,10 +16,7 @@ // | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | =============================================================== | // | C++ Module : "./ToolBox.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #include "hurricane/Plug.h" @@ -73,61 +69,73 @@ Component* getBestExternalComponent ( Net* net ) { Component* bestComponent = NULL; - for_each_component ( component, NetExternalComponents::get(net) ) { - if ( !bestComponent ) { bestComponent = component; continue; } + forEach ( Component*, icomponent, NetExternalComponents::get(net) ) { + if ( !bestComponent ) { bestComponent = *icomponent; continue; } if ( /*IsOnTop(component->getLayer(),bestComponent->getLayer()) - || */ ( getArea(component) > getArea(bestComponent) ) ) { - bestComponent = component; + || */ ( getArea(*icomponent) > getArea(bestComponent) ) ) { + bestComponent = *icomponent; } - end_for } - 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 ) - net->setPosition ( bestComponent->getCenter() ); -} - - -void PlaceNets ( Cell* cell ) -{ - assert ( cell ); - - for_each_net ( net, cell->getExternalNets() ) { - PlaceNet ( net ); - end_for + if ( bestComponent ) { + net->setPosition(bestComponent->getCenter()); + return true; } + return false; } -void PlaceMasterNets ( const Library* library ) +void placeNets ( Cell* cell ) +{ + assert(cell); + + UpdateSession::open(); + + vector unplaceds; + + forEach ( Net*, inet, cell->getExternalNets() ) { + if ( !placeNet(*inet) ) unplaceds.push_back(*inet); + } + + Point abCenter = cell->getAbutmentBox().getCenter(); + for ( size_t i=0 ; isetPosition(abCenter); + } + + UpdateSession::close(); +} + + +void placeMasterNets ( const Library* library ) { assert ( library ); for_each_cell ( cell, library->getCells() ) { - PlaceNets ( cell ); + placeNets ( cell ); end_for } } -void PlacePlug (Plug* plug) +void placePlug (Plug* plug) { assert ( plug ); - PlaceNet ( plug->getMasterNet() ); + placeNet ( plug->getMasterNet() ); } -void PlacePlugs ( Cell* cell ) +void placePlugs ( Cell* cell ) { assert ( cell ); @@ -135,7 +143,7 @@ void PlacePlugs ( Cell* cell ) for_each_net ( net, cell->getNets() ) { for_each_plug ( plug, net->getPlugs() ) { - PlacePlug ( plug ); + placePlug ( plug ); end_for; } end_for