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 )
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()
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() )
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
with overlay.UpdateSession():
createSramBlackbox()
+ # createPLLBlackbox ()