+
+db = DataBase.getDB()
+af = AllianceFramework.get()
+
+
+def createSramBlackbox ():
+ global db, af
+ print( ' o Creating SRAM blackboxes for "ls180" design.' )
+ rootlib = db.getRootLibrary()
+ lib = rootlib.getLibrary( 'LibreSOCMem' )
+ sramName = 'spblock_512w64b8w'
+ sram = lib.getCell( sramName )
+ if not sram:
+ raise ErrorMessage( 1, 'settings.createSramBlocks(): '
+ 'SRAM Cell "{}" not found.' \
+ .format(sramName) )
+ sram.setAbstractedSupply( True )
+ blackboxeNames = [ 'spblock512w64b8w_0'
+ , 'spblock512w64b8w_1'
+ , 'spblock512w64b8w_2'
+ , 'spblock512w64b8w_3'
+ ]
+ for blackboxName in blackboxeNames:
+ cell = Cell.create( lib, blackboxName )
+ instance = Instance.create( cell, 'real_sram', sram )
+ state = af.getCatalog().getState( blackboxName, True )
+ state.setCell( cell )
+ state.setLogical( True )
+ state.setInMemory( True )
+ print( ' - {}.'.format(cell) )
+ for masterNet in sram.getNets():
+ if not masterNet.isExternal():
+ continue
+ net = Net.create( cell, masterNet.getName() )
+ net.setDirection( masterNet.getDirection() )
+ net.setType( masterNet.getType() )
+ net.setExternal( True )
+ net.setGlobal( masterNet.isGlobal() )
+ if masterNet.isSupply():
+ continue
+ plug = instance.getPlug( masterNet )
+ plug.setNet( net )
+
+