2dc3588b45227d8a88ebacadbc444dfe29eb7360
4 from Hurricane
import DataBase
, Cell
, Instance
, Net
5 from CRL
import AllianceFramework
, RoutingLayerGauge
8 from helpers
.overlay
import CfgCache
9 from helpers
import overlay
, l
, u
, n
10 import symbolic
.cmos45
# do not remove
13 import LibreSOCMem
, pll
17 if os
.environ
.has_key('CELLS_TOP'):
18 cellsTop
= os
.environ
['CELLS_TOP']
20 cellsTop
= '../../../alliance-check-toolkit/cells'
23 af
= AllianceFramework
.get()
26 def createPLLBlackbox ():
28 print( ' o Creating PLL blackboxes for "ls180" design.' )
29 rootlib
= db
.getRootLibrary()
30 lib
= rootlib
.getLibrary( 'pll' )
32 pll
= lib
.getCell( pllName
)
34 raise ErrorMessage( 1, 'settings.createPLLBlackBox(): '
35 'PLL Cell "{}" not found.' \
37 pll
.setAbstractedSupply( True )
38 blackboxName
= 'real_pll'
39 cell
= Cell
.create( lib
, blackboxName
)
40 instance
= Instance
.create( cell
, 'real_pll', pll
)
41 state
= af
.getCatalog().getState( blackboxName
, True )
43 state
.setLogical( True )
44 state
.setInMemory( True )
45 print( ' - {}.'.format(cell
) )
46 for masterNet
in pll
.getNets():
47 if not masterNet
.isExternal():
49 net
= Net
.create( cell
, masterNet
.getName() )
50 net
.setDirection( masterNet
.getDirection() )
51 net
.setType( masterNet
.getType() )
52 net
.setExternal( True )
53 net
.setGlobal( masterNet
.isGlobal() )
54 if masterNet
.isSupply():
56 plug
= instance
.getPlug( masterNet
)
59 def createSramBlackbox ():
61 print( ' o Creating SRAM blackboxes for "ls180" design.' )
62 rootlib
= db
.getRootLibrary()
63 lib
= rootlib
.getLibrary( 'LibreSOCMem' )
64 sramName
= 'spblock_512w64b8w'
65 sram
= lib
.getCell( sramName
)
67 raise ErrorMessage( 1, 'settings.createSramBlocks(): '
68 'SRAM Cell "{}" not found.' \
70 sram
.setAbstractedSupply( True )
71 blackboxeNames
= [ 'spblock_512w64b8w_0',
72 'spblock_512w64b8w_1',
73 'spblock_512w64b8w_2',
74 'spblock_512w64b8w_3',
76 for blackboxName
in blackboxeNames
:
77 cell
= Cell
.create( lib
, blackboxName
)
78 instance
= Instance
.create( cell
, 'real_sram', sram
)
79 state
= af
.getCatalog().getState( blackboxName
, True )
81 state
.setLogical( True )
82 state
.setInMemory( True )
83 print( ' - {}.'.format(cell
) )
84 for masterNet
in sram
.getNets():
85 if not masterNet
.isExternal():
87 net
= Net
.create( cell
, masterNet
.getName() )
88 net
.setDirection( masterNet
.getDirection() )
89 net
.setType( masterNet
.getType() )
90 net
.setExternal( True )
91 net
.setGlobal( masterNet
.isGlobal() )
92 if masterNet
.isSupply():
94 plug
= instance
.getPlug( masterNet
)
98 with
CfgCache('', priority
=Cfg
.Parameter
.Priority
.UserFile
) as cfg
:
99 cfg
.misc
.catchCore
= False
100 cfg
.misc
.info
= False
101 cfg
.misc
.paranoid
= False
103 cfg
.misc
.logMode
= True
104 cfg
.misc
.verboseLevel1
= True
105 cfg
.misc
.verboseLevel2
= True
106 cfg
.anabatic
.edgeLenght
= 24
107 cfg
.anabatic
.edgeWidth
= 8
108 cfg
.anabatic
.topRoutingLayer
= 'METAL5'
109 cfg
.etesian
.graphics
= 3
111 #cfg.katana.searchHalo = 30
112 #cfg.katana.eventsLimit = 1000000
113 #cfg.katana.hTracksReservedLocal = 7
115 # Run 2 (make-cgt-2.log)
116 #cfg.etesian.effort = 2
117 #cfg.etesian.uniformDensity = True
118 #cfg.etesian.spaceMargin = 0.05
119 #cfg.etesian.aspectRatio = 1.0
120 #cfg.katana.vTracksReservedLocal = 4
121 #cfg.katana.hTracksReservedLocal = 4
123 # Run 3 (make-cgt-3.log)
124 #cfg.etesian.effort = 2
125 #cfg.etesian.uniformDensity = False
126 #cfg.etesian.spaceMargin = 0.05
127 #cfg.etesian.aspectRatio = 1.0
128 #cfg.katana.vTracksReservedLocal = 5
129 #cfg.katana.hTracksReservedLocal = 5
131 # Run 4 (make-cgt-4.log)
132 #cfg.etesian.effort = 2
133 #cfg.etesian.uniformDensity = True
134 #cfg.etesian.spaceMargin = 0.05
135 #cfg.etesian.aspectRatio = 1.0
137 # Run 5 (make-cgt-5.log)
138 cfg
.etesian
.effort
= 2
139 cfg
.etesian
.uniformDensity
= True
140 cfg
.etesian
.spaceMargin
= 0.05
141 cfg
.etesian
.aspectRatio
= 1.0
142 cfg
.katana
.useGlobalEstimate
= False
143 cfg
.katana
.vTracksReservedLocal
= 7
144 cfg
.katana
.hTracksReservedLocal
= 6
145 cfg
.katana
.bloatOverloadAdd
= 4
146 cfg
.conductor
.stopLevel
= 0
147 cfg
.conductor
.maxPlaceIterations
= 2
148 cfg
.conductor
.useFixedAbHeight
= False
150 env
= CRL
.AllianceFramework
.get().getEnvironment()
151 env
.setCLOCK( '^sys_clk$|^ck|^jtag_tck$' )
152 env
.addSYSTEM_LIBRARY(library
=cellsTop
+'/niolib',
153 mode
=CRL
.Environment
.Prepend
)
154 env
.addSYSTEM_LIBRARY(library
=cellsTop
+'/nsxlib',
155 mode
=CRL
.Environment
.Prepend
)
159 Viewer
.Graphics
.setStyle('Alliance.Classic [black]')
161 # XXX cannot run this in non-NDA'd mode because there is no
162 # equivalent to NDA.node180.tsmc_c018.LibreSOCMem (or PLL)
163 # TODO: create a fake one
164 with overlay
.UpdateSession():
168 print( ' o Successfully run "<>/coriolis2/settings.py".' )
169 print( ' - CELLS_TOP = "{}"'.format(cellsTop
) )