2 # -*- coding: utf-8 -*-
3 from __future__
import print_function
9 from Hurricane
import Box
10 from Hurricane
import Transformation
11 from Hurricane
import Breakpoint
12 from Hurricane
import Instance
13 from coriolis2
.settings
import af
14 from utils
import Module
, SessionManager
, Config
16 import symbolic
.cmos
# do not remove
22 with
Config(Cfg
.Parameter
.Priority
.UserFile
) as cfg
:
23 cfg
.misc_catchCore
= False
25 cfg
.misc_paranoid
= False
27 cfg
.misc_logMode
= True
28 cfg
.misc_verboseLevel1
= True
29 cfg
.misc_verboseLevel2
= True
30 cfg
.etesian_effort
= 2
31 cfg
.etesian_spaceMargin
= "5.0%"
32 cfg
.etesian_aspectRatio
= "100.0%"
33 cfg
.etesian_uniformDensity
= True
34 cfg
.anabatic_edgeLenght
= 24
35 cfg
.anabatic_edgeWidth
= 8
36 cfg
.anabatic_topRoutingLayer
= 'METAL5'
37 cfg
.katana_searchHalo
= 30
38 cfg
.katana_eventsLimit
= 1000000
39 cfg
.katana_hTracksReservedLocal
= 7
40 cfg
.katana_vTracksReservedLocal
= 6
42 env
= af
.getEnvironment()
43 env
.setCLOCK('^clk$|m_clock')
59 self
.name
= self
.name
+ '_r'
60 self
.af
.saveCell(self
.cell
, CRL
.Catalog
.State
.Views
)
61 super(ALU16
, self
).save()
68 if not self
.build_submodules():
71 # at this point we have the (auto-calculated) submodules' dimensions
72 # in their `ab` properties.
74 add
, sub
= self
.submodules
76 with
SessionManager():
77 # TODO: replace with some form of lazy evaluation?
78 y_north
= self
.from_dbu(self
.ab
.getYMax())
79 for pin_conf
in self
.north_pins
:
80 pin_conf
['y'] = y_north
85 self
.editor
.setCell(self
.cell
)
87 self
.place() # place only
88 Breakpoint
.stop(1, 'After ALU16 placement.')
95 def scriptMain(editor
=None, **kwargs
):
101 'b({})'.format(BIT_WIDTH
-1): (
102 'BLOCKAGE2', 'BLOCKAGE3', 'BLOCKAGE4',
105 orientation
=Transformation
.Orientation
.ID
,
110 'b({})'.format(BIT_WIDTH
-1): (
111 'BLOCKAGE2', 'BLOCKAGE3', 'BLOCKAGE4',
114 orientation
=Transformation
.Orientation
.ID
,
118 'alu16', editor
, submodules
=[add
, sub
],
120 {'net': 'o({})', 'x': 365.0, 'delta': -5.0, 'repeat': BIT_WIDTH
},
124 {'net': 'a({})', 'x': 205.0, 'delta': 5.0, 'repeat': BIT_WIDTH
},
125 {'net': 'b({})', 'x': 295.0, 'delta': 5.0, 'repeat': BIT_WIDTH
},
128 {'net': 'rst', 'y': 10.0, 'layer': 'METAL2'},
131 alu16
.set_ab( 600, 650 )
135 if __name__
== '__main__':
137 success
= scriptMain(**kwargs
)
142 sys
.exit(shellSuccess
)