* All tools:

- Bug: target_link_libraries() must be put back for OSX Snow Leopard
        (doesn't seems to affect Leopard). As I do not have an OSX under
        my hand it's untested and is likely to fail at that point.

  * ./mauka:
    - Bug: Place intermediate levels of instances, so that they show up in
        the top level.
    - Change: New InsertFeeds method + module, sadly we cannot insert the feeds
        cells in one merged step with the BBPlacer as the SubRows do not cover
        the entire surface due to fixed Cells.
This commit is contained in:
Jean-Paul Chaput 2010-07-12 15:19:31 +00:00
parent 59bab1e603
commit ea52a09b6f
8 changed files with 422 additions and 155 deletions

View File

@ -42,6 +42,8 @@ ENDFOREACH(PATH)
SET(QT_USE_QTXML "true") SET(QT_USE_QTXML "true")
FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project
FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE(PythonSitePackages REQUIRED)
FIND_PACKAGE(VLSISAPD REQUIRED) FIND_PACKAGE(VLSISAPD REQUIRED)
FIND_PACKAGE(HURRICANE REQUIRED) FIND_PACKAGE(HURRICANE REQUIRED)
FIND_PACKAGE(CORIOLIS REQUIRED) FIND_PACKAGE(CORIOLIS REQUIRED)
@ -49,6 +51,14 @@ FIND_PACKAGE(NIMBUS REQUIRED)
FIND_PACKAGE(METIS REQUIRED) FIND_PACKAGE(METIS REQUIRED)
SET_LIB_LINK_MODE() SET_LIB_LINK_MODE()
SET(Boost_USE_STATIC_LIBS ON)
MESSAGE(STATUS "Always uses Boost static libraries.")
FIND_PACKAGE(Boost 1.35.0 COMPONENTS program_options filesystem system regex python)
IF(NOT Boost_FOUND)
FIND_PACKAGE(Boost 1.33.1 COMPONENTS program_options filesystem python regex REQUIRED)
ENDIF(NOT Boost_FOUND)
MESSAGE(STATUS "Found Boost libraries ${Boost_LIB_VERSION} in ${Boost_INCLUDE_DIR}")
MESSAGE(STATUS " ${Boost_LIBRARIES}")
ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(cmake_modules) ADD_SUBDIRECTORY(cmake_modules)

View File

@ -89,133 +89,6 @@ namespace {
using namespace CRL; using namespace CRL;
class RowFeed {
public:
RowFeed ( MaukaEngine*, const Box& bb );
inline const Box& getBox () const;
void mergeInstanceSpan ( DbU::Unit source, DbU::Unit target );
void insertTieChunk ( DbU::Unit xmin
, DbU::Unit xmax
, DbU::Unit y
, const Transformation::Orientation& );
void insertFeeds ( Cell*, const Transformation::Orientation& );
private:
MaukaEngine* _mauka;
Box _boundingBox;
list<Interval> _instanceSpans;
};
RowFeed::RowFeed ( MaukaEngine* mauka, const Box& bb )
: _mauka (mauka)
, _boundingBox (bb)
, _instanceSpans()
{ }
inline const Box& RowFeed::getBox () const { return _boundingBox; }
void RowFeed::mergeInstanceSpan ( DbU::Unit source, DbU::Unit target )
{
Interval spanMerge ( source, target );
list<Interval>::iterator imerge = _instanceSpans.end();
list<Interval>::iterator ispan = _instanceSpans.begin();
while ( ispan != _instanceSpans.end() ) {
if ( spanMerge.getVMax() < (*ispan).getVMin() ) break;
if ( spanMerge.intersect(*ispan) ) {
if ( imerge == _instanceSpans.end() ) {
imerge = ispan;
(*imerge).merge ( spanMerge );
} else {
(*imerge).merge ( *ispan );
ispan = _instanceSpans.erase ( ispan );
continue;
}
}
ispan++;
}
if ( imerge == _instanceSpans.end() ) {
_instanceSpans.insert ( ispan, spanMerge );
}
}
void RowFeed::insertTieChunk ( DbU::Unit xmin
, DbU::Unit xmax
, DbU::Unit y
, const Transformation::Orientation& orientation )
{
Cell* feed = _mauka->getFeedCells().getBiggestFeed();
if ( feed == NULL ) {
cerr << Error("No feed has been registered, ignoring.") << endl;
}
DbU::Unit feedWidth = feed->getAbutmentBox().getWidth();
DbU::Unit xtie = xmin;
while ( true ) {
if ( xtie >= xmax ) break;
if ( xtie+feedWidth > xmax ) {
// Feed is too big, try to find a smaller one.
int pitch = (int)((xmax-xtie) / _mauka->getPitch());
for ( ; pitch > 0 ; --pitch ) {
feed = _mauka->getFeedCells().getFeed ( pitch );
feedWidth = feed->getAbutmentBox().getWidth();
if ( feed != NULL ) break;
}
if ( feed == NULL ) break;
}
// cerr << "Inserted " << feed
// << " " << insName.str() << " @" << DbU::getLambda(xtie)
// << "," << DbU::getLambda(y)
// << " in " << _mauka->getCell() << endl;
Instance::create ( _mauka->getCell()
, _mauka->getFeedCells().getNewFeedName().c_str()
, feed
, getTransformation(feed->getAbutmentBox(),xtie,y,orientation)
, Instance::PlacementStatus::PLACED
);
xtie += feedWidth;
}
}
void RowFeed::insertFeeds ( Cell* cell, const Transformation::Orientation& orientation )
{
list<Interval>::iterator ispan = _instanceSpans.begin();
DbU::Unit minFeed = _boundingBox.getXMin();
DbU::Unit maxFeed;
if ( ispan == _instanceSpans.end() ) {
maxFeed = _boundingBox.getXMax();
insertTieChunk ( minFeed, maxFeed, _boundingBox.getYMin(), orientation );
return;
}
maxFeed = (*ispan).getVMin();
insertTieChunk ( minFeed, maxFeed, _boundingBox.getYMin(), orientation );
while ( ispan != _instanceSpans.end() ) {
minFeed = (*ispan).getVMax();
if ( ++ispan != _instanceSpans.end() )
maxFeed = (*ispan).getVMin();
else
maxFeed = _boundingBox.getXMax();
insertTieChunk ( minFeed, maxFeed, _boundingBox.getYMin(), orientation );
}
}
class CompareInstancePosition class CompareInstancePosition
{ {
private: BBPlacer* _bbPlacer; private: BBPlacer* _bbPlacer;
@ -358,8 +231,6 @@ BBPlacer::BBPlacer(MaukaEngine* mauka)
void BBPlacer::Save() void BBPlacer::Save()
{ {
bool insertFeeds = _mauka->doInsertFeeds();
UpdateSession::open(); UpdateSession::open();
bool autoMaterialize = not Go::autoMaterializationIsDisabled(); bool autoMaterialize = not Go::autoMaterializationIsDisabled();
@ -368,7 +239,6 @@ void BBPlacer::Save()
for (unsigned i = 0; i < _subRowInstances.size(); i++) for (unsigned i = 0; i < _subRowInstances.size(); i++)
{ {
SubRow* subRow = _subRowVector[i]; SubRow* subRow = _subRowVector[i];
RowFeed rowFeed ( _mauka, subRow->getBox() );
Transformation::Orientation orientation Transformation::Orientation orientation
= (subRow->getRow()->getOrientation()) ? Transformation::Orientation::MY = (subRow->getRow()->getOrientation()) ? Transformation::Orientation::MY
@ -382,9 +252,6 @@ void BBPlacer::Save()
Occurrence instanceOccurrence = _mauka->_instanceOccurrencesVector[instanceId]; Occurrence instanceOccurrence = _mauka->_instanceOccurrencesVector[instanceId];
Instance* instance = static_cast<Instance*>(instanceOccurrence.getEntity()); Instance* instance = static_cast<Instance*>(instanceOccurrence.getEntity());
if ( insertFeeds )
rowFeed.mergeInstanceSpan ( x, x+instance->getAbutmentBox().getWidth() );
Box masterABox = instance->getMasterCell()->getAbutmentBox(); Box masterABox = instance->getMasterCell()->getAbutmentBox();
Transformation instanceTransformation = getTransformation(masterABox, x, y, orientation); Transformation instanceTransformation = getTransformation(masterABox, x, y, orientation);
@ -400,8 +267,6 @@ void BBPlacer::Save()
instance->setPlacementStatus(Instance::PlacementStatus::PLACED); instance->setPlacementStatus(Instance::PlacementStatus::PLACED);
//setPlacementStatusRecursivelyToPlaced(instance); //setPlacementStatusRecursivelyToPlaced(instance);
} }
if ( insertFeeds )
rowFeed.insertFeeds ( _mauka->getCell(), orientation );
} }
if ( autoMaterialize ) Go::enableAutoMaterialization (); if ( autoMaterialize ) Go::enableAutoMaterialization ();

View File

@ -5,6 +5,7 @@
${CORIOLIS_INCLUDE_DIR} ${CORIOLIS_INCLUDE_DIR}
${HURRICANE_INCLUDE_DIR} ${HURRICANE_INCLUDE_DIR}
${CONFIGURATION_INCLUDE_DIR} ${CONFIGURATION_INCLUDE_DIR}
${PYTHON_INCLUDE_PATH}
) )
set ( includes mauka/Configuration.h set ( includes mauka/Configuration.h
mauka/FeedCells.h mauka/FeedCells.h
@ -20,6 +21,7 @@
mauka/MaukaEngine.h mauka/MaukaEngine.h
) )
set ( mocIncludes mauka/GraphicMaukaEngine.h ) set ( mocIncludes mauka/GraphicMaukaEngine.h )
set ( pyIncludes mauka/PyMaukaEngine.h )
set ( cpps Configuration.cpp set ( cpps Configuration.cpp
BBPlacer.cpp BBPlacer.cpp
FeedCells.cpp FeedCells.cpp
@ -31,12 +33,40 @@
SimAnnealingPlacer.cpp SimAnnealingPlacer.cpp
SubRow.cpp SubRow.cpp
Surface.cpp Surface.cpp
InsertFeeds.cpp
MaukaEngine.cpp MaukaEngine.cpp
GraphicMaukaEngine.cpp GraphicMaukaEngine.cpp
) )
set ( pyCpps PyMauka.cpp
PyMaukaEngine.cpp
)
qt4_wrap_cpp ( mocCpps ${mocIncludes} ) qt4_wrap_cpp ( mocCpps ${mocIncludes} )
add_library ( mauka ${cpps} ${mocCpps} ) add_library ( mauka ${cpps} ${mocCpps} ${pyCpps} )
install ( TARGETS mauka DESTINATION lib${LIB_SUFFIX} ) target_link_libraries ( mauka ${METIS_LIBRARIES}
install ( FILES ${includes} ${mocIncludes} DESTINATION include/coriolis2/mauka ) ${NIMBUS_LIBRARIES}
${HURRICANE_PYTHON_LIBRARIES}
${HURRICANE_GRAPHICAL_LIBRARIES}
${HURRICANE_LIBRARIES}
${CONFIGURATION_LIBRARY}
${CIF_LIBRARY}
${AGDS_LIBRARY}
${LEFDEF_LIBRARIES}
${OA_LIBRARIES}
${QT_LIBRARIES}
${Boost_LIBRARIES}
${LIBXML2_LIBRARIES}
${PYTHON_LIBRARIES} -lutil
)
add_library ( Mauka MODULE ${pyCpps} )
set_target_properties ( Mauka PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -D__PYTHON_MODULE__=1"
PREFIX ""
)
install ( TARGETS mauka DESTINATION lib${LIB_SUFFIX} )
install ( TARGETS Mauka DESTINATION ${PYTHON_SITE_PACKAGES} )
install ( FILES ${includes}
${mocIncludes}
${pyIncludes} DESTINATION include/coriolis2/mauka )

337
mauka/src/InsertFeeds.cpp Normal file
View File

@ -0,0 +1,337 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
//
// ===================================================================
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// | C O R I O L I S |
// | M a u k a - P l a c e r |
// | |
// | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== |
// | C++ Module : "./InsertFeeds.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
#include "hurricane/UpdateSession.h"
#include "crlcore/ToolBox.h"
#include "mauka/MaukaEngine.h"
namespace {
using namespace std;
using namespace Mauka;
using namespace Hurricane;
using namespace CRL;
// -------------------------------------------------------------------
// Class : "::RowFeed"
class SurfaceFeeds;
class RowFeed {
public:
RowFeed ( SurfaceFeeds*, const Box& bb );
inline const Box& getBox () const;
inline SurfaceFeeds* getSurfaceFeeds ();
inline MaukaEngine* getMauka ();
inline void setOrientation ( Transformation::Orientation );
void mergeInstanceSpan ( DbU::Unit source, DbU::Unit target );
void insertTieChunk ( DbU::Unit xmin
, DbU::Unit xmax
, DbU::Unit y
, const Transformation::Orientation& );
void insertFeeds ();
private:
SurfaceFeeds* _surface;
Box _boundingBox;
Transformation::Orientation _orientation;
list<Interval> _instanceSpans;
};
// -------------------------------------------------------------------
// Class : "::SurfaceFeeds"
class SurfaceFeeds {
public:
SurfaceFeeds ( MaukaEngine* );
~SurfaceFeeds ();
inline MaukaEngine* getMauka ();
void addInstanceOccurrence ( Occurrence );
void insertFeeds ();
private:
void _orientRows ( Transformation::Orientation );
private:
MaukaEngine* _mauka;
Box _area;
vector<RowFeed*> _rowFeeds;
bool _oriented;
};
// -------------------------------------------------------------------
// Class Implantation : "::RowFeed"
RowFeed::RowFeed ( SurfaceFeeds* surface, const Box& bb )
: _surface (surface)
, _boundingBox (bb)
, _orientation (Transformation::Orientation::ID)
, _instanceSpans()
{ }
inline const Box& RowFeed::getBox () const { return _boundingBox; }
inline MaukaEngine* RowFeed::getMauka () { return _surface->getMauka(); }
inline void RowFeed::setOrientation ( Transformation::Orientation orientation )
{ _orientation = orientation; }
void RowFeed::mergeInstanceSpan ( DbU::Unit source, DbU::Unit target )
{
Interval spanMerge ( source, target );
list<Interval>::iterator imerge = _instanceSpans.end();
list<Interval>::iterator ispan = _instanceSpans.begin();
while ( ispan != _instanceSpans.end() ) {
if ( spanMerge.getVMax() < (*ispan).getVMin() ) break;
if ( spanMerge.intersect(*ispan) ) {
if ( imerge == _instanceSpans.end() ) {
imerge = ispan;
(*imerge).merge ( spanMerge );
} else {
(*imerge).merge ( *ispan );
ispan = _instanceSpans.erase ( ispan );
continue;
}
}
ispan++;
}
if ( imerge == _instanceSpans.end() ) {
_instanceSpans.insert ( ispan, spanMerge );
}
}
void RowFeed::insertTieChunk ( DbU::Unit xmin
, DbU::Unit xmax
, DbU::Unit y
, const Transformation::Orientation& orientation )
{
Cell* feed = getMauka()->getFeedCells().getBiggestFeed();
if ( feed == NULL ) {
cerr << Error("No feed has been registered, ignoring.") << endl;
}
DbU::Unit feedWidth = feed->getAbutmentBox().getWidth();
DbU::Unit xtie = xmin;
while ( true ) {
if ( xtie >= xmax ) break;
if ( xtie+feedWidth > xmax ) {
// Feed is too big, try to find a smaller one.
int pitch = (int)((xmax-xtie) / getMauka()->getPitch());
for ( ; pitch > 0 ; --pitch ) {
feed = getMauka()->getFeedCells().getFeed ( pitch );
feedWidth = feed->getAbutmentBox().getWidth();
if ( feed != NULL ) break;
}
if ( feed == NULL ) break;
}
Instance::create ( getMauka()->getCell()
, getMauka()->getFeedCells().getNewFeedName().c_str()
, feed
, getTransformation(feed->getAbutmentBox(),xtie,y,orientation)
, Instance::PlacementStatus::PLACED
);
xtie += feedWidth;
}
}
void RowFeed::insertFeeds ()
{
list<Interval>::iterator ispan = _instanceSpans.begin();
DbU::Unit minFeed = _boundingBox.getXMin();
DbU::Unit maxFeed;
if ( ispan == _instanceSpans.end() ) {
maxFeed = _boundingBox.getXMax();
insertTieChunk ( minFeed, maxFeed, _boundingBox.getYMin(), _orientation );
return;
}
maxFeed = (*ispan).getVMin();
insertTieChunk ( minFeed, maxFeed, _boundingBox.getYMin(), _orientation );
while ( ispan != _instanceSpans.end() ) {
minFeed = (*ispan).getVMax();
if ( ++ispan != _instanceSpans.end() )
maxFeed = (*ispan).getVMin();
else
maxFeed = _boundingBox.getXMax();
insertTieChunk ( minFeed, maxFeed, _boundingBox.getYMin(), _orientation );
}
}
// -------------------------------------------------------------------
// Class Implantation : "::SurfaceFeeds"
SurfaceFeeds::SurfaceFeeds ( MaukaEngine* mauka )
: _mauka (mauka)
, _area (mauka->getCell()->getAbutmentBox())
, _rowFeeds()
, _oriented(false)
{
DbU::Unit sliceHeight = _mauka->getSliceHeight();
size_t rowsNb = _area.getHeight() / sliceHeight;
_rowFeeds.reserve ( rowsNb );
for ( size_t irow=0 ; irow<rowsNb ; ++irow )
_rowFeeds.push_back ( new RowFeed(this,Box(_area.getXMin()
, irow * sliceHeight
,_area.getXMax()
,(irow+1) * sliceHeight )) );
}
SurfaceFeeds::~SurfaceFeeds ()
{
for ( size_t irow=0 ; irow<_rowFeeds.size() ; ++irow )
delete _rowFeeds[irow];
}
inline MaukaEngine* SurfaceFeeds::getMauka () { return _mauka; }
void SurfaceFeeds::addInstanceOccurrence ( Occurrence occurrence )
{
Instance* instance = dynamic_cast<Instance*>(occurrence.getEntity());
if ( instance == NULL ) {
cerr << Error("Entity of occurrence %s is not an instance."
,getString(occurrence).c_str()) << endl;
return;
}
DbU::Unit sliceHeight = _mauka->getSliceHeight();
Box masterABox = instance->getAbutmentBox();
Transformation transformation = occurrence.getPath().getTransformation();
transformation.applyOn(masterABox);
Transformation::Orientation orientation = occurrence.getPath().getTransformation().getOrientation();
int rowStart = (masterABox.getYMin() - _area.getYMin()) / sliceHeight;
int rowStop = (masterABox.getYMax() - _area.getYMin()) / sliceHeight;
if ( (rowStart < 0) or (rowStop > (int)_rowFeeds.size()) ) {
cerr << Error("Instance %s (AB:%s) is outside the placement area."
,getString(occurrence).c_str()
,getString(masterABox).c_str()
) << endl;
return;
}
if ( not _oriented ) {
size_t instanceRowMY = 0;
switch ( orientation ) {
case Transformation::Orientation::ID: instanceRowMY = 0; break;
default:
case Transformation::Orientation::MY: instanceRowMY = 1; break;
}
Transformation::Orientation rowZeroOrientation = Transformation::Orientation::ID;
switch ( (rowStart+instanceRowMY) % 2 ) {
case 0: orientation = Transformation::Orientation::ID; break;
case 1: orientation = Transformation::Orientation::MY; break;
}
_orientRows ( rowZeroOrientation );
}
for ( size_t irow = rowStart ; (int)irow<rowStop ; ++irow ) {
_rowFeeds[irow]->mergeInstanceSpan ( masterABox.getXMin(), masterABox.getXMax() );
}
}
void SurfaceFeeds::insertFeeds ()
{
for ( size_t irow=0 ; irow<_rowFeeds.size() ; ++irow )
_rowFeeds[irow]->insertFeeds ();
}
void SurfaceFeeds::_orientRows ( Transformation::Orientation rowZeroOrientation )
{
if ( _oriented ) return;
_oriented = true;
size_t rowZeroMY = 0;
switch ( rowZeroOrientation ) {
case Transformation::Orientation::ID: rowZeroMY = 0; break;
default:
case Transformation::Orientation::MY: rowZeroMY = 1; break;
}
for ( size_t irow=0 ; irow<_rowFeeds.size() ; ++irow ) {
Transformation::Orientation orientation = Transformation::Orientation::ID;
switch ( (irow+rowZeroMY) % 2 ) {
case 0: orientation = Transformation::Orientation::ID; break;
case 1: orientation = Transformation::Orientation::MY; break;
}
_rowFeeds[irow]->setOrientation(orientation);
}
}
} // End of anonymous namespace.
namespace Mauka {
using Hurricane::UpdateSession;
void MaukaEngine::insertFeeds ()
{
UpdateSession::open ();
SurfaceFeeds surfaceFeeds ( this );
forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() )
{
surfaceFeeds.addInstanceOccurrence ( *ioccurrence );
}
surfaceFeeds.insertFeeds ();
UpdateSession::close ();
}
} // End of Mauka namespace.

View File

@ -41,6 +41,7 @@
#include "hurricane/HyperNet.h" #include "hurricane/HyperNet.h"
#include "hurricane/Timer.h" #include "hurricane/Timer.h"
#include "hurricane/DataBase.h" #include "hurricane/DataBase.h"
#include "hurricane/UpdateSession.h"
#include "crlcore/AllianceFramework.h" #include "crlcore/AllianceFramework.h"
#include "nimbus/GCell.h" #include "nimbus/GCell.h"
#include "nimbus/NimbusEngine.h" #include "nimbus/NimbusEngine.h"
@ -62,6 +63,7 @@ using Hurricane::OccurrenceLocator;
using Hurricane::PlugLocator; using Hurricane::PlugLocator;
using Hurricane::HyperNet; using Hurricane::HyperNet;
using Hurricane::Timer; using Hurricane::Timer;
using Hurricane::UpdateSession;
using namespace CRL; using namespace CRL;
using namespace Nimbus; using namespace Nimbus;
@ -145,7 +147,6 @@ void MaukaEngine::Run()
//if ( doPlotBins() ) PlotBinsStats(); //if ( doPlotBins() ) PlotBinsStats();
//cmess2 << endl << " o Simulated Annealing run took " << timer.getUserTime() << " s ..." << endl;
cmess1 << " o Simulated annealing took " << Timer::getStringTime(timer.getCombTime()) cmess1 << " o Simulated annealing took " << Timer::getStringTime(timer.getCombTime())
<< " [+" << Timer::getStringMemory(timer.getIncrease()) << "]." << endl; << " [+" << Timer::getStringMemory(timer.getIncrease()) << "]." << endl;
cmess1 << " (raw measurements : " << timer.getCombTime() cmess1 << " (raw measurements : " << timer.getCombTime()
@ -156,6 +157,7 @@ void MaukaEngine::Run()
_bbPlacer = new BBPlacer(this); _bbPlacer = new BBPlacer(this);
_bbPlacer->Run(); _bbPlacer->Run();
_bbPlacer->Save(); _bbPlacer->Save();
if ( doInsertFeeds() ) insertFeeds ();
//Plot(); //Plot();
} }
@ -179,7 +181,7 @@ void VerifyPathCellBox(const Occurrence& occurrence)
} }
void MaukaEngine::Construct() void MaukaEngine::Construct()
// ********************** // **************************
{ {
typedef map<Occurrence, unsigned> InstanceOccurrenceMap; typedef map<Occurrence, unsigned> InstanceOccurrenceMap;
typedef set<Instance*> InstanceSet; typedef set<Instance*> InstanceSet;
@ -191,12 +193,34 @@ void MaukaEngine::Construct()
DbU::DbU::Unit standardCellHeight = 0; DbU::DbU::Unit standardCellHeight = 0;
for_each_occurrence(occurrence, getCell()->getLeafInstanceOccurrences()) UpdateSession::open ();
forEach ( Occurrence, ioccurrence, getCell()->getNonLeafInstanceOccurrences() )
{ {
Instance* instance = static_cast<Instance*>(occurrence.getEntity()); Box topLevelAbutmentBox = getCell()->getAbutmentBox();
if (!instance->isFixed())
Instance* instance = static_cast<Instance*>((*ioccurrence).getEntity());
if ( instance->isUnplaced() ) {
Cell* masterCell = instance->getMasterCell();
if ( masterCell->getAbutmentBox().isEmpty() )
masterCell->setAbutmentBox ( topLevelAbutmentBox );
instance->setTransformation ( Transformation() );
instance->setPlacementStatus ( Instance::PlacementStatus::PLACED );
}
}
UpdateSession::close ();
forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() )
{
Instance* instance = static_cast<Instance*>((*ioccurrence).getEntity());
//cerr << (*ioccurrence).getPath() << ":"
// << instance << " " << (int)instance->getPlacementStatus().getCode() << endl;
if ( not instance->isFixed() and instance->isTerminal() )
{ {
//cerr << "unplaced " << occurrence << occurrence.getBoundingBox() << endl; //cerr << "unplaced " << (*ioccurrence) << (*ioccurrence).getBoundingBox() << endl;
Cell* model = instance->getMasterCell(); Cell* model = instance->getMasterCell();
DbU::DbU::Unit insWidth = model->getAbutmentBox().getWidth(); DbU::DbU::Unit insWidth = model->getAbutmentBox().getWidth();
DbU::DbU::Unit insHeight = model->getAbutmentBox().getHeight(); DbU::DbU::Unit insHeight = model->getAbutmentBox().getHeight();
@ -208,22 +232,21 @@ void MaukaEngine::Construct()
+ getString(instance->getName()) + getString(instance->getName())
+ " must be placed"); + " must be placed");
} }
_instanceOccurrencesVector.push_back(occurrence); _instanceOccurrencesVector.push_back(*ioccurrence);
//VerifyPathCellBox(occurrence); //VerifyPathCellBox(*ioccurrence);
_instanceWidths.push_back(insWidth); _instanceWidths.push_back(insWidth);
InstanceSet::iterator isit = instanceSet.find(instance); InstanceSet::iterator isit = instanceSet.find(instance);
if (isit != instanceSet.end()) if (isit != instanceSet.end())
{ {
cerr << "Unplaced Instance : " << *isit << endl; cerr << "Unplaced Instance : " << *isit << endl;
cerr << "Unplaced Occurrence : " << occurrence << endl; cerr << "Unplaced Occurrence : " << (*ioccurrence) << endl;
cerr << (*isit)->getPlacementStatus() << endl; cerr << (*isit)->getPlacementStatus() << endl;
throw Error("Each unplaced instance must have one occurrence only"); throw Error("Each unplaced instance must have one occurrence only");
} }
_instanceOccurrencesMap[occurrence] = instanceId++; _instanceOccurrencesMap[*ioccurrence] = instanceId++;
instanceSet.insert(instance); instanceSet.insert(instance);
_instanceNets.push_back(UVector()); _instanceNets.push_back(UVector());
} }
end_for;
} }
if (_instanceOccurrencesVector.size() == 0) if (_instanceOccurrencesVector.size() == 0)

