2 # -*- coding: utf-8 -*-
3 from __future__
import print_function
8 from Hurricane
import Box
9 from coriolis2
.settings
import af
10 from utils
import Module
, SessionManager
, Config
12 import symbolic
.cmos
# do not remove
18 with
Config(Cfg
.Parameter
.Priority
.UserFile
) as cfg
:
19 cfg
.misc_catchCore
= False
21 cfg
.misc_paranoid
= False
23 cfg
.misc_logMode
= True
24 cfg
.misc_verboseLevel1
= True
25 cfg
.misc_verboseLevel2
= True
26 cfg
.etesian_effort
= 2
27 cfg
.etesian_spaceMargin
= "20.0%"
28 cfg
.etesian_aspectRatio
= "100.0%"
29 cfg
.etesian_uniformDensity
= True
30 cfg
.anabatic_edgeLenght
= 24
31 cfg
.anabatic_edgeWidth
= 8
32 cfg
.anabatic_topRoutingLayer
= 'METAL5'
33 cfg
.katana_searchHalo
= 30
34 cfg
.katana_eventsLimit
= 1000000
35 cfg
.katana_hTracksReservedLocal
= 7
36 cfg
.katana_vTracksReservedLocal
= 6
38 env
= af
.getEnvironment()
39 env
.setCLOCK('^clk$|m_clock')
49 with
SessionManager():
50 self
.init_abutment_box()
54 self
.editor
.setCell(self
.cell
)
56 result
= self
.place_and_route()
58 with
SessionManager():
68 self
.name
= self
.name
+ '_r'
69 self
.af
.saveCell(self
.cell
, CRL
.Catalog
.State
.Views
)
70 super(ALU16
, self
).save()
74 if not self
.build_submodules():
77 with
SessionManager():
78 self
.init_abutment_box()
79 self
.place_submodules()
81 # TODO: replace with some form of lazy evaluation?
82 y_north
= self
.from_dbu(self
.cell
.getAbutmentBox().getYMax())
83 for pin_conf
in self
.north_pins
:
84 pin_conf
['y'] = y_north
89 self
.editor
.setCell(self
.cell
)
91 # place first (in middle, between two)
92 # this puts all the remaining cells (little ones)
93 # into this (small) space so that they do not go
94 # "all over the place" around the add and sub
95 self
.ab
= Box(self
.to_dbu(400.0), self
.to_dbu(50.0),
96 self
.to_dbu(700.0), self
.to_dbu(500.0))
99 # then route (globally)
100 # this connects up not just in the remaining (little) cells,
101 # it connects *to add and sub and the outside world as well*
102 self
.init_abutment_box()
103 result
= self
.place_and_route()
109 def ScriptMain(editor
=None, **kwargs
):
113 'add', editor
, width
=350.0, height
=400.0,
115 {'net': 'a({})', 'x': 10.0, 'delta': 20.0, 'repeat': BIT_WIDTH
},
116 {'net': 'b({})', 'x': 20.0, 'delta': 20.0, 'repeat': BIT_WIDTH
},
119 {'net': 'o({})', 'x': 100.0, 'delta': 10.0, 'repeat': BIT_WIDTH
},
122 'b({})'.format(BIT_WIDTH
-1): (
123 'BLOCKAGE2', 'BLOCKAGE3', 'BLOCKAGE4',
128 'sub', editor
, width
=350.0, height
=400.0,
130 {'net': 'a({})', 'x': 10.0, 'delta': 20.0, 'repeat': BIT_WIDTH
},
131 {'net': 'b({})', 'x': 20.0, 'delta': 20.0, 'repeat': BIT_WIDTH
},
134 {'net': 'o({})', 'x': 100.0, 'delta': 10.0, 'repeat': BIT_WIDTH
},
137 'b({})'.format(BIT_WIDTH
-1): (
138 'BLOCKAGE2', 'BLOCKAGE3', 'BLOCKAGE4',
144 'alu16', editor
, width
=1100.0, height
=570.0,
145 submodules
=[(add
, 25.0, 75.0), (sub
, 725.0, 75.0)],
147 {'net': 'o({})', 'x': 50.0, 'delta': 60.0, 'repeat': BIT_WIDTH
},
151 {'net': 'a({})', 'x': 50.0, 'delta': 60.0, 'repeat': BIT_WIDTH
},
152 {'net': 'b({})', 'x': 80.0, 'delta': 60.0, 'repeat': BIT_WIDTH
},
155 {'net': 'rst', 'y': 140.0, 'layer': 'METAL2'},
161 if __name__
== '__main__':
163 success
= ScriptMain(**kwargs
)
168 sys
.exit(shellSuccess
)