also add createSRAMblocks to freepdk_c4m45
[soclayout.git] / experiments9 / freepdk_c4m45 / 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 '
17 'encrypted directory, stupid!')
18 else:
19 NdaDirectory = '/users/soft/techno/techno'
20 helpers.setNdaTopDir( NdaDirectory )
21
22 import Cfg
23 from Hurricane import DataBase, Cell, Instance, Net
24 from CRL import AllianceFramework, RoutingLayerGauge
25 from helpers import overlay, l, u, n
26 from helpers import overlay, l, u, n
27 from NDA.node45.freepdk45_c4m import techno, FlexLib, LibreSOCIO
28
29 techno.setup()
30 FlexLib.setup()
31 LibreSOCIO.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(): '
47 'SRAM Cell "{}" not found.' \
48 .format(sramName) )
49 sram.setAbstractedSupply( True )
50 blackboxeNames = [ 'spblock512w64b8w_0'
51 , 'spblock512w64b8w_1'
52 , 'spblock512w64b8w_2'
53 , 'spblock512w64b8w_3'
54 ]
55 for blackboxName in blackboxeNames:
56 cell = Cell.create( lib, blackboxName )
57 instance = Instance.create( cell, 'real_sram', sram )
58 state = af.getCatalog().getState( blackboxName, True )
59 state.setCell( cell )
60 state.setLogical( True )
61 state.setInMemory( True )
62 print( ' - {}.'.format(cell) )
63 for masterNet in sram.getNets():
64 if not masterNet.isExternal():
65 continue
66 net = Net.create( cell, masterNet.getName() )
67 net.setDirection( masterNet.getDirection() )
68 net.setType( masterNet.getType() )
69 net.setExternal( True )
70 net.setGlobal( masterNet.isGlobal() )
71 if masterNet.isSupply():
72 continue
73 plug = instance.getPlug( masterNet )
74 plug.setNet( net )
75
76
77 with overlay.CfgCache(priority=Cfg.Parameter.Priority.UserFile) as cfg:
78 cfg.misc.catchCore = False
79 cfg.misc.minTraceLevel = 12300
80 cfg.misc.maxTraceLevel = 12400
81 cfg.misc.info = False
82 cfg.misc.paranoid = False
83 cfg.misc.bug = False
84 cfg.misc.logMode = True
85 cfg.misc.verboseLevel1 = True
86 cfg.misc.verboseLevel2 = True
87 cfg.etesian.graphics = 3
88 cfg.etesian.spaceMargin = 0.10
89 cfg.anabatic.topRoutingLayer = 'metal6'
90 cfg.katana.eventsLimit = 4000000
91 af = AllianceFramework.get()
92 lg5 = af.getRoutingGauge('FlexLib').getLayerGauge( 5 )
93 lg5.setType( RoutingLayerGauge.PowerSupply )
94 env = af.getEnvironment()
95 env.setCLOCK( '^sys_clk$|^ck|^jtag_tck$' )
96
97 with overlay.UpdateSession():
98 createSramBlackbox()