proc report_clk_len_violation {args} {
set inputs(-max_distance) 800
set inputs(-file_name) ../signoff/clk_len_vio.rpt
parse_proc_arguments -args $args inputs
set inputs(-max_distance) [format %.3f $inputs(-max_distance)]
setOptMode -maxLength 0.5
reportLengthViolation -outfile $inputs(-file_name)
array set exist_vios ""
set lines [exec cat $inputs(-file_name) | grep -v "#" | grep -v ":"]
set lines [split $lines "\n"]
foreach line $lines {
if {[regexp {^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)} $line w net threshold net_len slack]} {
set exist_vios($net) [list $threshold $net_len $slack ]
}
}
set all_nets [dbGet top.nets.name]
set exist_nets [array names exist_vios]
set target_nets [remove_from_collection [get_nets $all_nets] [get_nets $exist_nets]]
if {[sizeof_collection $target_nets] == 0} {
puts "Information: No net to be checked"
return
}
puts "Information: [sizeof_collection $target_nets] more nets found beyond reportLengthViolation command."
set nets [get_property $target_nets dbObject]
set rst_nets ""
set n 0
array set new_vios ""
foreach net $nets {
set real_len [expr [join [dbGet $net.wires.length ] +]]
if {$real_len > $inputs(-max_distance)} {
set new_vios([lindex [dbGet $net.name] 0]) [list $inputs(-max_distance) [format %.3f $real_len] [format %.3f [expr $inputs(-max_distance) - $real_len]]]
incr n
}
}
puts "Information: $n more violation found beyond reportLengthViolation Command."
set rst ""
foreach net [array names new_vios] {
lappend rst [list $net $new_vios($net)]
}
set rst [lsort -real -index {1 2} $rst]
set n [llength $rst]
set lines [exec head -9 $inputs(-file_name)]
set lines [split $lines "\n"]
set FO [open $inputs(-file_name) w]
foreach line $lines {
#
}
foreach r $rst {
puts $FO [format "%-102s %-15.3f %-15.3f %-.3f" [lindex $r 0] [lindex $r 1 0] [lindex $r 1 1] [lindex $r 1 2]]
}
puts $FO ""
puts $FO "*info: there are $n max length violation in the design"
puts "*info:there are $n max length violation in the design"
close $FO
}
define_proc_arguments report_len_violation -info "Reporting max length violations" \
-define_args {
{-max_distance "Max distance to check length violation in um.Default is 800." "distance" float optional}
{-file_name "Output file name,default is LenVio.rpt" "file_name" string optioal}
}
report_clk_len_violation
setOptMode -maxLength 800