Fix memory corruption due to the deletion of unused spare buffers.

* In cumulus/plugins.block.Block.{place,doPnr}(), reorder the
    feed insertion and spare buffer deletion call. Formerly, we
    were :
      1. Creating spare buffersa (Python).
      2. Placing (C++)
      3. Adding feeds (EtesianEngine::toHurricane() call) (C++).
      4. Removing unused spare buffers (Python).
   So, step 4 was *not* informing the C++ placement data-structure
   created at step 3 of the change. Resulting in occurrences using
   deleted Entities (Instance).
     Now we swap step 3. and 4. so toHurricane() is called *after*
   any Python managed change is done.
     Ideally, what we should implement is a way for Python to inform
   the C++ data-structure. No real problem here, but time...
This commit is contained in:
Jean-Paul Chaput 2021-05-11 14:11:43 +02:00
parent 972787c81e
commit 28c8af27be
3 changed files with 8 additions and 4 deletions

View File

@ -580,7 +580,6 @@ class Block ( object ):
self.etesian.getCell().flattenNets( None, Cell.Flags_NoClockFlatten )
if self.conf.useHFNS: self.etesian.doHFNS()
self.etesian.place()
self.etesian.flattenPower()
Breakpoint.stop( 100, 'Placement done.' )
self.etesian.clearColoquinte()
@ -744,8 +743,10 @@ class Block ( object ):
#if self.conf.useHFNS: self.findHfnTrees()
break
if self.conf.useClockTree: self.splitClocks()
if self.conf.isCoreBlock: self.doConnectCore()
self.spares.removeUnusedBuffers()
self.etesian.toHurricane()
self.etesian.flattenPower()
if self.conf.isCoreBlock: self.doConnectCore()
status = self.route()
if not self.conf.isCoreBlock:
self.addBlockages()

View File

@ -774,7 +774,9 @@ class QuadTree ( object ):
netBuff = self.bOutputPlug.getNet()
trace( 540, '\tBuffer: {}\n'.format(self.buffer) )
trace( 540, '\tBuffer output: {}\n'.format(netBuff) )
if not self.plugs: return
if not self.plugs:
trace( 540, '-' )
return
for plug in self.plugs:
trace( 540, '\t| Leaf: {}\n'.format(plug) )
trace( 540, '\t| netBuff: {}\n'.format(netBuff) )

View File

@ -87,10 +87,11 @@ def scriptMain ( **kw ):
if editor: editor.refresh()
etesian = Etesian.EtesianEngine.create( cell )
etesian.place()
etesian.destroy()
ht.connectLeaf()
#ht.prune()
ht.route()
etesian.toHurricane()
etesian.destroy()
ht.save( cell )
except Exception, e:
helpers.io.catch( e )