diff --git a/mauka/CMakeLists.txt b/mauka/CMakeLists.txt index b915bad2..0f85f305 100644 --- a/mauka/CMakeLists.txt +++ b/mauka/CMakeLists.txt @@ -42,6 +42,8 @@ ENDFOREACH(PATH) SET(QT_USE_QTXML "true") 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(HURRICANE REQUIRED) FIND_PACKAGE(CORIOLIS REQUIRED) @@ -49,6 +51,14 @@ FIND_PACKAGE(NIMBUS REQUIRED) FIND_PACKAGE(METIS REQUIRED) 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(cmake_modules) diff --git a/mauka/src/BBPlacer.cpp b/mauka/src/BBPlacer.cpp index 241ec8b1..3dafbfa6 100644 --- a/mauka/src/BBPlacer.cpp +++ b/mauka/src/BBPlacer.cpp @@ -89,133 +89,6 @@ namespace { 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 _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::iterator imerge = _instanceSpans.end(); - list::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::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 { private: BBPlacer* _bbPlacer; @@ -358,8 +231,6 @@ BBPlacer::BBPlacer(MaukaEngine* mauka) void BBPlacer::Save() { - bool insertFeeds = _mauka->doInsertFeeds(); - UpdateSession::open(); bool autoMaterialize = not Go::autoMaterializationIsDisabled(); @@ -368,7 +239,6 @@ void BBPlacer::Save() for (unsigned i = 0; i < _subRowInstances.size(); i++) { SubRow* subRow = _subRowVector[i]; - RowFeed rowFeed ( _mauka, subRow->getBox() ); Transformation::Orientation orientation = (subRow->getRow()->getOrientation()) ? Transformation::Orientation::MY @@ -382,9 +252,6 @@ void BBPlacer::Save() Occurrence instanceOccurrence = _mauka->_instanceOccurrencesVector[instanceId]; Instance* instance = static_cast(instanceOccurrence.getEntity()); - if ( insertFeeds ) - rowFeed.mergeInstanceSpan ( x, x+instance->getAbutmentBox().getWidth() ); - Box masterABox = instance->getMasterCell()->getAbutmentBox(); Transformation instanceTransformation = getTransformation(masterABox, x, y, orientation); @@ -400,8 +267,6 @@ void BBPlacer::Save() instance->setPlacementStatus(Instance::PlacementStatus::PLACED); //setPlacementStatusRecursivelyToPlaced(instance); } - if ( insertFeeds ) - rowFeed.insertFeeds ( _mauka->getCell(), orientation ); } if ( autoMaterialize ) Go::enableAutoMaterialization (); diff --git a/mauka/src/CMakeLists.txt b/mauka/src/CMakeLists.txt index 299e4905..dd658a91 100644 --- a/mauka/src/CMakeLists.txt +++ b/mauka/src/CMakeLists.txt @@ -5,6 +5,7 @@ ${CORIOLIS_INCLUDE_DIR} ${HURRICANE_INCLUDE_DIR} ${CONFIGURATION_INCLUDE_DIR} + ${PYTHON_INCLUDE_PATH} ) set ( includes mauka/Configuration.h mauka/FeedCells.h @@ -20,6 +21,7 @@ mauka/MaukaEngine.h ) set ( mocIncludes mauka/GraphicMaukaEngine.h ) + set ( pyIncludes mauka/PyMaukaEngine.h ) set ( cpps Configuration.cpp BBPlacer.cpp FeedCells.cpp @@ -31,12 +33,40 @@ SimAnnealingPlacer.cpp SubRow.cpp Surface.cpp + InsertFeeds.cpp MaukaEngine.cpp GraphicMaukaEngine.cpp ) + set ( pyCpps PyMauka.cpp + PyMaukaEngine.cpp + ) qt4_wrap_cpp ( mocCpps ${mocIncludes} ) - add_library ( mauka ${cpps} ${mocCpps} ) - install ( TARGETS mauka DESTINATION lib${LIB_SUFFIX} ) - install ( FILES ${includes} ${mocIncludes} DESTINATION include/coriolis2/mauka ) + add_library ( mauka ${cpps} ${mocCpps} ${pyCpps} ) + target_link_libraries ( mauka ${METIS_LIBRARIES} + ${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 ) diff --git a/mauka/src/InsertFeeds.cpp b/mauka/src/InsertFeeds.cpp new file mode 100644 index 00000000..452621bf --- /dev/null +++ b/mauka/src/InsertFeeds.cpp @@ -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 _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 _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::iterator imerge = _instanceSpans.end(); + list::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::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(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)irowmergeInstanceSpan ( 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. diff --git a/mauka/src/MaukaEngine.cpp b/mauka/src/MaukaEngine.cpp index 8422c7cf..0596335d 100644 --- a/mauka/src/MaukaEngine.cpp +++ b/mauka/src/MaukaEngine.cpp @@ -41,6 +41,7 @@ #include "hurricane/HyperNet.h" #include "hurricane/Timer.h" #include "hurricane/DataBase.h" +#include "hurricane/UpdateSession.h" #include "crlcore/AllianceFramework.h" #include "nimbus/GCell.h" #include "nimbus/NimbusEngine.h" @@ -62,6 +63,7 @@ using Hurricane::OccurrenceLocator; using Hurricane::PlugLocator; using Hurricane::HyperNet; using Hurricane::Timer; +using Hurricane::UpdateSession; using namespace CRL; using namespace Nimbus; @@ -145,7 +147,6 @@ void MaukaEngine::Run() //if ( doPlotBins() ) PlotBinsStats(); - //cmess2 << endl << " o Simulated Annealing run took " << timer.getUserTime() << " s ..." << endl; cmess1 << " o Simulated annealing took " << Timer::getStringTime(timer.getCombTime()) << " [+" << Timer::getStringMemory(timer.getIncrease()) << "]." << endl; cmess1 << " (raw measurements : " << timer.getCombTime() @@ -156,6 +157,7 @@ void MaukaEngine::Run() _bbPlacer = new BBPlacer(this); _bbPlacer->Run(); _bbPlacer->Save(); + if ( doInsertFeeds() ) insertFeeds (); //Plot(); } @@ -179,7 +181,7 @@ void VerifyPathCellBox(const Occurrence& occurrence) } void MaukaEngine::Construct() -// ********************** +// ************************** { typedef map InstanceOccurrenceMap; typedef set InstanceSet; @@ -191,12 +193,34 @@ void MaukaEngine::Construct() DbU::DbU::Unit standardCellHeight = 0; - for_each_occurrence(occurrence, getCell()->getLeafInstanceOccurrences()) + UpdateSession::open (); + + forEach ( Occurrence, ioccurrence, getCell()->getNonLeafInstanceOccurrences() ) { - Instance* instance = static_cast(occurrence.getEntity()); - if (!instance->isFixed()) + Box topLevelAbutmentBox = getCell()->getAbutmentBox(); + + Instance* instance = static_cast((*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((*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(); DbU::DbU::Unit insWidth = model->getAbutmentBox().getWidth(); DbU::DbU::Unit insHeight = model->getAbutmentBox().getHeight(); @@ -208,22 +232,21 @@ void MaukaEngine::Construct() + getString(instance->getName()) + " must be placed"); } - _instanceOccurrencesVector.push_back(occurrence); - //VerifyPathCellBox(occurrence); + _instanceOccurrencesVector.push_back(*ioccurrence); + //VerifyPathCellBox(*ioccurrence); _instanceWidths.push_back(insWidth); InstanceSet::iterator isit = instanceSet.find(instance); if (isit != instanceSet.end()) { cerr << "Unplaced Instance : " << *isit << endl; - cerr << "Unplaced Occurrence : " << occurrence << endl; + cerr << "Unplaced Occurrence : " << (*ioccurrence) << endl; cerr << (*isit)->getPlacementStatus() << endl; throw Error("Each unplaced instance must have one occurrence only"); } - _instanceOccurrencesMap[occurrence] = instanceId++; + _instanceOccurrencesMap[*ioccurrence] = instanceId++; instanceSet.insert(instance); _instanceNets.push_back(UVector()); } - end_for; } if (_instanceOccurrencesVector.size() == 0) diff --git a/mauka/src/Row.cpp b/mauka/src/Row.cpp index 3bbe1fd0..aeb417d3 100644 --- a/mauka/src/Row.cpp +++ b/mauka/src/Row.cpp @@ -40,6 +40,8 @@ namespace Mauka { +using std::cerr; +using std::endl; using Hurricane::Error; 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"); Row* row = new Row(cell, surface, box, orientation); row->_postCreate(); + return row; } diff --git a/mauka/src/Surface.cpp b/mauka/src/Surface.cpp index 3d58a564..47871035 100644 --- a/mauka/src/Surface.cpp +++ b/mauka/src/Surface.cpp @@ -327,16 +327,16 @@ typedef list PlacementProblemList; if ( (refInsSliceHeight % 2 == 0) or (orientation == Transformation::Orientation::ID) or (orientation == Transformation::Orientation::MX)) - rowZeroOrientation = true; - else rowZeroOrientation = false; + else + rowZeroOrientation = true; } else { if ( (refInsSliceHeight % 2 == 0) or (orientation == Transformation::Orientation::ID) or (orientation == Transformation::Orientation::MX)) - rowZeroOrientation = false; - else rowZeroOrientation = true; + else + rowZeroOrientation = false; } // Tests for each Instance. @@ -522,7 +522,6 @@ namespace { Row* Surface::InsertSubRowInRow(SubRow* subrow, bool orientation) { - //cerr << subrow << endl; Row* row = NULL; if (_rowVector.size() == 0) { @@ -553,7 +552,6 @@ Row* Surface::InsertSubRowInRow(SubRow* subrow, bool orientation) } } row->_InsertSubRow(subrow); - //cerr << row << endl; return row; } diff --git a/mauka/src/mauka/MaukaEngine.h b/mauka/src/mauka/MaukaEngine.h index a30ac9bf..46ccae1f 100644 --- a/mauka/src/mauka/MaukaEngine.h +++ b/mauka/src/mauka/MaukaEngine.h @@ -117,6 +117,7 @@ namespace Mauka { void Run (); void Test (); void Save () const; + void insertFeeds (); void PlotBinsStats () const; void Plot () const;