Fix memory corruption after placement occurring on LibreSOC/ls180.

* Bug: In Cumulus/plugins.block.Block, re-order Etesian tool creation
    and virtual net flattening. Must investigate later why it is so
    sensitive to at least warn/stop cleanly.
This commit is contained in:
Jean-Paul Chaput 2021-06-03 01:20:24 +02:00
parent d2a621629a
commit 1d7a415e9f
1 changed files with 9 additions and 5 deletions

View File

@ -312,6 +312,7 @@ class Block ( object ):
, IoPin.SOUTH : Side( self.conf, IoPin.SOUTH ) , IoPin.SOUTH : Side( self.conf, IoPin.SOUTH )
, IoPin.NORTH : Side( self.conf, IoPin.NORTH ) , IoPin.NORTH : Side( self.conf, IoPin.NORTH )
} }
self.etesian = None
if not self.conf.cell.getAbutmentBox().isEmpty(): if not self.conf.cell.getAbutmentBox().isEmpty():
isBuilt = True isBuilt = True
for instance in self.conf.cell.getInstances(): for instance in self.conf.cell.getInstances():
@ -467,7 +468,7 @@ class Block ( object ):
def flattenNets ( self ): def flattenNets ( self ):
if self.flags & Block.FLATTENED: return if self.flags & Block.FLATTENED: return
if self.conf.isCoreBlock: if self.conf.isCoreBlock:
self.conf.corona.flattenNets( self.conf.icore, self.conf.hTreeNames, Cell.Flags_NoClockFlatten ) self.conf.corona.flattenNets( None, self.excludedNets, Cell.Flags_NoClockFlatten )
else: else:
self.conf.cell.flattenNets( None, self.excludedNets, Cell.Flags_NoClockFlatten ) self.conf.cell.flattenNets( None, self.excludedNets, Cell.Flags_NoClockFlatten )
self.flags |= Block.FLATTENED self.flags |= Block.FLATTENED
@ -633,6 +634,8 @@ class Block ( object ):
def initEtesian ( self ): def initEtesian ( self ):
editor = self.conf.editor editor = self.conf.editor
if self.etesian:
return
if self.conf.isCoreBlock: if self.conf.isCoreBlock:
self.etesian = Etesian.EtesianEngine.create( self.conf.corona ) self.etesian = Etesian.EtesianEngine.create( self.conf.corona )
self.etesian.setBlock( self.conf.icore ) self.etesian.setBlock( self.conf.icore )
@ -641,9 +644,10 @@ class Block ( object ):
Breakpoint.stop( 100, 'Block.place(), corona loaded.') Breakpoint.stop( 100, 'Block.place(), corona loaded.')
else: else:
self.etesian = Etesian.EtesianEngine.create( self.conf.cell ) self.etesian = Etesian.EtesianEngine.create( self.conf.cell )
self.etesian.getCell().flattenNets( None, self.excludedNets, Cell.Flags_NoClockFlatten ) self.flattenNets()
def place ( self ): def place ( self ):
self.initEtesian()
if self.conf.placeArea: if self.conf.placeArea:
self.etesian.setPlaceArea( self.conf.placeArea ) self.etesian.setPlaceArea( self.conf.placeArea )
if self.conf.useHFNS: self.etesian.doHFNS() if self.conf.useHFNS: self.etesian.doHFNS()
@ -793,7 +797,6 @@ class Block ( object ):
blockInstance.block.build() blockInstance.block.build()
if editor: editor.setCell( self.conf.cellPnR ) if editor: editor.setCell( self.conf.cellPnR )
self.conf.cfg.apply() self.conf.cfg.apply()
self.initEtesian()
iteration = -1 iteration = -1
while True: while True:
iteration += 1 iteration += 1
@ -803,9 +806,10 @@ class Block ( object ):
self.placeIoPins() self.placeIoPins()
self.checkIoPins() self.checkIoPins()
self.spares.build() self.spares.build()
#if self.conf.useHFNS: self.findHfnTrees4() #if self.conf.useHFNS: self.findHfnTrees4()
self.initEtesian()
self.addHTrees() self.addHTrees()
#if self.conf.useHFNS: self.addHfnBuffers() #if self.conf.useHFNS: self.addHfnBuffers()
if editor: editor.fit() if editor: editor.fit()
#Breakpoint.stop( 0, 'Clock tree(s) done.' ) #Breakpoint.stop( 0, 'Clock tree(s) done.' )
self.place() self.place()