Monday, October 30, 2017

report_bolttleneck

The following example reports the 20 worst bottleneck cells in the design based on the number of paths through the cell with slack less than 0.0.
pt_shell> report_bottleneck

****************************************
Report : bottleneck
        -max_cells 20
        -nworst_paths 100
Design : example
 ...
****************************************

Bottleneck Cost = Number of violating paths through cell

                                                 Bottleneck
Cell                              Reference      Cost
--------------------------------------------------------------
ipxr/ir1/i2/i0/u3                 DFF1A          39656.00
ipxr/ir1/U14                      INV2           39654.00
ipxr/ir1/U16                      INV8           39654.00
ipxr/ir1/i2/i0/u4                 DFF1A          31806.00
ipxr/ir1/U15                      BUF8B          31804.00
ipxr/U1712                        MUX2I          23999.00
ipxr/U558                         INV4           23999.00
ipxr/U1370                        NAN4           22485.00
ipxr/x01                          INV2           22485.00
dmac/BufEn                        BUF3           22485.00
dmac/U574                         INV            22485.00
ipxr/U1335                        NAN6CH         21844.00
ipxr/U564                         MUX2I          20074.00
ipxr/U1694                        MUX2A          19936.00
ipxr/U1559                        BUF2C          14785.00
ipxr/U1484                        MUX2I          14252.00
ipxr/U1486                        MUX2I          12468.00
SccMOD/U929                       OR3            12135.00
ipxr/U1493                        MUX2I          11248.00
dmac/BiuSMOD/U879                 NAN2           10949.00

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

How to Remove Duplicates From a Collection ("Uniquify" a Collection)

How to Remove Duplicates From a Collection ("Uniquify" a Collection)
I created a collection containing duplicate members. How can I remove the duplicates so that all members of the collection are unique ("uniquify" the collection)? 
Answer:
A collection is a group of objects which have certain attributes applied on them. Collections have an internal representation and cannot be accessed directly using Tcl list commands. For example, you can use the lsort -ucommand to uniquify objects in a list. This command does not work on a collection.
To uniquify a collection, use: 
add_to_collection -uniquify collection collection
In the following example, my_lc is a collection of lib_cells used in the design.
prompt> set my_lc
{"lib/NAND2X1_LVT","lib/NAND2X1_LVT","lib/NAND2X1_LVT","lib/NAND2X1_LVT"}

prompt> sizeof_collection $my_lc
4

prompt> set t1 [add_to_collection -unique $my_lc $my_lc]
{"lib/NAND2X1_LVT"}

prompt> sizeof_collection $t1
1

Below is one more example. There are points on a timing path. For multiple timing paths, some portion of the path may be common. So the points can be repeated in the collection. The following script uniquifies such collection of points: 

prompt> set path [get_timing_paths -through U16 -max_paths 2]
prompt> set point [get_attribute $path points]
prompt> foreach_in_collection p $point {
  set t1 [add_to_collection $t1 [get_attribute $p object]]
  }
prompt> set t [add_to_collection -unique $t1 $t1]
prompt> sizeof_collection $t1
48
prompt> sizeof_collection $t
28

Thursday, October 26, 2017

Why POCV is prefered to AOCV beyond 10nm?


does setup and hold violation can happen simultaneously in a given path?

Setup and hold violation can't happen at the same time for same start point and end point.

But, for given end point and assume if there are 2 or more start points to it then it happens. one of these paths can have setup violation and other path may have hold violation to the same end point.

How PrimeTime identifies different vdd voltages during analysis during multivdd analysis

Using LPPI file

It has info on which instance is associated with which vdd.

Procedure to fix setup and hold checks if violated





Understand the design hierarchy:
Know from which block to which block you want to analyze
See report and check the clock group or capture clock of your interest


Analyzing paths:
report_timing -from startpoint  -to endpoint  -pba_mode path -path_type full_clock_expanded -nets  -input_pins -significant_digits 4
if slack is -ve (violating); then follow below techniques.

Order of fixing the setup violations:
            Use Pba mode with path (during early eco) and exhaustive (during final eco stage)
1. Reducing data path delay:
-----------------------------------------------------
report_timing with below options (derate, trans, cap, and net):
       - see whether derates are applied properly or not

a) Sizing of data path cells (increasing the drive):  Sizing would be first choice as buffering needs extra space comparatively.

Example:
         U1/z (ref_name)                            0.06 H    28.38 f
         get_alternative_lib_cells -current_library   U1
         size_cell instance_name   Upsized_lib_cell

a) Buffering to reduce delay
         insert_buffer  Instance_name/pin    buf_lib_cell
    E.g.: insert_buffer   U1/z   buf_v20_12

c) VT swap:
         - Change to LVT (generally, 20% LVT and 80% SVT+HVT)
         size_cell  HVT_instance_name   LVT_lib_cell
 
d) cross talk

e) derate check

f) Jog to higher layer (check with P&R guys; not in PT domain)

2. Check the insertion delays of launch and capture clocks and try to balance them.
http://tech.tdzire.com/timing-eco-flow-with-examples/


At the early stage of the design,
1. See whether the skew of the launch and the capture clocks are balanced.
If launch clock is having more latency, the data will come late to the capture flop,
and thus result in setup violations.


For setup violations:
 - increase the capture clock latency
 - decrease the launch clock latency with set_anootated_delay command
and see whether it is not resulting in any additional violations and viceversa
 for HOLD violations.


