-
Notifications
You must be signed in to change notification settings - Fork 504
Expand file tree
/
Copy pathfloorplan.tcl
More file actions
174 lines (151 loc) · 6.48 KB
/
Copy pathfloorplan.tcl
File metadata and controls
174 lines (151 loc) · 6.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
utl::set_metrics_stage "floorplan__{}"
source $::env(SCRIPTS_DIR)/load.tcl
erase_non_stage_variables floorplan
load_design 1_synth.odb 1_synth.sdc
source_step_tcl PRE FLOORPLAN
proc report_unused_masters { } {
set db [ord::get_db]
set libs [$db getLibs]
set masters ""
foreach lib $libs {
foreach master [$lib getMasters] {
# filter out non-block masters, or you can remove this conditional to detect any unused master
if { [$master getType] == "BLOCK" } {
lappend masters $master
}
}
}
set block [ord::get_db_block]
set insts [$block getInsts]
foreach inst $insts {
set inst_master [$inst getMaster]
set masters [lsearch -all -not -inline $masters $inst_master]
}
foreach master $masters {
puts "Master [$master getName] is loaded but not used in the design"
}
}
report_unused_masters
#Run check_setup
puts "\n=========================================================================="
puts "Floorplan check_setup"
puts "--------------------------------------------------------------------------"
check_setup
set num_instances [llength [get_cells -hier *]]
puts "number instances in verilog is $num_instances"
set additional_args ""
append_env_var additional_args ADDITIONAL_SITES -additional_sites 1
# Check which floorplan initialization method is specified (mutually exclusive)
set use_floorplan_def [env_var_exists_and_non_empty FLOORPLAN_DEF]
set use_footprint [env_var_exists_and_non_empty FOOTPRINT]
set use_die_and_core_area \
[expr { [env_var_exists_and_non_empty DIE_AREA] && [env_var_exists_and_non_empty CORE_AREA] }]
set use_core_utilization [env_var_exists_and_non_empty CORE_UTILIZATION]
# Enforce mutual exclusion - exactly one method must be specified
set methods_defined \
[expr { $use_floorplan_def + $use_footprint + $use_die_and_core_area + $use_core_utilization }]
if { $methods_defined > 1 } {
puts "Error: Floorplan initialization methods are mutually exclusive, pick one."
exit 1
}
# Method 1: Use existing DEF file with floorplan data
if { $use_floorplan_def } {
log_cmd read_def -floorplan_initialize $env(FLOORPLAN_DEF)
# Method 2: Use ICeWall footprint file (platform-specific extension)
} elseif { $use_footprint } {
ICeWall load_footprint $env(FOOTPRINT)
initialize_floorplan \
-die_area [ICeWall get_die_area] \
-core_area [ICeWall get_core_area] \
-site $::env(PLACE_SITE)
ICeWall init_footprint $env(SIG_MAP_FILE)
# Method 3: Use explicit die and core area coordinates
} elseif { $use_die_and_core_area } {
initialize_floorplan -die_area $::env(DIE_AREA) \
-core_area $::env(CORE_AREA) \
-site $::env(PLACE_SITE) \
{*}$additional_args
# Method 4: Calculate core area from utilization, aspect ratio, and margins
} elseif { $use_core_utilization } {
initialize_floorplan -utilization $::env(CORE_UTILIZATION) \
-aspect_ratio $::env(CORE_ASPECT_RATIO) \
-core_space $::env(CORE_MARGIN) \
-site $::env(PLACE_SITE) \
{*}$additional_args
} else {
puts "Error: No floorplan initialization method specified"
exit 1
}
# Create routing tracks: MAKE_TRACKS script, platform make_tracks.tcl, or make_tracks command
if { [env_var_exists_and_non_empty MAKE_TRACKS] } {
log_cmd source $::env(MAKE_TRACKS)
} elseif { [file exists $::env(PLATFORM_DIR)/make_tracks.tcl] } {
log_cmd source $::env(PLATFORM_DIR)/make_tracks.tcl
} else {
make_tracks
}
# Configure global routing: FASTROUTE_TCL script or
# set_global_routing_layer_adjustment/set_routing_layers
if { [env_var_exists_and_non_empty FASTROUTE_TCL] } {
log_cmd source $::env(FASTROUTE_TCL)
} else {
log_cmd \
set_global_routing_layer_adjustment \
$::env(MIN_ROUTING_LAYER)-$::env(MAX_ROUTING_LAYER) $::env(ROUTING_LAYER_ADJUSTMENT)
log_cmd set_routing_layers -signal $::env(MIN_ROUTING_LAYER)-$::env(MAX_ROUTING_LAYER)
}
source_env_var_if_exists FOOTPRINT_TCL
set_dont_use $::env(DONT_USE_CELLS)
# The transforms below (repair_tie_fanout, replace_arith_modules,
# remove_buffers, repair_timing_helper) look like synthesis-stage
# operations: they all act on the netlist and don't touch placement.
# But they DO depend on having a floorplan in place — initialize_floorplan
# above placed the bterms on the die boundary and set_routing_layers
# configured the layer stack used for parasitic estimation. Without that
# context, top-level ports look like they're at (0,0) and timing analysis
# misjudges paths into/out of I/O.
#
# PR #4187 tried moving this block to synth_odb.tcl. It regressed setup
# TNS by 1.7-46x on I/O-heavy designs (asap7/aes-block 2.5x, asap7/jpeg_lvt
# 37x, asap7/swerv_wrapper 46x finish-hold-TNS, nangate45/ariane133 1.7x)
# while leaving internal-logic-dominated designs like asap7/ibex
# unchanged. The move was reverted; only eliminate_dead_logic stayed in
# synth_odb.tcl because it is a pure netlist transform that doesn't
# depend on placement or routing-layer context.
if { !$::env(SKIP_REPAIR_TIE_FANOUT) } {
# This needs to come before any call to remove_buffers. You could have one
# tie driving multiple buffers that drive multiple outputs.
# Repair tie lo fanout
puts "Repair tie lo fanout..."
set tielo_cell_name [lindex $::env(TIELO_CELL_AND_PORT) 0]
set tielo_lib_name [get_name [get_property [lindex [get_lib_cell $tielo_cell_name] 0] library]]
set tielo_pin $tielo_lib_name/$tielo_cell_name/[lindex $::env(TIELO_CELL_AND_PORT) 1]
repair_tie_fanout -separation $::env(TIE_SEPARATION) $tielo_pin
# Repair tie hi fanout
puts "Repair tie hi fanout..."
set tiehi_cell_name [lindex $::env(TIEHI_CELL_AND_PORT) 0]
set tiehi_lib_name [get_name [get_property [lindex [get_lib_cell $tiehi_cell_name] 0] library]]
set tiehi_pin $tiehi_lib_name/$tiehi_cell_name/[lindex $::env(TIEHI_CELL_AND_PORT) 1]
repair_tie_fanout -separation $::env(TIE_SEPARATION) $tiehi_pin
}
if { [env_var_exists_and_non_empty SWAP_ARITH_OPERATORS] } {
# Enable sanity checker until replace_arith_modules becomes stable
set_debug_level ODB replace_design_check_sanity 1
replace_arith_modules
}
if { $::env(REMOVE_ABC_BUFFERS) } {
# remove buffers inserted by yosys/abc
remove_buffers
} else {
# Coarse optimization only (netlist-changing moves), skip last gasp.
repair_timing_helper -setup -skip_last_gasp -phases "COARSE"
}
puts "Default units for flow"
report_units
report_units_metric
report_layer_rc
report_metrics 2 "floorplan final" false false
source_step_tcl POST FLOORPLAN
source_env_var_if_exists IO_CONSTRAINTS
orfs_write_db $::env(RESULTS_DIR)/2_1_floorplan.odb
orfs_write_sdc $::env(RESULTS_DIR)/2_1_floorplan.sdc