@@ -2,14 +2,14 @@ source $::env(SCRIPTS_DIR)/util.tcl
2
2
3
3
proc write_keep_hierarchy {} {
4
4
if { ![env_var_equals SYNTH_HIERARCHICAL 1] } {
5
- set out_script_ptr [open $::env(SYNTH_STOP_MODULE_SCRIPT ) w]
5
+ set out_script_ptr [open $::env(SYNTH_STATS ) w]
6
6
close $out_script_ptr
7
7
return
8
8
}
9
9
10
10
source $::env(SCRIPTS_DIR) /synth_preamble.tcl
11
11
12
- synthesize_check {}
12
+ synthesize_check mem_hierarchical {}
13
13
14
14
if { [env_var_exists_and_non_empty ADDER_MAP_FILE] && [file isfile $::env(ADDER_MAP_FILE) ] } {
15
15
techmap -map $::env(ADDER_MAP_FILE)
@@ -25,11 +25,6 @@ proc write_keep_hierarchy {} {
25
25
26
26
tee -o $::env(REPORTS_DIR) /synth_hier_stat.txt stat {*}$stat_libs
27
27
28
- set ungroup_threshold 0
29
- if { [env_var_exists_and_non_empty MAX_UNGROUP_SIZE] && $::env(MAX_UNGROUP_SIZE) > 0 } {
30
- set ungroup_threshold $::env(MAX_UNGROUP_SIZE)
31
- puts " Ungroup modules of size $ungroup_threshold "
32
- }
33
28
hierarchy -check -top $::env(DESIGN_NAME)
34
29
set fptr [open $::env(REPORTS_DIR) /synth_hier_stat.txt r]
35
30
set contents [read -nonewline $fptr ]
@@ -53,27 +48,26 @@ proc write_keep_hierarchy {} {
53
48
}
54
49
}
55
50
}
56
- set out_script_ptr [ open $::env(SYNTH_STOP_MODULE_SCRIPT) w]
57
- puts $out_script_ptr " hierarchy -check -top $::env(DESIGN_NAME) "
51
+
52
+ set areas {}
58
53
foreach module $module_list {
59
- tee -o $::env(REPORTS_DIR ) /synth_hier_stat_temp_module.txt stat -top " $module " {*}$stat_libs
60
- set fptr1 [open $::env(REPORTS_DIR ) /synth_hier_stat_temp_module.txt r]
54
+ tee -o $::env(OBJECTS_DIR ) /synth_hier_stat_temp_module.txt stat -top " $module " {*}$stat_libs
55
+ set fptr1 [open $::env(OBJECTS_DIR ) /synth_hier_stat_temp_module.txt r]
61
56
set contents1 [read -nonewline $fptr1 ]
62
57
close $fptr1
63
58
set split_cont1 [split $contents1 " \n " ]
64
59
foreach line $split_cont1 {
65
60
if {[regexp { +Chip area for top module '(\S+)': (.*)} $line -> module_name area]} {
66
- if {[expr $area > $ungroup_threshold ]} {
67
- puts " Preserving module: $module_name (area: $area )"
68
- puts $out_script_ptr " select -module {$module_name }"
69
- puts $out_script_ptr " setattr -mod -set keep_hierarchy 1"
70
- puts $out_script_ptr " select -clear"
71
- } else {
72
- puts " Flattening module $module_name (area: $area )"
73
- }
61
+ lappend areas " $area $module_name "
74
62
}
75
63
}
76
- file delete -force $::env(REPORTS_DIR) /synth_hier_stat_temp_module.txt
64
+ file delete -force $::env(OBJECTS_DIR) /synth_hier_stat_temp_module.txt
65
+ }
66
+ set areas [lsort -index 0 -real $areas ]
67
+
68
+ set out_script_ptr [open $::env(SYNTH_STATS) w]
69
+ foreach {line} $areas {
70
+ puts $out_script_ptr $line
77
71
}
78
72
close $out_script_ptr
79
73
}
0 commit comments