* ./hurricane/src/hurricane :

- Bug : double deletion of ExtensionSlice, one in Cell and one in
        ExtensionGo::unmaterialize() when the last ExtensionGo is removed.
        Keep the one in unmaterialize.
    - Bug : missing "_preDestroy()" in ExtensionGo (not really a bug but may
        be useful in the future).
    - Modification : begin to uses "ltrace(level)" instead of "trace()".
        Levels affecteds to Hurricane are 0-10 (the lowest).
This commit is contained in:
Jean-Paul Chaput 2008-11-16 22:11:40 +00:00
parent 6101ba0b3a
commit a9191bb93f
8 changed files with 76 additions and 52 deletions

View File

@ -39,7 +39,6 @@ namespace Hurricane {
{ {
ExtensionSliceMap::iterator islice = _extensionSlices.find ( slice->getName() ); ExtensionSliceMap::iterator islice = _extensionSlices.find ( slice->getName() );
if ( islice != _extensionSlices.end() ) { if ( islice != _extensionSlices.end() ) {
islice->second->_destroy ();
_extensionSlices.erase ( islice ); _extensionSlices.erase ( islice );
} }
} }

View File

@ -24,11 +24,11 @@ Entity::Entity()
{ {
} }
void Entity::_preDestroy()
// ********************** void Entity::_preDestroy()
{ {
// trace << "entering Entity::_preDestroy: " << this << endl; //ltrace(10) << "Entity::_preDestroy() - " << (void*)this << endl;
// trace_in(); //ltracein(10);
vector<Entity*> slaveEntities; vector<Entity*> slaveEntities;
SlaveEntityMap::iterator it; SlaveEntityMap::iterator it;
@ -46,28 +46,28 @@ void Entity::_preDestroy()
stack<SharedPath*> sharedPathStack; stack<SharedPath*> sharedPathStack;
for_each_instance(instance, getCell()->getSlaveInstances()) { for_each_instance(instance, getCell()->getSlaveInstances()) {
SharedPath* sharedPath = instance->_getSharedPath(NULL); SharedPath* sharedPath = instance->_getSharedPath(NULL);
if (sharedPath) sharedPathStack.push(sharedPath); if (sharedPath) sharedPathStack.push(sharedPath);
end_for; end_for;
} }
while (!sharedPathStack.empty()) { while (!sharedPathStack.empty()) {
SharedPath* sharedPath = sharedPathStack.top(); SharedPath* sharedPath = sharedPathStack.top();
sharedPathStack.pop(); sharedPathStack.pop();
Quark* quark = _getQuark(sharedPath); Quark* quark = _getQuark(sharedPath);
if (quark) quark->destroy(); if (quark) quark->destroy();
Cell* cell = sharedPath->getOwnerCell(); Cell* cell = sharedPath->getOwnerCell();
for_each_instance(instance, cell->getSlaveInstances()) { for_each_instance(instance, cell->getSlaveInstances()) {
SharedPath* sharedPath2 = instance->_getSharedPath(sharedPath); SharedPath* sharedPath2 = instance->_getSharedPath(sharedPath);
if (sharedPath2) sharedPathStack.push(sharedPath2); if (sharedPath2) sharedPathStack.push(sharedPath2);
end_for; end_for;
} }
} }
Inherit::_preDestroy(); Inherit::_preDestroy();
// trace << "exiting Entity::_preDestroy:" << endl; //ltrace(10) << "Entity::_preDestroy() - exit" << endl;
// trace_out(); //ltraceout(10);
} }
string Entity::_getString() const string Entity::_getString() const
// ****************************** // ******************************

View File

@ -42,6 +42,13 @@ namespace Hurricane {
{ } { }
void ExtensionGo::_preDestroy ()
{
ltrace(10) << "ExtensionGo::_preDestroy() - " << (void*)this << endl;
Go::_preDestroy ();
}
void ExtensionGo::materialize () void ExtensionGo::materialize ()
{ {
if ( !isMaterialized() ) { if ( !isMaterialized() ) {
@ -60,6 +67,9 @@ namespace Hurricane {
void ExtensionGo::unmaterialize () void ExtensionGo::unmaterialize ()
{ {
//ltrace(9) << "ExtensionGo::unmaterialize() - " << (void*)this << endl;
//ltracein(9);
if ( isMaterialized() ) { if ( isMaterialized() ) {
ExtensionSlice* slice = _cell->getExtensionSlice ( getName() ); ExtensionSlice* slice = _cell->getExtensionSlice ( getName() );
if ( slice ) { if ( slice ) {
@ -68,6 +78,9 @@ namespace Hurricane {
if ( slice->isEmpty() ) slice->_destroy (); if ( slice->isEmpty() ) slice->_destroy ();
} }
} }
//ltrace(9) << "ExtensionGo::unmaterialize() - exit" << endl;
//ltraceout(9);
} }

View File

@ -50,6 +50,7 @@ namespace Hurricane {
ExtensionSlice::~ExtensionSlice () ExtensionSlice::~ExtensionSlice ()
{ {
ltrace(10) << "ExtensionSlice::~ExtensionSlice() - " << (void*)this << endl;
_cell->_removeSlice ( this ); _cell->_removeSlice ( this );
} }

View File

@ -51,18 +51,19 @@ void Go::_postCreate()
if (!autoMaterializationIsDisabled()) materialize(); // materialized after entire post creation if (!autoMaterializationIsDisabled()) materialize(); // materialized after entire post creation
} }
void Go::_preDestroy() void Go::_preDestroy()
// ******************
{ {
// trace << "entering Go::_preDestroy: " << this << endl; //ltrace(10) << "Go::_preDestroy() - " << (void*)this << endl;
// trace_in(); //ltracein(10);
unmaterialize(); // unmaterialized before starting pre destruction unmaterialize(); // unmaterialized before starting pre destruction
//ltrace(10) << "Unmaterialize successful" << endl;
Inherit::_preDestroy(); Inherit::_preDestroy();
// trace << "exiting Go::_preDestroy:" << endl; //ltrace(10) << "Go::_preDestroy() - exit" << endl;
// trace_out(); //ltraceout(10);
} }
string Go::_getString() const string Go::_getString() const

View File

@ -52,8 +52,9 @@ namespace Hurricane {
Cell* _cell; Cell* _cell;
protected: protected:
// Internal: Constructor. // Internal: Constructor & destructors.
ExtensionGo ( Cell* ); ExtensionGo ( Cell* );
virtual void _preDestroy ();
}; };

View File

@ -73,6 +73,7 @@ namespace Hurricane {
// Constructor. // Constructor.
static Technology* create ( DataBase* , const Name& ); static Technology* create ( DataBase* , const Name& );
// Accessors. // Accessors.
inline bool isMetal ( const Layer* ) const;
inline DataBase* getDataBase () const; inline DataBase* getDataBase () const;
inline const Name& getName () const; inline const Name& getName () const;
inline Layer* getLayer ( const Name& ) const; inline Layer* getLayer ( const Name& ) const;
@ -125,6 +126,7 @@ namespace Hurricane {
// Inline Functions. // Inline Functions.
inline bool Technology::isMetal ( const Layer* layer ) const { return _metalMask.contains(layer->getMask()); }
inline DataBase* Technology::getDataBase () const { return _dataBase; } inline DataBase* Technology::getDataBase () const { return _dataBase; }
inline const Name& Technology::getName () const { return _name; } inline const Name& Technology::getName () const { return _name; }
inline Layer* Technology::getLayer ( const Name& name ) const { return _layerMap.getElement(name); } inline Layer* Technology::getLayer ( const Name& name ) const { return _layerMap.getElement(name); }

View File

@ -23,30 +23,31 @@
// x-----------------------------------------------------------------x // x-----------------------------------------------------------------x
# include <QMouseEvent> #include <QMouseEvent>
# include <QKeyEvent> #include <QKeyEvent>
# include <QAction> #include <QAction>
# include <QPainter> #include <QPainter>
# include <QStylePainter> #include <QStylePainter>
# include <QBitmap> #include <QBitmap>
# include <QLabel> #include <QLabel>
# include "hurricane/DataBase.h" #include "hurricane/DataBase.h"
# include "hurricane/Technology.h" #include "hurricane/Technology.h"
# include "hurricane/BasicLayer.h" #include "hurricane/BasicLayer.h"
# include "hurricane/Cell.h" #include "hurricane/Cell.h"
# include "hurricane/Instance.h" #include "hurricane/Instance.h"
# include "hurricane/Slice.h" #include "hurricane/Slice.h"
# include "hurricane/Segment.h" #include "hurricane/Segment.h"
# include "hurricane/Contact.h" #include "hurricane/Contact.h"
# include "hurricane/Pad.h" #include "hurricane/Pad.h"
#include "hurricane/RoutingPad.h"
# include "hurricane/viewer/Graphics.h" #include "hurricane/viewer/Graphics.h"
# include "hurricane/viewer/HPaletteEntry.h" #include "hurricane/viewer/HPaletteEntry.h"
# include "hurricane/viewer/HPalette.h" #include "hurricane/viewer/HPalette.h"
// # include "MapView.h" // #include "MapView.h"
# include "hurricane/viewer/Command.h" #include "hurricane/viewer/Command.h"
# include "hurricane/viewer/CellWidget.h" #include "hurricane/viewer/CellWidget.h"
@ -331,6 +332,12 @@ namespace Hurricane {
_cellWidget->drawBox ( transformation.getBox(pad->getBoundingBox(basicLayer)) ); _cellWidget->drawBox ( transformation.getBox(pad->getBoundingBox(basicLayer)) );
return; return;
} }
const RoutingPad* rp = dynamic_cast<const RoutingPad*>(go);
if ( rp ) {
_cellWidget->drawBox ( transformation.getBox(rp->getBoundingBox(basicLayer)) );
return;
}
} }