* ./nimbus:

- New: Adds a standard Configuration mechanism.
    - New: Allow the user to specify the aspect ratio in addition to the
        margin.
This commit is contained in:
Jean-Paul Chaput 2010-06-08 12:12:01 +00:00
parent a9808704a0
commit 294867edc0
11 changed files with 5675 additions and 9 deletions

View File

@ -15,7 +15,7 @@ IF(UNIX)
# #
# Look for an installation. # Look for an installation.
# #
FIND_PATH(NIMBUS_INCLUDE_PATH NAMES nimbus/Nimbus.h PATHS FIND_PATH(NIMBUS_INCLUDE_PATH NAMES nimbus/NimbusEngine.h PATHS
# Look in other places. # Look in other places.
${CORIOLIS_DIR_SEARCH} ${CORIOLIS_DIR_SEARCH}
PATH_SUFFIXES include/coriolis2 PATH_SUFFIXES include/coriolis2

View File

@ -1,11 +1,12 @@
include ( ${QT_USE_FILE} ) include ( ${QT_USE_FILE} )
include_directories ( ${HURRICANE_INCLUDE_DIR} include_directories ( ${NIMBUS_SOURCE_DIR}/src
${NIMBUS_SOURCE_DIR}/src ${HURRICANE_INCLUDE_DIR}
${CORIOLIS_INCLUDE_DIR} ${CORIOLIS_INCLUDE_DIR}
) )
set ( includes nimbus/SplitterContact.h nimbus/SplitterContacts.h set ( includes nimbus/Configuration.h
nimbus/SplitterContact.h nimbus/SplitterContacts.h
nimbus/Splitter.h nimbus/Splitters.h nimbus/Splitter.h nimbus/Splitters.h
nimbus/Fence.h nimbus/Fences.h nimbus/Fence.h nimbus/Fences.h
nimbus/HFence.h nimbus/HFence.h
@ -15,10 +16,11 @@
nimbus/StepProperty.h nimbus/StepProperty.h
nimbus/GCell.h nimbus/GCells.h nimbus/GCell.h nimbus/GCells.h
nimbus/Grid.h nimbus/Grid.h
nimbus/Nimbus.h nimbus/NimbusEngine.h
nimbus/RoutTools.h nimbus/RoutTools.h
) )
set ( cpps SplitterContact.cpp set ( cpps Configuration.cpp
SplitterContact.cpp
Splitter.cpp Splitter.cpp
Fence.cpp Fence.cpp
FenceProperty.cpp FenceProperty.cpp
@ -28,7 +30,7 @@
GCell.cpp GCell.cpp
Grid.cpp Grid.cpp
StepProperty.cpp StepProperty.cpp
Nimbus.cpp NimbusEngine.cpp
RoutTools.cpp RoutTools.cpp
) )

760
nimbus/src/Fence.cpp Normal file
View File

@ -0,0 +1,760 @@
// This file is part of the Coriolis Project.
// Copyright (C) Laboratoire LIP6 - Departement ASIM
// Universite Pierre et Marie Curie
//
// Date : 29/01/2004
// Author : Hugo Clément <Hugo.Clement@lip6.fr>
#include "nimbus/NimbusEngine.h"
namespace Nimbus {
using namespace std;
const Name Fence::_extensionName = "Nimbus::Grid";
/*
* ********************************************************************
* Fence_Splitters declaration
* ********************************************************************
*/
class Fence_Splitters : public Collection<Splitter*> {
public: typedef Collection<Splitter*> Inherit;
public: class Locator : public Hurricane::Locator<Splitter*> {
public: typedef Hurricane::Locator<Splitter*> Inherit;
private: const SplitterSet* _spset;
private: SplitterSet::iterator _spit;
public: Locator(const SplitterSet* spset, SplitterSet::iterator spit);
public: Locator(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: virtual Splitter* getElement() const;
public: virtual Hurricane::Locator<Splitter*>* getClone() const;
public: virtual bool isValid() const;
public: virtual void progress();
public: virtual string _getString() const;
};
private: const SplitterSet* _spset;
private: SplitterSet::iterator _spit;
public: Fence_Splitters(const SplitterSet* spset);
public: Fence_Splitters(const Fence_Splitters& splitters);
public: Fence_Splitters& operator=(const Fence_Splitters& splitters);
public: virtual Collection<Splitter*>* getClone() const;
public: virtual Hurricane::Locator<Splitter*>* getLocator() const;
public: virtual string _getString() const;
};
/*
* ********************************************************************
* Fence_GCells declaration
* ********************************************************************
*/
class Fence_GCells : public Collection<GCell*> {
public: typedef Collection<GCell*> Inherit;
public: class Locator : public Hurricane::Locator<GCell*> {
public: typedef Hurricane::Locator<GCell*> Inherit;
private: const Fence* _fence;
private: GCell* _gc;
public: Locator(const Fence* fence, GCell* gcell = NULL);
public: Locator(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: virtual GCell* getElement() const;
public: virtual Hurricane::Locator<GCell*>* getClone() const;
public: virtual bool isValid() const;
public: virtual void progress();
public: virtual string _getString() const;
};
private: const Fence* _fence;
private: GCell* _gc;
public: Fence_GCells(const Fence* fence);
public: Fence_GCells(const Fence_GCells& gcelles);
public: Fence_GCells& operator=(const Fence_GCells& gcelles);
public: virtual Collection<GCell*>* getClone() const;
public: virtual Hurricane::Locator<GCell*>* getLocator() const;
public: virtual string _getString() const;
};
RoutingGauge* Fence::_routingGauge = NULL;
/*
* ********************************************************************
* Fence implementation
*
*/
Fence::Fence ( Grid* grid, DbU::Unit size, unsigned capacity, unsigned occupancy, bool visible)
: Inherit (grid->getCell())
, _splitters ()
, _components ()
, _occupancy (occupancy)
, _capacity (capacity)
, _frontLine (NULL)
, _nextOfFenceSubFenceSet(NULL)
, _nextOfGCellSubFenceSet(NULL)
, _nextOfGridFenceSet(NULL)
, _isARoutingFence(false)
, _visible(visible)
, _step (0)
, _size (size)
, _grid (grid)
, _subFences()
{
return;
}
Fence::~Fence ()
{
return;
}
void Fence::_preDestroy() {
//throw Error ("[ERROR] Fence deletion temporarily disabled (to be fixed...)");
Inherit::_preDestroy();
Fence* parentFence = getParentFence();
if (parentFence) parentFence->removeSubFence(this);
for (
SplitterSet::iterator spit = _splitters.begin() ;
spit != _splitters.end() ;
spit++
)
{
(*spit)->onDeletedFence();
}
#if 0
// remove Fence property ?
for (
ComponentSet::iterator cit = _components.begin() ;
cit != _components.end() ;
cit++
)
{
(*cit)->onDeletedFence();
}
#endif
return;
}
void Fence::_postCreate ()
{
Inherit::_postCreate();
//getGCell1()->addSurroundingFence (this);
//getGCell2()->addSurroundingFence (this);
Fence* parentFence = getParentFence();
if (parentFence) parentFence->addSubFence(this);
computeCapacity();
return;
};
void Fence::setAsRoutingFence()
{
if (_isARoutingFence) return;
_isARoutingFence = true;
_grid->getNimbus()->addToRoutingFences(this);
return;
}
void Fence::destroy()
{
_preDestroy();
delete this;
}
void Fence::computeCapacity()
{
#if 0
unsigned pitch = static_cast<unsigned>(getValue (getCDataBase()->getPitch()));
unsigned nlayers = getGrid()->getNimbus()->getNumberOfRoutingLayers();
//Name alu1 ("alu1");
double capa (0);
for_each_layergauge (routingLayerGauge, _routingGauge)
{
capa += routingLayerGauge->getTrackNumber(fence->getMin(), fence->getMax());
end_for;
}
setCapacity(static_cast<unsigned>(capa/2));
#endif
return;
}
void Fence::_moveTo (DbU::Unit target)
{
for_each_fence (subfence, getSubFences())
{
subfence->_moveTo (target);
end_for;
}
return;
}
DbU::Unit Fence::getDistance() const {
Point p1 = getGCell1()->getCenter();
Point p2 = getGCell2()->getCenter();
return p1.manhattanDistance(p2);
}
void Fence::attachSplitter (Splitter* splitter)
{
_splitters.insert(splitter);
_occupancy ++;
return;
}
void Fence::detachSplitter (Splitter* splitter)
{
SplitterSet::iterator spit = _splitters.find (splitter);
if (spit != _splitters.end()) {
_splitters.erase (spit);
_occupancy --;
} else {
throw Error ("DetachSplitter: the splitter is not attached to this fence");
}
return;
}
void Fence::attachComponent (Component* component)
{
_components.insert(component);
_occupancy ++;
return;
}
void Fence::detachComponent (Component* component)
{
ComponentSet::iterator cit = _components.find (component);
if (cit != _components.end()) {
_components.erase (cit);
_occupancy --;
} else {
throw Error ("DetachComponent: the component is not attached to this fence");
}
return;
}
string Fence::_getString() const {
return "<" + _TName ( "Fence" )
+ " " + getString ( getX() )
+ " " + getString ( getY() ) + ">";
}
Record* Fence::_getRecord() const {
Record* record = Inherit::_getRecord();
if (record) {
record->add(getSlot("Capacity", _capacity));
record->add(getSlot("Occupancy", _occupancy));
record->add(getSlot("Size", _size));
record->add(getSlot("Step", _step));
record->add(getSlot("Visible", _visible));
record->add(getSlot("RoutingFence", _isARoutingFence));
record->add(getSlot("X", getX()));
record->add(getSlot("Y", getY()));
}
return record;
}
// void Fence::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
// {
// if (!isVisible()) return;
// Point p1 = transformation.getPoint(getP1());
// Point p2 = transformation.getPoint(getP2());
// DbU::Unit halfWidth;
// DbU::Unit pitch = getCDataBase()->getDefaultCGPitch();
// if (_capacity != 0)
// halfWidth = DbU::lambda( (((getValue(_size)/10) * ((double)_occupancy)) / ((double)_capacity))/2 );
// else
// halfWidth = DbU::lambda( (((getValue(_size)/10) * ((double)_occupancy)) / 1 )/2 );
// if (p1.getX() == p2.getX())
// {
// Point pp1 = Point (p1.getX() + halfWidth, p1.getY() + pitch);
// Point pp2 = Point (p2.getX() - halfWidth, p2.getY() - pitch);
// view->FillRectangle (pp1, pp2);
// Point pp1f = Point (p1.getX() + DbU::lambda(getValue(_size)/20), p1.getY() + pitch);
// Point pp2f = Point (p2.getX() - DbU::lambda(getValue(_size)/20), p2.getY() - pitch);
// view->DrawRectangle (pp1f, pp2f);
// }
// else if (p1.getY() == p2.getY())
// {
// Point pp1 = Point (p1.getX() + pitch, p1.getY() + halfWidth);
// Point pp2 = Point (p2.getX() - pitch, p2.getY() - halfWidth );
// view->FillRectangle (pp1, pp2);
// Point pp1f = Point (p1.getX() + pitch, p1.getY() + DbU::lambda(getValue(_size)/20));
// Point pp2f = Point (p2.getX() - pitch, p2.getY() - DbU::lambda(getValue(_size)/20));
// view->DrawRectangle (pp1f, pp2f);
// }
// else
// {
// view->DrawLine(p1, p2);
// }
// return;
// }
// void Fence::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
// {
// Point p1 = transformation.getPoint(getP1());
// Point p2 = transformation.getPoint(getP2());
// view->DrawLine(p1, p2);
// return;
// }
Box Fence::getBoundingBox () const
{
Box box;
Point p1 = getP1();
Point p2 = getP2();
if (p1.getX() == p2.getX())
{
Point pp1f = Point (p1.getX() + (_size/20), p1.getY() + DbU::lambda(1));
Point pp2f = Point (p2.getX() - (_size/20), p2.getY() - DbU::lambda(1));
box = Box(pp1f);
box.merge(pp2f);
}
else if (p1.getY() == p2.getY())
{
Point pp1f = Point (p1.getX() + DbU::lambda(1), p1.getY() + (_size/20));
Point pp2f = Point (p2.getX() - DbU::lambda(1), p2.getY() - (_size/20));
box = Box(pp1f);
box.merge(pp2f);
}
else
{
box = Box(p1);
box.merge(p2);
}
box.inflate(DbU::lambda(1), DbU::lambda(2));
return box;
}
void Fence::setFrontLine(FrontLine* frontLine)
{
if (getFrontLine() != frontLine) throw Error ("Fence is in another frontline already");
_frontLine = frontLine;
return;
}
FrontLine* Fence::getFrontLine()
{
if (!_frontLine)
{
Fence* parentFence = getParentFence();
if (parentFence) _frontLine = parentFence->getFrontLine();
}
return _frontLine;
}
Splitters Fence::getSplitters () const
{
return Fence_Splitters(&_splitters);
}
GCells Fence::getGCells () const
{
return Fence_GCells(this);
}
void Fence::addSubFence (Fence* fence)
{
_subFences._insert(fence);
return;
}
void Fence::removeSubFence (Fence* fence)
{
_subFences._remove(fence);
return;
}
GCell* Fence::getOppositeGCell (GCell* gcell) const {
if (getGCell1() == gcell) {
return getGCell2();
} else if (getGCell2() == gcell) {
return getGCell1();
}
throw Error ("[ERROR] fence: not a gcell of mine");
}
Fence* Fence::getParentFence() const {
GCell* gc1 = getGCell1()->getContainer();
GCell* gc2 = getGCell2()->getContainer();
if (gc1 == gc2) return NULL;
return _grid->getFenceBetween(gc1,gc2);
}
Splitter* Fence::getNetSplitter(Net* net) const
{
for (
SplitterSet::iterator spit = _splitters.begin() ;
spit != _splitters.end();
spit++
)
{
if ( (*spit)->getNet() == net )
return (*spit);
}
return NULL;
}
Cell* Fence::getCell() const {
return _grid->getCell();
}
// bool Fence::_IsInterceptedBy(View* view, const Point& point, const DbU::Unit& aperture) const
// {
// if (!isVisible()) return false;
// Box box(point);
// box.inflate(aperture);
// return getBoundingBox().intersect(box);
// }
/*
* ********************************************************************
* Fence_Splitters implementation
*
*/
Fence_Splitters::Fence_Splitters(const SplitterSet* spset)
// **************************************************************************************
: Inherit()
, _spset(spset)
{
assert(spset);
_spit = spset->begin();
}
Fence_Splitters::Fence_Splitters(const Fence_Splitters& splitters)
// ************************************************************************************
: Inherit()
, _spset(splitters._spset)
, _spit(splitters._spit)
{
}
Fence_Splitters& Fence_Splitters::operator=(const Fence_Splitters& splitters)
// ****************************************************************
{
_spset = splitters._spset;
_spit = splitters._spit;
return *this;
}
Collection<Splitter*>* Fence_Splitters::getClone() const
// ***********************************************
{
return new Fence_Splitters(*this);
}
Locator<Splitter*>* Fence_Splitters::getLocator() const
// **********************************************
{
return new Locator(_spset, _spit);
}
string Fence_Splitters::_getString() const
// *************************************
{
string s = "<" + _TName("Fence::Splitters");
//if (_splitterIterator) s += " " + getString((*_splitterIterator));
s += ">";
return s;
}
/*
* ********************************************************************
* Fence_Splitters::Locator implementation
*/
Fence_Splitters::Locator::Locator(const SplitterSet* spset, SplitterSet::iterator spit)
// ************************************************************************************
: Inherit(),
_spset(spset),
_spit(spit)
{
}
Fence_Splitters::Locator::Locator(const Locator& locator)
// ****************************************************
: Inherit(),
_spset(locator._spset),
_spit(locator._spit)
{
}
Fence_Splitters::Locator& Fence_Splitters::Locator::operator=(const Locator& locator)
// ******************************************************************************
{
_spset = locator._spset;
_spit = locator._spit;
return *this;
}
Splitter* Fence_Splitters::Locator::getElement() const
// **************************************************
{
return (*_spit);
}
Locator<Splitter*>* Fence_Splitters::Locator::getClone() const
// *****************************************************************
{
return new Locator(*this);
}
bool Fence_Splitters::Locator::isValid() const
// **************************************************
{
return (_spit != _spset->end());
}
void Fence_Splitters::Locator::progress()
// *********************************************
{
_spit++;
return;
}
string Fence_Splitters::Locator::_getString() const
// *******************************************************
{
string s = "<" + _TName("Fence::Splitters::Locator");
if (_spit != _spset->end()) s += " " + getString(*_spit);
s += ">";
return s;
}
/*
* ********************************************************************
* Fence_GCells implementation
*/
Fence_GCells::Fence_GCells(const Fence* fence)
// **************************************************************************************
: Inherit()
, _fence(fence)
, _gc(fence->getGCell1())
{
}
Fence_GCells::Fence_GCells(const Fence_GCells& gcelles)
// ************************************************************************************
: Inherit()
, _fence(gcelles._fence)
, _gc(gcelles._gc)
{
}
Fence_GCells& Fence_GCells::operator=(const Fence_GCells& gcelles)
// ****************************************************************
{
_fence = gcelles._fence;
_gc = gcelles._gc;
return *this;
}
Collection<GCell*>* Fence_GCells::getClone() const
// ***********************************************
{
return new Fence_GCells(*this);
}
Locator<GCell*>* Fence_GCells::getLocator() const
// **********************************************
{
return new Locator(_fence, _gc);
}
string Fence_GCells::_getString() const
// *************************************
{
string s = "<" + _TName("Fence::GCells");
if (_gc) s += " " + getString(_gc);
s += ">";
return s;
}
/*
* ********************************************************************
* Fence_GCells::Locator implementation
*/
Fence_GCells::Locator::Locator(const Fence* fence, GCell* gcell)
// ********************************************************
: Inherit(),
_fence(fence),
_gc(gcell)
{
}
Fence_GCells::Locator::Locator(const Locator& locator)
// ****************************************************
: Inherit(),
_fence(locator._fence),
_gc(locator._gc)
{
}
Fence_GCells::Locator& Fence_GCells::Locator::operator=(const Locator& locator)
// ******************************************************************************
{
_fence = locator._fence;
_gc = locator._gc;
return *this;
}
GCell* Fence_GCells::Locator::getElement() const
// **************************************************
{
return _gc;
}
Locator<GCell*>* Fence_GCells::Locator::getClone() const
// *****************************************************************
{
return new Locator(*this);
}
bool Fence_GCells::Locator::isValid() const
// **************************************************
{
return (_gc != NULL);
}
void Fence_GCells::Locator::progress()
// *********************************************
{
if (_gc == _fence->getGCell1()) {
_gc = _fence->getGCell2();
} else {
_gc = NULL;
}
return;
}
string Fence_GCells::Locator::_getString() const
// *******************************************************
{
string s = "<" + _TName("Fence::GCells::Locator");
if (_gc) s += " " + getString(_gc);
s += ">";
return s;
}
/*
* ********************************************************************
* SubFenceSet implementation
*
*/
Fence::SubFenceSet::SubFenceSet()
// *******************************
: Inherit()
{
}
unsigned Fence::SubFenceSet::_getHashValue(Fence* fence) const
{
return ( (unsigned int)( (unsigned long)fence ) ) / 2;
}
Fence* Fence::SubFenceSet::_getNextElement(Fence* fence) const
{
return fence->_getNextOfFenceSubFenceSet();
}
void Fence::SubFenceSet::_setNextElement(Fence* fence, Fence* nextFence) const
{
fence->_setNextOfFenceSubFenceSet(nextFence);
return;
}
} // namespace Nimbus

115
nimbus/src/FrontLine.cpp Normal file
View File

@ -0,0 +1,115 @@
//
// This file is part of the Coriolis Project.
// Copyright (C) Laboratoire LIP6 - Departement ASIM
// Universite Pierre et Marie Curie
//
// Main contributors :
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
// Hugo Clément <Hugo.Clement@lip6.fr>
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
// Damien Dupuis <Damien.Dupuis@lip6.fr>
// Christian Masson <Christian.Masson@lip6.fr>
// Marek Sroka <Marek.Sroka@lip6.fr>
//
// The Coriolis Project is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// The Coriolis Project is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with the Coriolis Project; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//
// License-Tag
//
//
// Date : 29/01/2004
// Author : Hugo Clément <Hugo.Clement@lip6.fr>
//
// Authors-Tag
#include "nimbus/NimbusEngine.h"
namespace Nimbus {
using namespace Hurricane;
/*
* ********************************************************************
* FrontLine implementation
*
*/
FrontLine::FrontLine ()
: _rootFences()
{
}
FrontLine::~FrontLine ()
{
}
FrontLine* FrontLine::create ()
{
FrontLine* frontline = new FrontLine ();
if (!frontline) throw Error("unable to create a frontline");
frontline->_postCreate ();
return frontline;
}
void FrontLine::destroy ()
{
throw Error("Deletion of FrontLine undefined yet");
return;
}
void FrontLine::_preDestroy ()
{
return;
}
void FrontLine::_postCreate ()
{
return;
}
void FrontLine::addRootFence (Fence* fence)
{
// We may add some sanity checks here
// but we don't because FrontLine are created
// by an already consistency checked routine
_rootFences.push_back (fence);
fence->setFrontLine(this);
return;
}
void FrontLine::moveTo (DbU::Unit target)
{
for (
vector<Fence*>::iterator fit = _rootFences.begin() ;
fit != _rootFences.end() ;
fit++
)
{
(*fit)->_moveTo (target);
}
return;
}
} // namespace Nimbus
#if 0
Slot* getSlot (const string& name, Nimbus::FrontLine* frontline)
{
return new StandardSlot<Nimbus::FrontLine>(name, frontline);
}
#endif

1388
nimbus/src/GCell.cpp Normal file

File diff suppressed because it is too large Load Diff

1199
nimbus/src/Grid.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
#include "crlcore/RoutingLayerGauge.h" #include "crlcore/RoutingLayerGauge.h"
#include "nimbus/Nimbus.h" #include "nimbus/NimbusEngine.h"
#include "nimbus/RoutTools.h" #include "nimbus/RoutTools.h"
#include "nimbus/HFence.h" #include "nimbus/HFence.h"

1872
nimbus/src/NimbusEngine.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
// Author : Hugo Clément <Hugo.Clement@lip6.fr> // Author : Hugo Clément <Hugo.Clement@lip6.fr>
#include "nimbus/Nimbus.h" #include "nimbus/NimbusEngine.h"
#include "nimbus/RoutTools.h" #include "nimbus/RoutTools.h"
#include "nimbus/VFence.h" #include "nimbus/VFence.h"

161
nimbus/src/nimbus/Grid.h Normal file
View File

@ -0,0 +1,161 @@
// This file is part of the Coriolis Project.
// Copyright (C) Laboratoire LIP6 - Departement ASIM
// Universite Pierre et Marie Curie
//
// Date : 29/01/2004
// Author : Hugo Clément <Hugo.Clement@lip6.fr>
#ifndef __NIMBUS_GRID_H__
#define __NIMBUS_GRID_H__
#include "hurricane/Contact.h"
#include "nimbus/GCells.h"
#include "nimbus/Fences.h"
namespace Nimbus {
using namespace Hurricane;
class NimbusEngine;
class Grid {
public:
class FenceSet : public IntrusiveSet<Fence> {
public:
typedef IntrusiveSet<Fence> Inherit;
FenceSet();
virtual unsigned _getHashValue(Fence* fence) const;
virtual Fence* _getNextElement(Fence* fence) const;
virtual void _setNextElement(Fence* fence, Fence* nextFence) const;
};
private: NimbusEngine* _nimbus;
private: Cell* _cell;
private: GCell* _rootGCell;
private: Layer* _layer;
private: map<unsigned, FenceSet*> _fences;
/*!
* \fn Grid::Grid ( NimbusEngine* nimbus )
* \param nimbus The engine owning the grid.
*/
public: Grid (NimbusEngine* nimbus);
public: ~Grid ();
public: Cell* getCell() const { return _cell; };
public: NimbusEngine* getNimbus() const { return _nimbus; };
/*!
* \fn void Grid::rectangularShape ( double margin, double aspectRatio, DbU::Unit sumWidth, DbU::Unit minWidth )
* \param margin Additionnal free space in the abutment box
* \param aspectRatio
* \param sumWidth
*/
public: void rectangularShape(double margin, double aspectRatio, DbU::Unit sumWidth, DbU::Unit minWidth);
/*!
* \fn void Grid::horizontalLongSplit (unsigned step, DbU::Unit& Y)
* \param step the hierarchy level to be splitted
* \param Y ordinate of the cut-line
* Makes a full horizontal split of the abutment box apart from a cut line
*/
public: void horizontalLongSplit (unsigned step, DbU::Unit& Y) const;
/*!
* \fn void Grid::verticalLongSplit (unsigned step, DbU::Unit& X)
* \param step the hierarchy level to be splitted
* \param X abscisse of the cut-line
* Makes a full vertical split of the abutment box apart from a cut line
*/
public: void verticalLongSplit (unsigned step, DbU::Unit& X) const;
public: static Grid* create (unsigned n, DbU::Unit& width, DbU::Unit& height);
// Layer du routage global
/*!
* \fn Layer* Grid::getLayer ()
* Returns the hurricane layer for the global route elements (splitters)
*/
public: Layer* getLayer () const;
// Fenetre racine (boite d'aboutement)
/*!
* \fn GCell* Grid::getRoot ()
* Returns the root of the partitionning box tree
*/
public: GCell* getRoot () const { return _rootGCell; };
// Retourne la boite englobante pour p
/*!
* \fn GCell* Grid::getGCell (unsigned step, Point& p)
* \param step the level to be searched
* \param p the point
* Returns the hierarchy level "step" GCell containing p
*/
public: GCell* getGCell (unsigned step, Point& p) const;
/*!
* \fn Box* Grid::getBox (unsigned step, Point& p)
* \param step the level to be searched
* \param p the point
* Returns the hierarchy level "step" hurricane Box containing p
*/
public: const Box getBox (unsigned step, Point& p) const;
// Centre de fenetre correspondant à X, Y, pos pour l'étape step.
public: DbU::Unit getX (unsigned step, DbU::Unit& X) const;
public: DbU::Unit getY (unsigned step, DbU::Unit& Y) const;
public: Point getPosition (unsigned step, Point& pos) const;
public: GCells getGCells (unsigned step) const;
public: GCells getFastGCells (unsigned step) const;
public: void createFences (unsigned step);
public: Fences getFences (unsigned step);
public: Fence* getFenceBetween (GCell* gc1, GCell* gc2) const;
public: Fence* testFenceBetween (GCell* gc1, GCell* gc2) const;
public: GCell* getLeftOf (const GCell* gcell) const;
public: GCell* getRightOf (const GCell* gcell) const;
public: GCell* getUpOf (const GCell* gcell) const;
public: GCell* getDownOf (const GCell* gcell) const;
public: GCell* getUpperLeftCorner (unsigned step) const;
public: GCell* getUpperRightCorner (unsigned step) const;
public: GCell* getLowerLeftCorner (unsigned step) const;
public: GCell* getLowerRightCorner (unsigned step) const;
// affichage, pour le debug
public: void dumpGrid() const;
private: void recDumpGrid (GCell* gcell) const;
// utilisation interne uniquement
private: void recLS (unsigned step, DbU::Unit& coord, unsigned direction, GCell* gcell) const;
private: GCell* recGetGCell (unsigned step, Point& p, GCell* gcell) const;
// compat
public: Box getGRBox (unsigned step, Point &p);
public: Contact* getContact (Net& net, Point& position);
public: Contact* getOrCreateContact (Net& net, Point& position, DbU::Unit width = DbU::lambda(5), DbU::Unit height = DbU::lambda(5));
//public: Contact* getOrCreateContact (Net& net, Point& position);
public: DbU::Unit getHSplitterHalfLength (unsigned _step);
public: DbU::Unit getVSplitterHalfLength (unsigned _step);
public: Point getSubUpRight (unsigned step, Point &pos);
public: Point getSubUpLeft (unsigned step, Point &pos);
public: Point getSubDownRight (unsigned step, Point &pos);
public: Point getSubDownLeft (unsigned step, Point &pos);
};
Grid* getGrid ();
}
#endif

View File

@ -0,0 +1,169 @@
//
// This file is part of the Coriolis Project.
// Copyright (C) Laboratoire LIP6 - Departement ASIM
// Universite Pierre et Marie Curie
//
// Date : 29/01/2004
// Author : Hugo Clément <Hugo.Clement@lip6.fr>
//
// Authors-Tag
#ifndef __NIMBUS_NIMBUS_H__
#define __NIMBUS_NIMBUS_H__
#include "hurricane/Layers.h"
#include "crlcore/ToolEngine.h"
#include "nimbus/Configuration.h"
#include "nimbus/GCell.h"
#include "nimbus/GCells.h"
#include "nimbus/Grid.h"
#include "nimbus/Fence.h"
#include "nimbus/HFence.h"
#include "nimbus/VFence.h"
#include "nimbus/FrontLine.h"
#include "nimbus/Splitter.h"
#include "nimbus/SplitterContact.h"
#include "nimbus/StepProperty.h"
#include "nimbus/FenceProperty.h"
namespace Hurricane {
class Library;
}
namespace Nimbus {
using namespace Hurricane;
class NimbusEngine : public ToolEngine {
typedef ToolEngine Inherit;
// Attributes
// **********
private:
static const Name _toolName;
Configuration* _configuration;
unsigned int _depth;
unsigned int _step;
Grid* _grid;
GCellSet _placementBoxSet;
GCellSet _routingBoxSet;
FenceSet _routingFenceSet;
set<Layer*> _routingLayerSet;
// Constructors
// ************
private: NimbusEngine (Cell* cell, const Box& workzone);
public: static NimbusEngine* create (Cell* cell, const Library* library, const Box& workZone=Box());
// Accessors
// *********
public:
virtual const Name& getName () const;
static const Name& staticGetName ();
static NimbusEngine* get ( Cell* );
inline bool doPinsPlacement () const;
inline double getAspectRatio () const;
inline double getMargin () const;
inline const Box& getWorkZone () const;
public: Grid* getGrid() { return _grid; };
public: unsigned getDepth() { return _depth; };
public: unsigned getSteps() { cerr<<"getSteps is deprecated"<<endl; return _depth; };
public: unsigned getStep() { return _step; };
public: GCells getLeaves() const;
public: GCells getLeaves(unsigned step) const;
public: Fences getFences(unsigned step);
public: Layers getRoutingLayers() const;
public: GCell* getCommonAncester(GCell* gc1, GCell* gc2) const;
public: GCells getPlacementLeaves() const;
public: GCells getRoutingLeaves() const;
public: Fences getRoutingFences() const;
public: GCells getColumnGCells ( unsigned indexColumn ) const;
public: GCells getRowGCells ( unsigned indexRow ) const;
public: GCell* getRoutingLeafContaining(Point& p);
public: GCell* getPlacementLeafContaining(Point& p);
//private: GCell* getLeafContaining(Point& p, GCellSet& gcset);
//public: DbU::Unit getStandardCellHeight() const;
public: bool testMargin ();
public: bool testMargin ( double margin );
// Modifiers
// *********
public: void invalidateSplitterContactsOppositeCounts(Net* net);
public: void invalidateSplitterContactsOppositeCounts();
public: void setPlacementLeaf(GCell* gcell);
public: void setRoutingLeaf(GCell* gcell);
public: void setSubGCellsAsPlacementLeaves(GCell* gcell);
public: void setSubGCellsAsRoutingLeaves(GCell* gcell);
private: void setLeaf(GCell* gcell, GCellSet& gcset);
public: void flushPlacementLeaves();
public: void flushRoutingLeaves();
public: void addToRoutingFences(Fence* fence);
public: void flushRoutingFences();
public: void addToRoutingLayers(Layer* layer);
public: void _removePlacementLeaf(GCell* gcell);
public: void _removeRoutingLeaf(GCell* gcell);
public: void regroup(bool placed = true, bool fixed = false);
public: void placementLeavesUp();
public: void placementLeavesDown();
public: void hideFences();
public: void showPlacementLeaves();
public: void showRoutingLeaves();
// compute the X coordinates which divides a gcell into nbSplits sub-gcells
private: void computeXSplit (GCell* gcell, DbU::Unit* XSplit, unsigned nbSplits);
// compute the Y coordinates which divides a gcell into nbSplits sub-gcells
private: void computeYSplit (GCell* gcell, DbU::Unit* YSplit, unsigned nbSplits);
// Recalls of Nimbus::Grid functions so we are able to create a specific partionning with Python
public: void horizontalLongSplit (unsigned step, DbU::Unit& Y) const;
public: void verticalLongSplit (unsigned step, DbU::Unit& X) const;
// To increment Depth
public: void incrementDepth () { _depth++; };
public: void createFences ( unsigned depth );
public: void placePins();
public: void progress(int nbSplits = 2);
public: void progress(int nbXSplits, int nbYSplits);
public: void destroyLevel(unsigned depth);
private: void recDestroy (unsigned depth, GCell* gcell);
public: void balance();
private: void _recInit (unsigned step, GCell* rgc);
protected: virtual void _postCreate ();
protected: virtual void _preDestroy ();
public: virtual string _getTypeName() const {return _TName("NimbusEngine");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
};
inline bool NimbusEngine::doPinsPlacement () const { return _configuration->doPinsPlacement(); }
inline double NimbusEngine::getAspectRatio () const { return _configuration->getAspectRatio(); }
inline double NimbusEngine::getMargin () const { return _configuration->getMargin(); }
inline const Box& NimbusEngine::getWorkZone () const { return _configuration->getWorkZone(); }
} // namespace Nimbus
#endif // __NIMBUS_NIMBUS_H__