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
19 widths
= {16 : 465.0, 32: 800.0}
20 offsets
= {16 : 0.0, 32: 200.0}
23 with
Config(Cfg
.Parameter
.Priority
.UserFile
) as cfg
:
24 cfg
.misc_catchCore
= False
26 cfg
.misc_paranoid
= False
28 cfg
.misc_logMode
= True
29 cfg
.misc_verboseLevel1
= True
30 cfg
.misc_verboseLevel2
= True
31 cfg
.etesian_effort
= 2
32 cfg
.etesian_spaceMargin
= "5.0%"
33 cfg
.etesian_aspectRatio
= "100.0%"
34 cfg
.etesian_uniformDensity
= True
35 cfg
.anabatic_edgeLenght
= 24
36 cfg
.anabatic_edgeWidth
= 8
37 cfg
.anabatic_topRoutingLayer
= 'METAL5'
38 cfg
.katana_searchHalo
= 30
39 cfg
.katana_eventsLimit
= 1000000
40 cfg
.katana_hTracksReservedLocal
= 7
41 cfg
.katana_vTracksReservedLocal
= 6
43 env
= af
.getEnvironment()
44 env
.setCLOCK('^clk$|m_clock')
60 self
.name
= self
.name
+ '_r'
61 self
.af
.saveCell(self
.cell
, CRL
.Catalog
.State
.Views
)
62 super(ALU16
, self
).save()
69 if not self
.build_submodules():
72 # at this point we have the (auto-calculated) submodules' dimensions
73 # in their `ab` properties.
75 add
, sub
= self
.submodules
77 with
SessionManager():
78 # TODO: replace with some form of lazy evaluation?
79 y_north
= self
.from_dbu(self
.ab
.getYMax())
80 for pin_conf
in self
.north_pins
:
81 pin_conf
['y'] = y_north
86 self
.editor
.setCell(self
.cell
)
88 self
.place() # place only
89 Breakpoint
.stop(1, 'After ALU16 placement.')
96 def scriptMain(editor
=None, **kwargs
):
102 'b({})'.format(BIT_WIDTH
-1): (
103 'BLOCKAGE2', 'BLOCKAGE3', 'BLOCKAGE4',
106 orientation
=Transformation
.Orientation
.ID
,
111 'b({})'.format(BIT_WIDTH
-1): (
112 'BLOCKAGE2', 'BLOCKAGE3', 'BLOCKAGE4',
115 orientation
=Transformation
.Orientation
.ID
,
118 o
= offsets
[BIT_WIDTH
]
120 'alu16', editor
, submodules
=[add
, sub
],
122 {'net': 'o({})', 'x': o
+365.0, 'delta': -5.0, 'repeat': BIT_WIDTH
},
126 {'net': 'a({})', 'x': o
+205.0, 'delta': 5.0, 'repeat': BIT_WIDTH
},
127 {'net': 'b({})', 'x': o
+295.0, 'delta': 5.0, 'repeat': BIT_WIDTH
},
130 {'net': 'rst', 'y': 10.0, 'layer': 'METAL2'},
133 alu16
.set_ab( widths
[BIT_WIDTH
], BIT_WIDTH
* 50.0 )
137 if __name__
== '__main__':
139 success
= scriptMain(**kwargs
)
144 sys
.exit(shellSuccess
)