View File

@ -40,6 +40,8 @@
namespace Mauka { namespace Mauka {
using std::cerr;
using std::endl;
using Hurricane::Error; using Hurricane::Error;
Row::Row(Cell* cell, Surface* surface, const Box& box, bool orientation) Row::Row(Cell* cell, Surface* surface, const Box& box, bool orientation)
@ -59,6 +61,7 @@ Row* Row::create(Cell* cell, Surface* surface, const Box& box, bool orientation)
throw Error("Can't create Mauka::Row : empty surface"); throw Error("Can't create Mauka::Row : empty surface");
Row* row = new Row(cell, surface, box, orientation); Row* row = new Row(cell, surface, box, orientation);
row->_postCreate(); row->_postCreate();
return row; return row;
} }

View File

@ -327,16 +327,16 @@ typedef list<PlacementProblem*> PlacementProblemList;
if ( (refInsSliceHeight % 2 == 0) if ( (refInsSliceHeight % 2 == 0)
or (orientation == Transformation::Orientation::ID) or (orientation == Transformation::Orientation::ID)
or (orientation == Transformation::Orientation::MX)) or (orientation == Transformation::Orientation::MX))
rowZeroOrientation = true;
else
rowZeroOrientation = false; rowZeroOrientation = false;
else
rowZeroOrientation = true;
} else { } else {
if ( (refInsSliceHeight % 2 == 0) if ( (refInsSliceHeight % 2 == 0)
or (orientation == Transformation::Orientation::ID) or (orientation == Transformation::Orientation::ID)
or (orientation == Transformation::Orientation::MX)) or (orientation == Transformation::Orientation::MX))
rowZeroOrientation = false;
else
rowZeroOrientation = true; rowZeroOrientation = true;
else
rowZeroOrientation = false;
} }
// Tests for each Instance. // Tests for each Instance.
@ -522,7 +522,6 @@ namespace {
Row* Surface::InsertSubRowInRow(SubRow* subrow, bool orientation) Row* Surface::InsertSubRowInRow(SubRow* subrow, bool orientation)
{ {
//cerr << subrow << endl;
Row* row = NULL; Row* row = NULL;
if (_rowVector.size() == 0) if (_rowVector.size() == 0)
{ {
@ -553,7 +552,6 @@ Row* Surface::InsertSubRowInRow(SubRow* subrow, bool orientation)
} }
} }
row->_InsertSubRow(subrow); row->_InsertSubRow(subrow);
//cerr << row << endl;
return row; return row;
} }

View File

@ -117,6 +117,7 @@ namespace Mauka {
void Run (); void Run ();
void Test (); void Test ();
void Save () const; void Save () const;
void insertFeeds ();
void PlotBinsStats () const; void PlotBinsStats () const;
void Plot () const; void Plot () const;