PTPX Methodology v1 3
PTPX Methodology v1 3
PrimeTime PX
Recommended Methodology for
Power Analysis
Version 1.3
Synopsys Proprietary
Copyright Notice and Proprietary Information
1 INTRODUCTION ................................................................................................................... 4
7 SUMMARY .......................................................................................................................... 22
Front End
Logic Logic Logic Needs
Synthesis Synthesis Synthesis
PTPX Average
Block1 Block2 Blockn Power
Synthesized Synthesized Synthesized
P (for
O budgeting)
W
Chip Level Gate Netlist
E
R
Back End
and Placement Needs
T Peak
I Power
CTS / Routing / SI
M
(for
I IR-drop,
N sign-off)
G Sign Off
2 Power Basics
Power is the energy dissipated in a device per unit of time. The total power
dissipated in a device consists of two components:
• Static or leakage power when the device is at steady state
• Dynamic power when the device is switching
2
ECcharge = CLV
ECdischarge = 0
Total energy consumed during charging and discharging the load is same as
the total energy dissipated during charging and discharging. Energy (ED) is
dissipated during the charging (EDcharge) or discharging (EDdischarge) of the load
capacitance.
2
EDcharge = ½ CLV
2
EDdischarge = ½ CLV
2
Power dissipated during charging and discharging = CLV f
2
= CLV (Tr / 2)
where toggle rate (Tr ) is the rate of change of state transitions with
respect to time; that is, the number of toggles per unit time.
3) Switching power, which is the power dissipated by the charging and
discharging of the load capacitance at the output of a cell, which is
where the total load capacitance (Cload) is the sum of the net and gate
capacitances on the driving output, and Tr is the toggle rate .
P P
In Inb Out
ISC ISC
Iintsw
Isw
N Ileak Cint N Ileak Cload
Gnd Gnd
The leakage current can vary based on the states of the transistor. With the
input signal in a high state, the leakage power when transistor N is on differs
from that when transistor N is off. A rising signal applied at the input results in
a dissipation of internal power due to currents Isc and Iintsw. Isc is seen from
Vdd to Gnd due to the transition from low to high as the transistor N turns on
and the transistor P turns off. Internal switching power is incurred during
charging and discharging of Cint. Charging and discharging of Cload results in
dissipation of switching power on Out net due to Isw. The dissipation of
internal power of a cell depends on the input transition time and output load
capacitance. It is pre-characterized and stored in the library for different
output loads and input transition times.
pt_shell
Setup Enable Power Analysis
Analysis
Timing Analysis Specify Activity
Power Analysis
- Analyze power
- Analyze timing
Reports
4 toggles
0 10 20 30 40 50
ns 0 10 20 30 40 50
Tr = 4 / 50 = 0.08 60
PTPX performs both types of power analysis: average power analysis and
peak power analysis. It calculates static and dynamic power for both average
power analysis and peak power analysis.
While PTPX supports annotation of gate-level simulation data, this is often not
available. The primary flows are:
• Vector free (VF): No switching activity for quick early analysis
• RTL VCD: With switching activity from RTL simulation for more accurate
average power analysis
You can use the vector-free flow (Figure 5) for quick power estimation early in
the design flow when there is no simulation data available. In this flow, PTPX
reads the design data, processes any defined switching activity and checks
the activity on all ports/pins. It assigns default toggle rates and static
probability on primary inputs and black-box outputs, and propagates the
activity with zero-delay simulation.
set link_library
Read Design Data read_verilog/read_vhdl/read_db
1. Read technology library
2. Read design netlist link
3. Read design constraints read_sdc
4. Read parasitics read_parasitics
set power_default_toggle_rate ……
Specify Activity
set power_default_static_probability ….
1. Default (and/or)
2. User defined set_switching_activity …………
set_annotated_power …………..
Power Analysis
1. Propagate activity to
nets/registers update_power
2. Calculate power using
PrimeTime timing data
report_power
Report Average Power
The default toggle rate is a relative value based on the reference clock. When
a design has clocks defined and if input transitions are provided relative to a
clock, PTPX assumes the specified clock is the related clock. Otherwise,
PTPX traces the port’s fan-out until it reaches a clocked element. When more
than one clock is found, PTPX uses the fastest of the related clocks. PTPX
also uses the fastest design clock when no related clock is found. It is
important to define the clock otherwise PTPX assumes a clock period of one
library time unit. PTPX uses a default toggle rate and static probability of 0.5,
which is extremely high. PTPX supports setting realistic values for these
parameters for higher accuracy of results.
Purpose Command
• Annotates a realistic default set power_default_toggle_rate 0.3
toggle rate value, for example,
0.3 to all the starting points.
Recommended to provide a
pessimistic value for power
compared to the gate level VCD.
Using a RTL VCD file can provide better power results compared to the
vector-free flow. This flow is depicted in Figure 6. PTPX reads the design data
and by using the vcd2saif utility derives switching activity (SAIF) automatically
from the VCD file. RTL VCD has partial design activity. PTPX annotates the
activity from RTL VCD, and, for unannotated nets, propagates the activity with
zero-delay simulation before calculating statistical average power.
Figure 6 shows the usage model for average power analysis with RTL VCD.
In this flow, activity is specified using the read_vcd command.
This example specifies RTL VCD activity rtl_vcd.dump for top instance
top_inst in a test bench tb.
Create a VCD file with $dumpvars in the testbench as shown in the following
example using the Synopsys VCS-MX simulator or other HDL simulators.
Ex: Test bench command to create RTL VCD
begin
$dumpfile “rtl_vcd.dump”
$dumpvars;
end
This example shows the simulation command for a verilog test bench tb.v and
RTL verilog rtl.v
By default, dumpvars outputs the activity for all the registers, wires and
variables in the netlist. It is important to capture register and IO activity for
accurate analysis.
PTPX supports commands to annotate internal and leakage power for IPs
(black boxes), legacy blocks and leaf cells.
Ex: set_annotated_power -internal_power 0.01 -leakage_power 0.001
cell_list
This example annotates the internal power of value 0.01 W and leakage
power of value 0.001 W for the cells in the cell list.
PTPX also supports SAIF, which is a compact ASCII file that you can create
directly from HDL simulation or by using the vcd2saif utility in UNIX provided
with PTPX. SAIF provides the toggle rate. PTPX reads the design data and
annotates the switching activity from SAIF. For unannotated nets, it
propagates the default activity with zero-delay simulation.
In this flow activity is specified using the read_saif command as shown
below. The -rtl_direct option is used to specify the RTL SAIF file.
This example specifies RTL SAIF activity rtl.saif for top instance top_inst in a
test bench tb.
The SAIF flow provides better results compared to the vector-free flow. The
update_power performs average power analysis while
create_power_waveforms generates average cycle waveforms and
report_power reports average power results similar to the vector-free flow.
This example shows the simulation command for a verilog test bench tb.v and
a verilog design (RTL/gate level) design.v.
The following example script shows how to use the Power Compiler-
generated map file in PTPX.
set power_enable_analysis true
set search_path ...
set_link_library ...
read_verilog <mapped_design.vs>
current_design <design>
link
source ptpx_map.tcl
read_vcd -strip_path <path to instance> <VCD file>
report_name_mapping
report_switching_activity
quit
PrimeTime PX provides the following commands that allow you to verify the
annotation:
• report_name_mapping
Returns the nets that were mapped.
• report_switching_activity
Returns the annotation sources. It also allows you to determine whether
the annotation of sequential elements and primary inputs is high enough
to ensure accurate analysis. Additional options for this command isolate
low activity nets and provide the toggle rate per block. Examining the
switching activity can help determine the quality of simulation vectors.
PTPX peak power analysis supports gate-level simulation activity over time in
the following VCD formats:
• Standard ASCII VCD
• Compressed VCD files such as binary VPD files generated by VCS or with
its PLI with vpd as suffix, binary FSDB files generated by Novas PLI with
fsdb as suffix, and compressed GZ or Z files with gz or z as suffix. PTPX
treats all other suffixes as ASCII VCD files.
PTPX analyzes extremely accurate power with respect to time using event
transition value and transition time; and generates detailed time-based power
waveforms based on the VCD resolution to provide both average and peak
power results.
Power analysis with VCD is the most detailed and accurate compared to all
other flows because VCD files from gate-level simulations contain detailed
switching activity. The VCD file has headers, nodes, and value change
sessions that provide detailed event-based accurate activity information.
PTPX supports processing VCD files that are greater than 2GB on all
platforms.
Figure 7 shows the usage for peak power analysis with gate-level VCD. In
this flow, activity is specified using the read_vcd command. PTPX also
supports piping the activity data directly from the HDL simulation.
Ex: read_vcd gate_vcd.dump –pipe_exec “exec_vcs_cmd” –strip_path
tb/top_inst
where “exec_vcs_cmd” is a file containing the simulation run script, say for
example, “VCS –R –I tb.v gate.v”.
While reading the VCD file, PTPX verifies that all the nets in the design are
identified in the VCD file. Peak power analysis is enabled by the
create_power_waveforms command. It calculates transition time and load
for every leaf pin, processes each single event in the simulation activity file,
and distributes the energy evenly for every event over the transition time for
inputs and over the path delay from related pin to output for outputs. The
power waveform and peak power are calculated from the superposition of the
distributed power thereby providing accurate peak power results. By default,
PTPX applies the VCD resolution for accurate peak power analysis; however,
if you are interested in cycle-based power, the create_power_waveforms
–interval <ns> option allows you to view the power for the specified interval.
The report_power command reports both peak power and average power
results.
The following table summarizes the type of power analysis done by PTPX
depending on the available activity.