From: Luke Kenneth Casson Leighton Date: Wed, 28 Apr 2021 17:29:01 +0000 (+0000) Subject: create function which pre-creates the blackbox cells X-Git-Tag: LS180_RC3~74 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fa12e1d031a479ab0ece34163b8207c131613b57;p=soclayout.git create function which pre-creates the blackbox cells use it to create createPLLBlackbox, not called yet --- diff --git a/experiments9/tsmc_c018/coriolis2/settings.py b/experiments9/tsmc_c018/coriolis2/settings.py index 80211c3..70993c7 100644 --- a/experiments9/tsmc_c018/coriolis2/settings.py +++ b/experiments9/tsmc_c018/coriolis2/settings.py @@ -13,7 +13,8 @@ if not NdaDirectory: if hostname.startswith('lepka'): NdaDirectory = '/dsk/l1/jpc/crypted/soc/techno' if not os.path.isdir(NdaDirectory): - print( '[ERROR] You forgot to mount the NDA encrypted directory, stupid!' ) + print( '[ERROR] You forgot to mount the NDA ' + 'encrypted directory, stupid!' ) else: NdaDirectory = '/users/soft/techno/techno' helpers.setNdaTopDir( NdaDirectory ) @@ -22,7 +23,8 @@ import Cfg from Hurricane import DataBase, Cell, Instance, Net from CRL import AllianceFramework from helpers import overlay, l, u, n -from NDA.node180.tsmc_c018 import techno, FlexLib, LibreSOCIO, LibreSOCMem, pll +from NDA.node180.tsmc_c018 import (techno, FlexLib, + LibreSOCIO, LibreSOCMem, pll) techno.setup() FlexLib.setup() @@ -35,28 +37,26 @@ db = DataBase.getDB() af = AllianceFramework.get() -def createSramBlackbox (): +def createBlackbox (name, libname, cellName, blackboxNames, real_name): global db, af - print( ' o Creating SRAM blackboxes for "ls180" design.' ) + print( ' o Creating %s blackboxes for "ls180" design.' % name) 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 = [ 'spblock_512w64b8w' # go back to only one blackbox - ] - for blackboxName in blackboxeNames: + lib = rootlib.getLibrary( libname ) + libcell = lib.getCell( cellName ) + if not libcell: + raise ErrorMessage( 1, 'settings.createSramBlocks(): ' + '%s SRAM Cell "%s" not found.' % \ + (name, cellName) ) + libcell.setAbstractedSupply( True ) + for blackboxName in blackboxNames: cell = Cell.create( lib, blackboxName ) - instance = Instance.create( cell, 'real_sram', sram ) + instance = Instance.create( cell, real_name, libcell ) state = af.getCatalog().getState( blackboxName, True ) state.setCell( cell ) state.setLogical( True ) state.setInMemory( True ) print( ' - {}.'.format(cell) ) - for masterNet in sram.getNets(): + for masterNet in libcell.getNets(): if not masterNet.isExternal(): continue net = Net.create( cell, masterNet.getName() ) @@ -70,6 +70,26 @@ def createSramBlackbox (): plug.setNet( net ) +#TODO, JP, check this, it's cut/paste and guessing +def createPLLBlackbox (): + createBlackbox(name='PLL', + libname='pll', + cellName='pll', + blackboxeNames = [ 'pll' + ], + real_name='real_pll') # probably + + +def createSramBlackbox (): + createBlackbox(name='SRAM', + libname='LibreSOCMem', + cellName='spblock_512w64b8w', + # go back to only one blackbox + blackboxeNames = [ 'spblock_512w64b8w' + ], + real_name='real_sram') + + with overlay.CfgCache(priority=Cfg.Parameter.Priority.UserFile) as cfg: cfg.misc.catchCore = False cfg.misc.minTraceLevel = 12300 @@ -88,3 +108,4 @@ with overlay.CfgCache(priority=Cfg.Parameter.Priority.UserFile) as cfg: with overlay.UpdateSession(): createSramBlackbox() + # createPLLBlackbox ()