Skip to content

Commit 71e3382

Browse files
committed
mock-array: user power activity vs vcd checks
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent c3439c0 commit 71e3382

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

flow/designs/asap7/mock-array/power.tcl

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,32 @@ for {set x 0} {$x < 8} {incr x} {
8686
}
8787
}
8888

89-
# puts {report_power -instances [get_cells $ces]}
89+
puts {report_power -instances [get_cells $ces]}
9090
report_power -instances [get_cells $ces]
91-
log_cmd report_power > $::env(REPORTS_DIR)/power_vcd.txt
91+
92+
proc total_power {} {
93+
return [lindex [sta::design_power [sta::corners]] 3]
94+
}
95+
96+
set total_power_vcd [total_power]
97+
log_cmd report_power
98+
9299
source $::env(RESULTS_DIR)/activity.tcl
93-
log_cmd report_power > $::env(REPORTS_DIR)/power_user.txt
94-
exec diff $::env(REPORTS_DIR)/power_vcd.txt $::env(REPORTS_DIR)/power_user.txt
100+
log_cmd report_power
101+
set total_power_user_activity [total_power]
95102

96-
set fp [open $::env(REPORTS_DIR)/power_user.txt r]
97-
puts "[read $fp]"
98-
close $fp
103+
puts "Total power from VCD: $total_power_vcd"
104+
puts "Total power from user activity: $total_power_user_activity"
105+
106+
if {$total_power_vcd == $total_power_user_activity} {
107+
puts "Error: settting user power activity had no effect, expected some loss in accuracy"
108+
exit 1
109+
}
110+
111+
if {abs($total_power_vcd - $total_power_user_activity) > 1e-3} {
112+
puts "Error: Total power mismatch between VCD and user activity: $total_power_vcd vs $total_power_user_activity"
113+
exit 1
114+
}
99115

100116
log_cmd report_parasitic_annotation
101117
log_cmd report_activity_annotation -report_unannotated

0 commit comments

Comments
 (0)