Skip to content

Commit 50e8e41

Browse files
committed
floorplan.tcl: writes out 2_1_area.txt report
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent fa7672b commit 50e8e41

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

flow/scripts/floorplan.tcl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,32 @@ if { [env_var_exists_and_non_empty POST_FLOORPLAN_TCL] } {
193193
source $::env(POST_FLOORPLAN_TCL)
194194
}
195195

196+
set db [ord::get_db]
197+
set chip [$db getChip]
198+
set block [$chip getBlock]
199+
200+
set scale_to_um [expr [$block getDbUnitsPerMicron] * [$block getDbUnitsPerMicron]]
201+
202+
proc module_area {insts} {
203+
global scale_to_um
204+
set area 0
205+
foreach inst $insts {
206+
set bbox [$inst getBBox]
207+
set area [expr $area + [$bbox getDX] * [$bbox getDY]]
208+
}
209+
return [expr $area / $scale_to_um]
210+
}
211+
212+
# $REPORTS_DIR/2_1_area.txt has three columns:
213+
#
214+
# name - name of module
215+
# area - area of instances within module, excluding submodules
216+
# area_leaf - area of instances within module and submodules
217+
set f [open $::env(REPORTS_DIR)/2_1_area.txt w]
218+
foreach module [$block getModules] {
219+
puts $f "[$module getName] [module_area [$module getInsts]] [module_area [$module getLeafInsts]]"
220+
}
221+
close $f
222+
196223
write_db $::env(RESULTS_DIR)/2_1_floorplan.odb
197224
write_sdc -no_timestamp $::env(RESULTS_DIR)/2_1_floorplan.sdc

0 commit comments

Comments
 (0)