Place the Net in the cell.

Rename place function from Place() to place().
This commit is contained in:
Jean-Paul Chaput 2012-03-13 15:41:40 +00:00
parent 392accdf27
commit 0bec26f739
3 changed files with 58 additions and 54 deletions

View File

@ -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 <cstdio>
@ -846,6 +843,8 @@ namespace {
}
}
}
placeNets(_cell);
} catch ( Error& e ) {
if ( e.what() != "[ERROR] ApParser processed" )
cerr << e.what() << endl;

View File

@ -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.

View File

@ -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<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 );
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