Monday, October 30, 2017

get_timing_paths

The get_timing_paths command creates a collection of paths for custom reporting or other operations. Most of the get_timing_paths command options are shared by report_timing, and the behavior of these shared options is identical. The order in which paths are returned from get_timing_paths matches the reported timing path order ofreport_timing.
You can pass the generated collection directly to another command, or you can set a variable to the collection for later reporting. For example,
pt_shell> sizeof_collection [get_timing_paths -nworst 4 -max_paths 20]
Warning: report_timing has satisfied the max_paths criteria. ...
20

pt_shell> set mypaths [get_timing_paths -nworst 4 -max_paths 20]
Warning: report_timing has satisfied the max_paths criteria. ...
Information: Defining new variable 'mypaths'. (CMD-041)
 ...
pt_shell> sizeof_collection $mypaths
20
pt_shell> get_attribute $mypaths slack
-1.157432 -0.987188 -0.984205 -0.971914 -0.968931 -0.873521 ...
pt_shell> report_timing $mypaths
(20 path timing reports displayed)

foreach_in_collection:
To iterate over the paths in the collection, use the foreach_in_collection command. To obtain information about paths, use the get_attributereport_attribute, and collection commands. To get a list of timing path attributes, use the following command:
pt_shell> list_attributes -application -class timing_path
 ... 
Attribute Name             Object        Type       Properties  Constraints
---------------------------------------------------------------------------
arrival                    timing_path   float      A                      
capture_clock_paths        timing_path   collection A                      
clock_uncertainty          timing_path   float      A                      
close_edge_adjustment      timing_path   float      A
common_path_pessimism      timing_path   float      A
...
One attribute of a timing path is the points collection. A point corresponds to a pin or port along the path. Iterate through these points with the foreach_in_collection command and collect attributes on them by using the get_attribute command. To get a list of timing path attributes, use the following command:
pt_shell> list_attributes -application -class timing_point
 ...
Attribute Name              Object         Type     Properties  Constraints
---------------------------------------------------------------------------
annotated_delay_delta       timing_point   float    A                      
annotated_delta_transition  timing_point   float    A                      
aocvm_coefficient           timing_point   float    A                      
applied_derate              timing_point   float    A                      
arrival                     timing_point   float    A
 ...
For information about creating collections and iterating over the elements of a collection, see the examples in the EXAMPLES section and the man pages of the collections and foreach_in_collection commands.
To report the dominant and overridden timing exceptions related to the timing path, use the report_timing command with the -exceptions option. To get more information about the exceptions that apply to the path, you can create a path collection with the get_timing_paths command and query the timing path attributes:
Attribute                         Possible Reason
-----------------------------------------------------------------------
dominant_exception                false_path / min_max_delay / 
                                  multicycle_path
startpoint_unconstrained_reason   no_launch_clock / dangling_start_point / 
                                  fanout_of_disabled
endpoint_unconstrained_reason     no_capture_clock / dangling_end_point / 
                                  fanin_of_disabled

proc gtpl {var} {
    foreach_in_collection  timing_path [get_timing_paths $var] {
        puts "[gon $timing_path]"
    }
}
1. The following procedure prints out the
                startpoint name,
                endpoint name,
                slack of the worst path in each path group.
            proc custom_report_worst_path_per_group {} {
                  echo [format "%-20s %-20s %7s" "From" "To" "Slack"]
                  echo "--------------------------------------------------------"
                  foreach_in_collection path [get_timing_paths] {
                    set slack [get_attribute $path slack]
                    set startpoint [get_attribute $path startpoint]
                    set endpoint [get_attribute $path endpoint]
                    echo [format "%-20s %-20s %s" [get_attribute $startpoint full_name] \
                              [get_attribute $endpoint full_name] $slack]
                  }
            }
            pt_shell> custom_report_worst_path_per_group
            >From                         To                               Slack
            --------------------------------------------------------
            ffa/CP                      QA                            0.1977
            ffb/CP                      ffd/D                        3.8834
############################################
2. The following example shows Total Negative Slack, Total Positive Slack,
         and Worst Negative Slack for the current design.
            proc report_design_slack_information {} {
               set design_tns 0
               set design_wns 100000
               set design_tps 0
               foreach_in_collection group [get_path_groups *] {
                  set group_tns 0
                  set group_wns 100000
                  set group_tps 0
                  foreach_in_collection path [get_timing_paths -nworst 10000 -group $group] {
                     set slack [get_attribute $path slack]
                     if {$slack < $group_wns} {
                    set group_wns $slack
                    if {$slack < $design_wns} {
                       set design_wns $slack
                    }
                     }
                     if {$slack < 0.0} {
                    set group_tns [expr $group_tns + $slack]
                     } else {
                    set group_tps [expr $group_tps + $slack]
                     }
                  }
                  set design_tns [expr $design_tns + $group_tns]
                  set design_tps [expr $design_tps + $group_tps]
                  set group_name [get_attribute $group full_name]
                  echo [format "Group '%s' Worst Negative Slack : %g" $group_name $group_wns]
                  echo [format "Group '%s' Total Negative Slack : %g" $group_name $group_tns]
                  echo [format "Group '%s' Total Positive Slack : %g" $group_name $group_tps]
                  echo ""
               }
               echo "------------------------------------------"
               echo [format "Design Worst Negative Slack : %g" $design_wns]
               echo [format "Design Total Negative Slack : %g" $design_tns]
               echo [format "Design Total Positive Slack : %g" $design_tps]
            }
            pt_shell> report_design_slack_information
            Group 'CLK' Worst Negative Slack : -3.1166
            Group 'CLK' Total Negative Slack : -232.986
            Group 'CLK' Total Positive Slack : 4.5656
            Group 'vclk' Worst Negative Slack : -4.0213
            Group 'vclk' Total Negative Slack : -46.1982
            Group 'vclk' Total Positive Slack : 0
            ------------------------------------------
            Design Worst Negative Slack : -4.0213
            Design Total Negative Slack : -279.184
            Design Total Positive Slack : 4.5656
#######################
3. If   the   -pba_mode   option is specified, path recalculation (path-based
         analysis) is used during the path search, and   the   worst   recalculated
         paths   meeting   the user's criteria are returned.   This option requires
         that a path search be performed to ensure that the paths being returned
         truly   are   the   worst paths.   The additional runtime required for this
         option depends on the amount of timing improvement resulting from path-
         based   analysis.    As   the   timing improvement from path-based analysis
         increases, the runtime   for   the   path   search   will   increase.    Large
         -nworst   values   can   significantly   increase   the   time needed for the
         search.
         To see the worst path in the design with path-based analysis applied:
            pt_shell>report_timing [get_timing_paths -pba_mode exhaustive]
         To report all endpoints in the   design   which   fail   after   considering
         path-based analysis:
            pt_shell> set paths [get_timing_paths -pba_mode exhaustive -slack_lesser_than 0 -max_paths 1000]
            pt_shell> report_timing $paths

1 comment: