@@ -25,9 +25,24 @@ log_cmd report_power
2525set vcd_file $::env(RESULTS_DIR) /MockArrayTestbench.vcd
2626log_cmd read_vcd -scope TOP/MockArray $vcd_file
2727
28- puts " Total number of pins to be annotated: [ llength [get_pins -hierarchical *] ]"
29- set no_vcd_activity {}
28+ set fp [open $::env(RESULTS_DIR) /activity.tcl w]
3029set pins [get_pins -hierarchical *]
30+ set clock_period [expr [get_property [get_clocks] period] * 1e-12]
31+ foreach pin $pins {
32+ set activity [get_property $pin activity]
33+ set activity_origin [lindex $activity 2]
34+ if {$activity_origin != " vcd" } {
35+ continue
36+ }
37+ puts $fp " set_power_activity \
38+ -pin \[ get_pins \{ [ get_property $pin full_name] \}\] \
39+ -activity [ expr [lindex $activity 0] * $clock_period ] \
40+ -duty [ lindex $activity 1] "
41+ }
42+ close $fp
43+
44+ puts " Total number of pins: [ llength [get_pins -hierarchical *] ]"
45+ set no_vcd_activity {}
3146foreach pin $pins {
3247 set activity [get_property $pin activity]
3348 set activity_origin [lindex $activity 2]
@@ -71,9 +86,16 @@ for {set x 0} {$x < 8} {incr x} {
7186 }
7287}
7388
74- puts {report_power -instances [get_cells $ces ]}
89+ # puts {report_power -instances [get_cells $ces]}
7590report_power -instances [get_cells $ces ]
76- log_cmd report_power
91+ log_cmd report_power > $::env(REPORTS_DIR) /power_vcd.txt
92+ 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
95+
96+ set fp [open $::env(REPORTS_DIR) /power_user.txt r]
97+ puts " [ read $fp ] "
98+ close $fp
7799
78100log_cmd report_parasitic_annotation
79101log_cmd report_activity_annotation -report_unannotated
0 commit comments