Skip to content

Commit 326ed14

Browse files
committed
plot: plot area of instances in module only, not submodules
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent b1430d3 commit 326ed14

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

flow/scripts/plot_keep.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def load_data(filename):
1313
data = {}
1414
with open(filename) as f:
1515
for line in f:
16-
key, value = line.split()
16+
key, value = line.split()[0:2]
1717
data[key] = float(value)
1818
return data
1919

@@ -32,8 +32,9 @@ def main():
3232
data1 = load_data(sys.argv[1])
3333
data2 = load_data(sys.argv[2])
3434
keys = set(data1.keys()) & set(data2.keys())
35-
x = [data1[key] for key in keys]
36-
y = [data2[key] for key in keys]
35+
max_value = 3000
36+
x = [data1[key] for key in keys if data1[key] < max_value and data2[key] < max_value]
37+
y = [data2[key] for key in keys if data1[key] < max_value and data2[key] < max_value]
3738
plot_data(x, y)
3839

3940

flow/scripts/report_area.tcl

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,9 @@ set block [$chip getBlock]
88

99
set scale_to_um [expr [$block getDbUnitsPerMicron] * [$block getDbUnitsPerMicron]]
1010

11-
set insts [$block getInsts]
12-
13-
proc insts_area {insts} {
14-
global scale_to_um
15-
set area 0
16-
foreach inst $insts {
17-
set bbox [$inst getBBox]
18-
set area [expr $area + [$bbox getDX] * [$bbox getDY]]
19-
}
20-
return [expr $area / $scale_to_um]
21-
}
22-
23-
proc module_area {module} {
11+
proc module_area {insts} {
2412
global scale_to_um
2513
set area 0
26-
set insts [$module getLeafInsts]
2714
foreach inst $insts {
2815
set bbox [$inst getBBox]
2916
set area [expr $area + [$bbox getDX] * [$bbox getDY]]
@@ -33,7 +20,6 @@ proc module_area {module} {
3320

3421
set f [open $::env(REPORTS_DIR)/2_area.txt w]
3522
foreach module [$block getModules] {
36-
set area [module_area $module]
37-
puts $f "[$module getName] $area"
23+
puts $f "[$module getName] [module_area [$module getInsts]] [module_area [$module getLeafInsts]]"
3824
}
3925
close $f

0 commit comments

Comments
 (0)