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;
detailedPlace(detailedIterations, detailedEffort, detailedOptions);
Breakpoint::stop( 100, "Before adding feeds." );
cmess2 << " o Adding feed cells." << endl;
toHurricane();
//toHurricane();
//addFeeds();
cmess1 << " o Placement finished." << endl;

View File

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

View File

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

View File

@ -76,6 +76,7 @@ extern "C" {
DirectVoidMethod(EtesianEngine,etesian,resetPlacement)
DirectVoidMethod(EtesianEngine,etesian,clearColoquinte)
DirectVoidMethod(EtesianEngine,etesian,flattenPower)
DirectVoidMethod(EtesianEngine,etesian,toHurricane)
DirectGetUIntAttribute (PyEtesianEngine_doHFNS ,doHFNS ,PyEtesianEngine,EtesianEngine)
DirectSetLongAttribute (PyEtesianEngine_setFixedAbHeight,setFixedAbHeight,PyEtesianEngine,EtesianEngine)
DirectSetLongAttribute (PyEtesianEngine_setFixedAbWidth ,setFixedAbWidth ,PyEtesianEngine,EtesianEngine)
@ -267,6 +268,8 @@ extern "C" {
, "Build abstract interface in top cell for supply & blockages." }
, { "doHFNS" , (PyCFunction)PyEtesianEngine_doHFNS , METH_NOARGS
, "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 the associated hurricane object. The python object remains." }
, {NULL, NULL, 0, NULL} /* sentinel */

View File

@ -132,6 +132,8 @@ namespace Etesian {
class Tile {
public:
inline Tile ( DbU::Unit xMin, DbU::Unit width, const Occurrence& );
inline Tile ( const Tile& );
inline ~Tile ();
inline bool isFixed () const;
inline DbU::Unit getXMin () const;
inline DbU::Unit getXMax () const;
@ -140,6 +142,7 @@ namespace Etesian {
inline Instance* getInstance () const;
inline const Occurrence& getOccurrence () const;
inline void translate ( DbU::Unit );
inline Tile& operator= ( const Tile& );
inline std::string _getString () const;
Record* _getRecord () const;
private:
@ -149,7 +152,26 @@ namespace Etesian {
};
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; }