Management of SRAMs block at Coriolis devel.
[soclayout.git] / experiments9 / tsmc_c018 / coriolis2 / settings.py
1 # -*- Mode:Python -*-
2
3 from __future__ import print_function
4 import os
5 import socket
6 import helpers
7
8 NdaDirectory = None
9 if os.environ.has_key('NDA_TOP'):
10 NdaDirectory = os.environ['NDA_TOP']
11 if not NdaDirectory:
12 hostname = socket.gethostname()
13 if hostname.startswith('lepka'):
14 NdaDirectory = '/dsk/l1/jpc/crypted/soc/techno'
15 if not os.path.isdir(NdaDirectory):
16 print( '[ERROR] You forgot to mount the NDA encrypted directory, stupid!' )
17 else:
18 NdaDirectory = '/users/soft/techno/techno'
19 helpers.setNdaTopDir( NdaDirectory )
20
21 import Cfg
22 from Hurricane import DataBase, Cell, Instance, Net
23 from CRL import AllianceFramework
24 from helpers import overlay, l, u, n
25 from NDA.node180.tsmc_c018 import techno, FlexLib, LibreSOCIO, LibreSOCMem, pll
26
27 techno.setup()
28 FlexLib.setup()
29 LibreSOCIO.setup()
30 LibreSOCMem.setup()
31 pll.setup()
32
33
34 db = DataBase.getDB()
35 af = AllianceFramework.get()
36
37
38 def createSramBlackbox ():
39 global db, af
40 print( ' o Creating SRAM blackboxes for "ls180" design.' )
41 rootlib = db.getRootLibrary()
42 lib = rootlib.getLibrary( 'LibreSOCMem' )
43 sramName = 'spblock_512w64b8w'
44 sram = lib.getCell( sramName )
45 if not sram:
46 raise ErrorMessage( 1, 'settings.createSramBlocks(): SRAM Cell "{}" not found.' \
47 .format(sramName) )
48 sram.setAbstractedSupply( True )
49 blackboxeNames = [ 'spblock512w64b8w_0'
50 , 'spblock512w64b8w_1'
51 , 'spblock512w64b8w_2'
52 , 'spblock512w64b8w_3'
53 ]
54 for blackboxName in blackboxeNames:
55 cell = Cell.create( lib, blackboxName )
56 instance = Instance.create( cell, 'real_sram', sram )
57 state = af.getCatalog().getState( blackboxName, True )
58 state.setCell( cell )
59 state.setLogical( True )
60 state.setInMemory( True )
61 print( ' - {}.'.format(cell) )
62 for masterNet in sram.getNets():
63 if not masterNet.isExternal():
64 continue
65 net = Net.create( cell, masterNet.getName() )
66 net.setDirection( masterNet.getDirection() )
67 net.setType( masterNet.getType() )
68 net.setExternal( True )
69 net.setGlobal( masterNet.isGlobal() )
70 if masterNet.isSupply():
71 continue
72 plug = instance.getPlug( masterNet )
73 plug.setNet( net )
74
75
76 with overlay.CfgCache(priority=Cfg.Parameter.Priority.UserFile) as cfg:
77 cfg.misc.catchCore = False
78 cfg.misc.minTraceLevel = 12300
79 cfg.misc.maxTraceLevel = 12400
80 cfg.misc.info = False
81 cfg.misc.paranoid = False
82 cfg.misc.bug = False
83 cfg.misc.logMode = True
84 cfg.misc.verboseLevel1 = True
85 cfg.misc.verboseLevel2 = True
86 cfg.etesian.graphics = 3
87 cfg.etesian.spaceMargin = 0.10
88 cfg.katana.eventsLimit = 4000000
89 env = af.getEnvironment()
90 env.setCLOCK( '^sys_clk$|^ck|^jtag_tck$' )
91
92 with overlay.UpdateSession():
93 createSramBlackbox()