At matured stage of the design:
1. Try not to touch clock tree.
2. Decrease data path delay.
 - size up, change to lower vt,


2. Clock path tweaking (push/pulling the clock path): Recommended this at the initial timing ECO changes.
-----------------------------------------------------
Pusing is prefered to pull clock because adding delay on net is fine and can be done easily but reducing delay is tough.

2a)Pushing the clock going to FF2/CP2:
          insert_buffer in the clock path before clock pin.
while inserting do -path_type full_clock_expanded then insert before clock pin
             
insert_buffer  U2/z   buf_3x_ref_name

For exampale, setup slack = -30ps
and adding 3 buffers of 10ps each in SS corner (note that FF corner it is 5ps each).


Since we are fixing setup violation of FF2/CP2 by adding some delay in the clock path (required time increases), so potentially -> there is a chance of hold violation as it is (AT-RT).


i)Checking setup @next stage: (+30ps)
           report_timing     -from  FF2/clk  -pba_mode path
           i.e., report_timing -from FF2/clk -pba_mode path


This is checking for those particular paths. But, clock pin is connected to so many flops (parallel branches of capture FF). so we need to consider all flops which are connected to clk pin which we are going to push.

Getting all flops which are connected to clk pin:
        all_fanout  -from  path_till_FF2/clk   -flat   -endpoints_only  -only_cells

Check setup to all these flops:
         report_timing  -from [ above_cmd]  -pba_mode path

Getting the margins from next flops:
If slack is -ve, then use -exclude {failed_slack_end_point full_path} and try again. After doing this, if slack is positive then fix above failed path; then you can push the clock.

ii) hold check violation to FF2/D in FF corner: at the same  stage: (+15ps)
         report_timing     -delay_type min   -to   FF2/D  -pba_mode path
and see whether 3*5ps = 15ps margin is available or not.


Same logic applies to hold as well:
Getting all flops which are connected to clk pin:
        all_fanout  -from  /clk   -flat   -endpoints_only  -only_cells

Check hold to all these flops:
         report_timing -delay_type min  -to [ above_cmd]  -pba_mode path

2b) Pulling the clock going to FF1/CP1:

Reduce 30ps delay in the launch clock path in SS corner (-30ps).

i) Since AT is reduced to fix setup here, check hold at the same stage first in FF corner (+15ps).
         report_timing  -delay_type   min   -from  FF1/CP  -pba_mode path

ii) setup violation from previous stage in SS corner (+30ps ):
           report_timing   -to   FF1/D

------------------------------------

The above examples w.r.t report looks as shown below:
################
  finalopt_SIZE_ONLY_BUF_INST_31/z (buf_8x_ref_name)
                                                          0.10 H    28.32 f
 
U1/z  ()                            0.05 H    28.37 f
#################


##Getting slack margins to startpoint to pull the clock:

# Get list of cells to which you want to know the slack margin

set cells [get_cells { \
start_point ##put start_point path in the report; remove clk pin \
}]

# get input pin (data pin) of those cells and get slack, sp using get_timing_path command
set f [open fanin.txt w]
foreach_in_collection cell $cells {
set ipin [get_pins -of_objects [get_cell $cell] -filter "direction==in"]

foreach_in_collection pin $ipin {
set p1 [get_timing_path -through $pin ]
set slack1 [get_attribute $p1 slack]
set s1 [get_attribute $p1 startpoint]
puts $f "[get_attribute $pin full_name] [get_attribute $s1 full_name] $slack1"
}

}
close $f

II) Fixing Hold violations:
i) pba mode (path/exhaustive) should resolve most of the violations.
ii) End point buffering
           - It won't affect prev and next stages.
iii) Downsize in the data path:
            - Make sure that max_transition violations don't occur as tool might have put it for transition purpose and not for delay pov.
iv) LVT -> HVT


3) Net optimization:
If setup violation is very less and there is no scope in data path then check whether nets can be optimized by promoting the critical nets to top metal layers. Since top metal layers are thicker, capacitance is lesser and thus net delay will be less. So usually clocks and critical nets are routed at the top metal layers.


Before giving fix to Physical design team, make sure there are no new violations introduced due to the fix. if setup is not fixable at all, check whether it is within the uncertainity range. If not we may have to reduce the frequency. But keep in mind that this is the final choice.


For fixing hold violations, follow reverse procedure.


#########
TIPS:
#########
1.  Check whether the launch and capture clocks are same or different.
If different, check whether they are synchronous.
If asynchronous and can be set as false path, then add the missed false path in your exceptions.


2. Check whether spef is annotated properly


3. Now check whether the launch and capture clock edges are as intended. That is to check whether some multicycle path is missed in the exceptions or not.


4. Next thing is to check with the clock path in launch and capture path, whether they are traced properly as intended.
Sometimes even if launch and capture clocks are the same they will be traced through different paths to make the analysis pessimistic. These can happen if you have muxes in the clock path.


5. If the clock is not traced properly, CRPR may not be removed properly.


6. Check whether the deration and uncertainity values applied properly.


7. Once you figured our that the path is valid, and if it is a setup violation, just see whether one cell is giving big delay. If yes check with the physical design team whether this is placed far away or not.


8. Check with the RTL team to confirm whether the clock freq is same if it a setup violation.

###############
If there are a lot of violations and power is not critical:
report_timing -slack_lesser_than 0 -max_paths 200000 -nworst 100 -delay max > max_paths.rpt
DMSA setup can check ECO across modes and corners in one shot. During final stage, do VT swap only as it will not disturb DRC.