Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test/orfs/mock-array/power.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ log_cmd report_checks
log_cmd report_power

set fp [open $::env(RESULTS_DIR)/activity.tcl w]
set pins [get_pins -hierarchical *]
set clock_period [expr [get_property [get_clocks] period] * 1e-12]
set pins [lsort -dictionary [get_pins -hierarchical *]]
set periods [get_property [get_clocks] period]
set clock_period [expr [lindex [lsort -real $periods] end] * 1e-12]
foreach pin $pins {
set activity [get_property $pin activity]
set activity_origin [lindex $activity 2]
Expand Down Expand Up @@ -103,7 +104,7 @@ set total_power_user_activity [total_power]
puts "Total power from VCD: $total_power_vcd"
puts "Total power from user activity: $total_power_user_activity"

if { $total_power_vcd == $total_power_user_activity } {
if { abs($total_power_vcd - $total_power_user_activity) < 1e-9 } {
puts "Error: setting user power activity had no effect, expected some loss in accuracy"
exit 1
}
Expand Down