Skip to content

Commit c3439c0

Browse files
committed
mock-array: check that read_vcd and setting user activity matches
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent a1fc096 commit c3439c0

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

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

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,24 @@ log_cmd report_power
2525
set vcd_file $::env(RESULTS_DIR)/MockArrayTestbench.vcd
2626
log_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]
3029
set 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 {}
3146
foreach 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]}
7590
report_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

78100
log_cmd report_parasitic_annotation
79101
log_cmd report_activity_annotation -report_unannotated

0 commit comments

Comments
 (0)