22e72f516db1a50f498b436d69413dd8c2dc7f67
[soclayout.git] / experiments10_verilog / coriolis2 / settings.py
1 # -*- Mode:Python -*-
2
3 from __future__ import print_function
4 import os
5 import Viewer
6 #import node180.scn6m_deep_09
7 from helpers import overlay, l, u, n
8
9 import os
10 import socket
11 import helpers
12
13 import Cfg
14 from Hurricane import DataBase, Cell, Instance, Net
15 from CRL import AllianceFramework, RoutingLayerGauge
16 import CRL
17 import Viewer
18 from helpers.overlay import CfgCache
19 import symbolic.cmos45 # do not remove
20
21 NdaDirectory = None
22 if os.environ.has_key('NDA_TOP'):
23 NdaDirectory = os.environ['NDA_TOP']
24 if not NdaDirectory:
25 hostname = socket.gethostname()
26 if hostname.startswith('lepka'):
27 NdaDirectory = '/dsk/l1/jpc/crypted/soc/techno'
28 if not os.path.isdir(NdaDirectory):
29 print ('[ERROR] You forgot to mount the NDA encrypted directory, stupid!')
30 else:
31 NdaDirectory = '/users/soft/techno/techno'
32 helpers.setNdaTopDir( NdaDirectory )
33
34 # select one or other of these
35 if False:
36 from NDA.node45.freepdk45_c4m import techno, FlexLib, LibreSOCIO
37 techno.setup()
38 FlexLib.setup()
39 LibreSOCIO.setup()
40 else:
41 import symbolic.cmos45
42 import pll # fake pll
43 pll.setup()
44
45
46 if os.environ.has_key('CELLS_TOP'):
47 cellsTop = os.environ['CELLS_TOP']
48 else:
49 cellsTop = '../../../alliance-check-toolkit/cells'
50
51 db = DataBase.getDB()
52 af = AllianceFramework.get()
53
54
55 def createPLLBlackbox ():
56 global db, af
57 print( ' o Creating PLL blackboxes for "ls180" design.' )
58 rootlib = db.getRootLibrary()
59 lib = rootlib.getLibrary( 'pll' )
60 pllName = 'pll'
61 pll = lib.getCell( pllName )
62 if not pll:
63 raise ErrorMessage( 1, 'settings.createPLLBlackBox(): '
64 'PLL Cell "{}" not found.' \
65 .format(pllName) )
66 pll.setAbstractedSupply( True )
67 blackboxName = 'real_pll'
68 cell = Cell.create( lib, blackboxName )
69 instance = Instance.create( cell, 'real_pll', pll )
70 state = af.getCatalog().getState( blackboxName, True )
71 state.setCell( cell )
72 state.setLogical( True )
73 state.setInMemory( True )
74 print( ' - {}.'.format(cell) )
75 for masterNet in pll.getNets():
76 if not masterNet.isExternal():
77 continue
78 net = Net.create( cell, masterNet.getName() )
79 net.setDirection( masterNet.getDirection() )
80 net.setType( masterNet.getType() )
81 net.setExternal( True )
82 net.setGlobal( masterNet.isGlobal() )
83 if masterNet.isSupply():
84 continue
85 plug = instance.getPlug( masterNet )
86 plug.setNet( net )
87
88
89 with overlay.CfgCache(priority=Cfg.Parameter.Priority.UserFile) as cfg:
90 cfg.misc.catchCore = False
91 cfg.misc.info = False
92 cfg.misc.paranoid = False
93 cfg.misc.bug = False
94 cfg.misc.logMode = True
95 cfg.misc.verboseLevel1 = True
96 cfg.misc.verboseLevel2 = True
97 cfg.etesian.graphics = 3
98 cfg.etesian.spaceMargin = 0.05
99 cfg.etesian.aspectRatio = 1.0
100 cfg.anabatic.edgeLenght = 24
101 cfg.anabatic.edgeWidth = 8
102 cfg.anabatic.topRoutingLayer = 'METAL5'
103 cfg.katana.eventsLimit = 4000000
104 cfg.etesian.effort = 2
105 cfg.etesian.uniformDensity = True
106 cfg.katana.hTracksReservedLocal = 7
107 cfg.katana.vTracksReservedLocal = 6
108 Viewer.Graphics.setStyle( 'Alliance.Classic [black]' )
109 af = CRL.AllianceFramework.get()
110 env = af.getEnvironment()
111 env.setCLOCK( '^sys_clk$|^ck|^jtag_tck$' )
112 env.setPOWER( 'vdd' )
113 env.setGROUND( 'vss' )
114 env.addSYSTEM_LIBRARY( library=cellsTop+'/niolib',
115 mode=CRL.Environment.Prepend )
116 env.addSYSTEM_LIBRARY( library=cellsTop+'/nsxlib',
117 mode=CRL.Environment.Prepend )
118
119 # runs the "fake" pll blackbox create
120 with overlay.UpdateSession():
121 createPLLBlackbox()
122
123 print( ' o Successfully run "<>/coriolis2/settings.py".' )
124 print( ' - CELLS_TOP = "{}"'.format(cellsTop) )
125