Fix memory corruption in Etesian::Area, separate it's creation.

* In Etesian::Slice::createDiodeUnder(), delete the Instance *after*
    removing the tile referring it. This was working, unless we
    active the debug mode which tries to print the Tile's instance.
* In EtesianEngine::place(), no longer call toHurricane() at the
    end of the placement. Must now be done as a separate step.
    Exported to Python interface.
      This fix is related to the spare buffer removal memory
    corruption
This commit is contained in:
Jean-Paul Chaput 2021-05-11 14:00:04 +02:00
parent 079f4c2009
commit 972787c81e
5 changed files with 36 additions and 5 deletions

View File

@ -1418,9 +1418,7 @@ namespace Etesian {
cmess1 << " o Detailed Placement." << endl; cmess1 << " o Detailed Placement." << endl;
detailedPlace(detailedIterations, detailedEffort, detailedOptions); detailedPlace(detailedIterations, detailedEffort, detailedOptions);
Breakpoint::stop( 100, "Before adding feeds." ); //toHurricane();
cmess2 << " o Adding feed cells." << endl;
toHurricane();
//addFeeds(); //addFeeds();
cmess1 << " o Placement finished." << endl; cmess1 << " o Placement finished." << endl;

View File

@ -101,6 +101,7 @@ namespace Etesian {
EtesianEngine* etesian = getForFramework( CreateEngine ); EtesianEngine* etesian = getForFramework( CreateEngine );
etesian->resetPlacement(); etesian->resetPlacement();
etesian->place(); etesian->place();
etesian->toHurricane();
} }

View File

@ -17,6 +17,7 @@
#include "hurricane/Error.h" #include "hurricane/Error.h"
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
#include "hurricane/DataBase.h" #include "hurricane/DataBase.h"
#include "hurricane/DebugSession.h"
#include "hurricane/UpdateSession.h" #include "hurricane/UpdateSession.h"
#include "hurricane/DeepNet.h" #include "hurricane/DeepNet.h"
#include "hurricane/Plug.h" #include "hurricane/Plug.h"
@ -43,6 +44,7 @@ namespace Etesian {
using Hurricane::DeepNet; using Hurricane::DeepNet;
using Hurricane::Plug; using Hurricane::Plug;
using Hurricane::RoutingPad; using Hurricane::RoutingPad;
using Hurricane::DebugSession;
using Hurricane::UpdateSession; using Hurricane::UpdateSession;
using CRL::AllianceFramework; using CRL::AllianceFramework;
using CRL::CatalogExtension; using CRL::CatalogExtension;
@ -327,8 +329,8 @@ namespace Etesian {
DbU::Unit width = (*iCandidate).getWidth(); DbU::Unit width = (*iCandidate).getWidth();
diodeInst = (*iCandidate).getInstance(); diodeInst = (*iCandidate).getInstance();
Transformation transf = diodeInst->getTransformation(); Transformation transf = diodeInst->getTransformation();
diodeInst->destroy();
_tiles.erase( iCandidate ); _tiles.erase( iCandidate );
diodeInst->destroy();
Occurrence rpOccurrence = rp->getPlugOccurrence(); Occurrence rpOccurrence = rp->getPlugOccurrence();
Path instancePath = rpOccurrence.getPath(); Path instancePath = rpOccurrence.getPath();
@ -683,6 +685,10 @@ namespace Etesian {
return; return;
} }
//Breakpoint::stop( 100, "Before adding feeds." );
cmess2 << " o Adding feed cells." << endl;
//DebugSession::open( 145, 150 );
UpdateSession::open(); UpdateSession::open();
if (_area) delete _area; if (_area) delete _area;
@ -759,6 +765,7 @@ namespace Etesian {
_area->addFeeds(); _area->addFeeds();
UpdateSession::close(); UpdateSession::close();
//DebugSession::close();
if (_viewer) _viewer->getCellWidget()->refresh(); if (_viewer) _viewer->getCellWidget()->refresh();
} }

View File

