|
1 | 1 | source $::env(SCRIPTS_DIR)/load.tcl |
2 | 2 | load_design 2_3_floorplan_tdms.odb 1_synth.sdc "Starting macro placement" |
3 | 3 |
|
4 | | -proc find_macros {} { |
5 | | - set macros "" |
6 | | - |
7 | | - set db [ord::get_db] |
8 | | - set block [[$db getChip] getBlock] |
9 | | - foreach inst [$block getInsts] { |
10 | | - set inst_master [$inst getMaster] |
11 | | - |
12 | | - # BLOCK means MACRO cells |
13 | | - if { [string match [$inst_master getType] "BLOCK"] } { |
14 | | - append macros " " $inst |
15 | | - } |
16 | | - } |
17 | | - return $macros |
18 | | -} |
19 | | - |
20 | | -if {[find_macros] != ""} { |
21 | | -# If wrappers defined replace macros with their wrapped version |
22 | | -# # ---------------------------------------------------------------------------- |
23 | | - if {[info exists ::env(MACRO_WRAPPERS)]} { |
24 | | - source $::env(MACRO_WRAPPERS) |
25 | | - |
26 | | - set wrapped_macros [dict keys [dict get $wrapper around]] |
27 | | - set db [ord::get_db] |
28 | | - set block [ord::get_db_block] |
29 | | - |
30 | | - foreach inst [$block getInsts] { |
31 | | - if {[lsearch -exact $wrapped_macros [[$inst getMaster] getName]] > -1} { |
32 | | - set new_master [dict get $wrapper around [[$inst getMaster] getName]] |
33 | | - puts "Replacing [[$inst getMaster] getName] with $new_master for [$inst getName]" |
34 | | - $inst swapMaster [$db findMaster $new_master] |
35 | | - } |
36 | | - } |
37 | | - } |
38 | | - |
39 | | - lassign $::env(MACRO_PLACE_HALO) halo_x halo_y |
40 | | - lassign $::env(MACRO_PLACE_CHANNEL) channel_x channel_y |
41 | | - set halo_max [expr max($halo_x, $halo_y)] |
42 | | - set channel_max [expr max($channel_x, $channel_y)] |
43 | | - set blockage_width [expr max($halo_max, $channel_max/2)] |
44 | | - |
45 | | - |
46 | | - if {[info exists ::env(MACRO_BLOCKAGE_HALO)]} { |
47 | | - set blockage_width $::env(MACRO_BLOCKAGE_HALO) |
48 | | - } |
49 | | - |
50 | | - if {[info exists ::env(MACRO_PLACEMENT_TCL)]} { |
51 | | - source $::env(MACRO_PLACEMENT_TCL) |
52 | | - puts "\[INFO\]\[FLOW-xxxx\] Using manual macro placement file $::env(MACRO_PLACEMENT_TCL)" |
53 | | - } elseif {[info exists ::env(MACRO_PLACEMENT)]} { |
54 | | - source $::env(SCRIPTS_DIR)/read_macro_placement.tcl |
55 | | - puts "\[INFO\]\[FLOW-xxxx\] Using manual macro placement file $::env(MACRO_PLACEMENT)" |
56 | | - read_macro_placement $::env(MACRO_PLACEMENT) |
57 | | - } elseif {[info exists ::env(RTLMP_FLOW)]} { |
58 | | - puts "HierRTLMP Flow enabled..." |
59 | | - set additional_rtlmp_args "" |
60 | | - if { [info exists ::env(RTLMP_MAX_LEVEL)]} { |
61 | | - append additional_rtlmp_args " -max_num_level $env(RTLMP_MAX_LEVEL)" |
62 | | - } |
63 | | - if { [info exists ::env(RTLMP_MAX_INST)]} { |
64 | | - append additional_rtlmp_args " -max_num_inst $env(RTLMP_MAX_INST)" |
65 | | - } |
66 | | - if { [info exists ::env(RTLMP_MIN_INST)]} { |
67 | | - append additional_rtlmp_args " -min_num_inst $env(RTLMP_MIN_INST)" |
68 | | - } |
69 | | - if { [info exists ::env(RTLMP_MAX_MACRO)]} { |
70 | | - append additional_rtlmp_args " -max_num_macro $env(RTLMP_MAX_MACRO)" |
71 | | - } |
72 | | - if { [info exists ::env(RTLMP_MIN_MACRO)]} { |
73 | | - append additional_rtlmp_args " -min_num_macro $env(RTLMP_MIN_MACRO)" |
74 | | - } |
75 | | - |
76 | | - append additional_rtlmp_args " -halo_width $halo_max" |
77 | | - |
78 | | - if { [info exists ::env(RTLMP_MIN_AR)]} { |
79 | | - append additional_rtlmp_args " -min_ar $env(RTLMP_MIN_AR)" |
80 | | - } |
81 | | - if { [info exists ::env(RTLMP_AREA_WT)]} { |
82 | | - append additional_rtlmp_args " -area_weight $env(RTLMP_AREA_WT)" |
83 | | - } |
84 | | - if { [info exists ::env(RTLMP_WIRELENGTH_WT)]} { |
85 | | - append additional_rtlmp_args " -wirelength_weight $env(RTLMP_WIRELENGTH_WT)" |
86 | | - } |
87 | | - if { [info exists ::env(RTLMP_OUTLINE_WT)]} { |
88 | | - append additional_rtlmp_args " -outline_weight $env(RTLMP_OUTLINE_WT)" |
89 | | - } |
90 | | - if { [info exists ::env(RTLMP_BOUNDARY_WT)]} { |
91 | | - append additional_rtlmp_args " -boundary_weight $env(RTLMP_BOUNDARY_WT)" |
92 | | - } |
93 | | - |
94 | | - if { [info exists ::env(RTLMP_NOTCH_WT)]} { |
95 | | - append additional_rtlmp_args " -notch_weight $env(RTLMP_NOTCH_WT)" |
96 | | - } |
97 | | - |
98 | | - if { [info exists ::env(RTLMP_DEAD_SPACE)]} { |
99 | | - append additional_rtlmp_args " -dead_space $env(RTLMP_DEAD_SPACE)" |
100 | | - } |
101 | | - if { [info exists ::env(RTLMP_CONFIG_FILE)]} { |
102 | | - append additional_rtlmp_args " -config_file $env(RTLMP_CONFIG_FILE)" |
103 | | - } |
104 | | - if { [info exists ::env(RTLMP_RPT_DIR)]} { |
105 | | - append additional_rtlmp_args " -report_directory $env(RTLMP_RPT_DIR)" |
106 | | - } |
107 | | - |
108 | | - if { [info exists ::env(RTLMP_FENCE_LX)]} { |
109 | | - append additional_rtlmp_args " -fence_lx $env(RTLMP_FENCE_LX)" |
110 | | - } |
111 | | - if { [info exists ::env(RTLMP_FENCE_LY)]} { |
112 | | - append additional_rtlmp_args " -fence_ly $env(RTLMP_FENCE_LY)" |
113 | | - } |
114 | | - if { [info exists ::env(RTLMP_FENCE_UX)]} { |
115 | | - append additional_rtlmp_args " -fence_ux $env(RTLMP_FENCE_UX)" |
116 | | - } |
117 | | - if { [info exists ::env(RTLMP_FENCE_UY)]} { |
118 | | - append additional_rtlmp_args " -fence_uy $env(RTLMP_FENCE_UY)" |
119 | | - } |
120 | | - |
121 | | - |
122 | | - puts "Call Macro Placer $additional_rtlmp_args" |
123 | | - |
124 | | - rtl_macro_placer \ |
125 | | - {*}$additional_rtlmp_args |
126 | | - |
127 | | - puts "Delete buffers for RTLMP flow..." |
128 | | - remove_buffers |
129 | | - } else { |
130 | | - macro_placement \ |
131 | | - -halo $::env(MACRO_PLACE_HALO) \ |
132 | | - -channel $::env(MACRO_PLACE_CHANNEL) |
133 | | - } |
134 | | - |
135 | | - source $::env(SCRIPTS_DIR)/placement_blockages.tcl |
136 | | - block_channels $blockage_width |
137 | | -} else { |
138 | | - puts "No macros found: Skipping macro_placement" |
139 | | -} |
| 4 | +source $::env(SCRIPTS_DIR)/macro_place_util.tcl |
140 | 5 |
|
141 | 6 | if {![info exists save_checkpoint] || $save_checkpoint} { |
142 | 7 | write_db $::env(RESULTS_DIR)/2_4_floorplan_macro.odb |
|
0 commit comments