Skip to content

Commit 87d2675

Browse files
authored
Merge pull request #2711 from Pinata-Consulting/mock-array-read-vcd-check
mock-array: report error if all pins are not in .vcd for read_vcd
2 parents 16b236c + b1f79ea commit 87d2675

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

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

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,48 @@ for {set x 0} {$x < 8} {incr x} {
2121
}
2222

2323
log_cmd report_power
24-
log_cmd read_vcd -scope TOP/MockArray $::env(RESULTS_DIR)/MockArrayTestbench.vcd
24+
25+
set vcd_file $::env(RESULTS_DIR)/MockArrayTestbench.vcd
26+
log_cmd read_vcd -scope TOP/MockArray $vcd_file
27+
28+
puts "Total number of pins to be annotated: [llength [get_pins -hierarchical *]]"
29+
set no_vcd_activity {}
30+
set pins [get_pins -hierarchical *]
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+
if {$activity_origin == "constant"} {
38+
continue
39+
}
40+
if {$activity_origin == "unknown"} {
41+
continue
42+
}
43+
if {[get_property $pin is_hierarchical]} {
44+
continue
45+
}
46+
if {$activity_origin == "clock"} {
47+
continue
48+
}
49+
set direction [get_property $pin direction]
50+
if {$direction == "internal"} {
51+
continue
52+
}
53+
lappend no_vcd_activity "[get_full_name $pin] $activity $direction"
54+
if {[llength $no_vcd_activity] >= 10} {
55+
break
56+
}
57+
}
58+
59+
if {[llength $no_vcd_activity] > 0} {
60+
puts "Error: Listing [llength $no_vcd_activity] pins without activity from $vcd_file:"
61+
foreach pin $no_vcd_activity {
62+
puts $pin
63+
}
64+
exit 1
65+
}
2566

2667
set ces {}
2768
for {set x 0} {$x < 8} {incr x} {

0 commit comments

Comments
 (0)