@ -76,6 +76,7 @@ extern "C" {
DirectVoidMethod(EtesianEngine,etesian,resetPlacement) DirectVoidMethod(EtesianEngine,etesian,resetPlacement)
DirectVoidMethod(EtesianEngine,etesian,clearColoquinte) DirectVoidMethod(EtesianEngine,etesian,clearColoquinte)
DirectVoidMethod(EtesianEngine,etesian,flattenPower) DirectVoidMethod(EtesianEngine,etesian,flattenPower)
DirectVoidMethod(EtesianEngine,etesian,toHurricane)
DirectGetUIntAttribute (PyEtesianEngine_doHFNS ,doHFNS ,PyEtesianEngine,EtesianEngine) DirectGetUIntAttribute (PyEtesianEngine_doHFNS ,doHFNS ,PyEtesianEngine,EtesianEngine)
DirectSetLongAttribute (PyEtesianEngine_setFixedAbHeight,setFixedAbHeight,PyEtesianEngine,EtesianEngine) DirectSetLongAttribute (PyEtesianEngine_setFixedAbHeight,setFixedAbHeight,PyEtesianEngine,EtesianEngine)
DirectSetLongAttribute (PyEtesianEngine_setFixedAbWidth ,setFixedAbWidth ,PyEtesianEngine,EtesianEngine) DirectSetLongAttribute (PyEtesianEngine_setFixedAbWidth ,setFixedAbWidth ,PyEtesianEngine,EtesianEngine)
@ -267,6 +268,8 @@ extern "C" {
, "Build abstract interface in top cell for supply & blockages." } , "Build abstract interface in top cell for supply & blockages." }
, { "doHFNS" , (PyCFunction)PyEtesianEngine_doHFNS , METH_NOARGS , { "doHFNS" , (PyCFunction)PyEtesianEngine_doHFNS , METH_NOARGS
, "Perform the high fanout net synthesis." } , "Perform the high fanout net synthesis." }
, { "toHurricane" , (PyCFunction)PyEtesianEngine_toHurricane , METH_NOARGS
, "Build the Hurricane post-placement manipulation structure." }
, { "destroy" , (PyCFunction)PyEtesianEngine_destroy , METH_NOARGS , { "destroy" , (PyCFunction)PyEtesianEngine_destroy , METH_NOARGS
, "Destroy the associated hurricane object. The python object remains." } , "Destroy the associated hurricane object. The python object remains." }
, {NULL, NULL, 0, NULL} /* sentinel */ , {NULL, NULL, 0, NULL} /* sentinel */

View File

@ -132,6 +132,8 @@ namespace Etesian {
class Tile { class Tile {
public: public:
inline Tile ( DbU::Unit xMin, DbU::Unit width, const Occurrence& ); inline Tile ( DbU::Unit xMin, DbU::Unit width, const Occurrence& );
inline Tile ( const Tile& );
inline ~Tile ();
inline bool isFixed () const; inline bool isFixed () const;
inline DbU::Unit getXMin () const; inline DbU::Unit getXMin () const;
inline DbU::Unit getXMax () const; inline DbU::Unit getXMax () const;
@ -140,6 +142,7 @@ namespace Etesian {
inline Instance* getInstance () const; inline Instance* getInstance () const;
inline const Occurrence& getOccurrence () const; inline const Occurrence& getOccurrence () const;
inline void translate ( DbU::Unit ); inline void translate ( DbU::Unit );
inline Tile& operator= ( const Tile& );
inline std::string _getString () const; inline std::string _getString () const;
Record* _getRecord () const; Record* _getRecord () const;
private: private:
@ -149,7 +152,26 @@ namespace Etesian {
}; };
inline Tile::Tile ( DbU::Unit xMin, DbU::Unit width, const Occurrence& occurrence ) inline Tile::Tile ( DbU::Unit xMin, DbU::Unit width, const Occurrence& occurrence )
: _xMin(xMin), _width(width), _occurrence(occurrence) : _xMin(xMin)
, _width(width)
, _occurrence(occurrence)
{ }
inline Tile::Tile ( const Tile& other )
: _xMin(other._xMin)
, _width(other._width)
, _occurrence(other._occurrence)
{ }
inline Tile& Tile::operator= ( const Tile& other )
{
_xMin = other._xMin;
_width = other._width;
_occurrence = other._occurrence;
return *this;
}
inline Tile::~Tile ()
{ } { }
inline DbU::Unit Tile::getXMin () const { return _xMin; } inline DbU::Unit Tile::getXMin () const { return _xMin; }