From 1253eeeef4f2782f5e933d5946c7a91136ff8575 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 30 Oct 2022 10:36:52 +0100 Subject: [PATCH] Allow the user to choose the name of the SRAM. Placement fix. * Change: In cumulus/plugins.sram.sram_256x32, add a new parameter to __init__() so the user can choose the model name of the generated SRAM. * Change: In cumulus/plugins.sram.sram.BaseSRAM.placeInstance(), placement status must be FIXED instead of PLACED so the placer do not "unplace" them. The Cell.updatePlacedFlag() method must also be called once the model if fully built. --- cumulus/src/plugins/sram/sram.py | 2 +- cumulus/src/plugins/sram/sram_256x32.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cumulus/src/plugins/sram/sram.py b/cumulus/src/plugins/sram/sram.py index 73f282bb..0e944a78 100644 --- a/cumulus/src/plugins/sram/sram.py +++ b/cumulus/src/plugins/sram/sram.py @@ -795,7 +795,7 @@ class BaseSRAM ( object ): transf = Transformation( x, y, orient ) self.position.applyOn( transf ) inst.setTransformation( transf ) - inst.setPlacementStatus( Instance.PlacementStatus.PLACED ) + inst.setPlacementStatus( Instance.PlacementStatus.FIXED ) return inst.getAbutmentBox() def findFoldColumns ( self ): diff --git a/cumulus/src/plugins/sram/sram_256x32.py b/cumulus/src/plugins/sram/sram_256x32.py index 930d3bc9..d0bea744 100644 --- a/cumulus/src/plugins/sram/sram_256x32.py +++ b/cumulus/src/plugins/sram/sram_256x32.py @@ -207,7 +207,7 @@ class SRAM_256x32 ( BaseSRAM ): BIT_GROUP_FMT = 'bit_addr{:04d}_g' MUX_GROUP_FMT = 'bits_{}_g' - def __init__ ( self, fold ): + def __init__ ( self, fold, name=None ): BaseSRAM.__init__( self, fold ) if fold == 1: pass @@ -219,7 +219,9 @@ class SRAM_256x32 ( BaseSRAM ): self.foldTags = [ 'imux_addr0096', 'imux_addr0192', 'imux_addr0160' ] else: raise ErrorMessage( 1, 'SRAM_256x32.__init__(): Unsupported fold {}, valid values are 1, 2, 4.'.format( fold )) - self.cell = af.createCell( 'spram_256x32' ) + if not name: + name = 'spram_256x32' + self.cell = af.createCell( name ) self.mx2Cell = self.confLib.getStdCell( 'mx2_x2' ) self.mx3Cell = self.confLib.getStdCell( 'mx3_x2' ) self.na2Cell = self.confLib.getStdCell( 'na2_x1' ) @@ -296,6 +298,7 @@ class SRAM_256x32 ( BaseSRAM ): rstCol.setBusNet( 'nq', busDato ) omuxRoot.parent.group( rstCol, after=omuxRoot ) af.saveCell( self.cell, CRL.Catalog.State.Logical ) + self.cell.updatePlacedFlag() def _buildOutputMux_nao23 ( self ): """