Authors: Ankur Sharma, David Chinnery, Tiago Reimann, Sarvesh Bhardwaj, Chris Chu

Link to paper: https://dl.acm.org/doi/abs/10.1109/TCAD.2019.2915324


Define

  • = Target clock period
  • = Set of gates in the design
  • = Discrete set of cells for gate
  • = Current cell assigned to gate
  • = Leakage power of cell
  • = Maximum load capacity of cell
  • = Set of nodes in the timing graph
  • = Set of input pins of gates and output ports
  • = Set of output pins of gates and input ports
  • = Set of timing endpoints, i.e., data input pin of a sequential gate or an output port
  • Set of timing arcs in the timing graph
  • = Arrival time at node
  • = Gate or port associated with node
  • = Lagrangian multiplier for the timing arc
  • = Set of variables , and , e.g.,
  • Delay of the timing arc from node to node
  • = Slew at node
  • = Effective capacitance at node
  • = Maximum slew defined in the cell library

They use a similar primal problem as Fast and Exact Simultaneous Gate and Wire Sizing by Lagrangian Relaxation with the exception of the objective being to minimize leakage power instead of size:

Timing violations is quantified by total negative slack:

Then again like Chen et al., they take the Lagrangian relaxation of the primal:

Note that they do not relax the load and slew constraints; they claim these are easy to track. This leaves the first problem:

By Karush-Kuhn-Tucker optimality we get the following ideal values:

These are the same conditions as Chen et al., just with different notation. They refer to them as the flow constraints.

Remark: According to Wang et al., the KKT conditions are sufficient but not necessary.

The use to simplify into a new problem without the arrival times:

for . The sum is referred to as the lambda-delay sum. The objective of is called the LRS cost and it’s optimal value is denoted by .

Thus, the Langrangian Dual problem is given by

Remark: The term is from converting the optimal of back into by setting to the smallest possible value that satisfies , i.e., for all and for all . From this assumption, we get

Flow of the Algorithm

They make use of a five stage flow:

  1. Initialization
  2. Calibration of effective capacity
  3. LDP Solver for LR timing (solve )
  4. Calibration
  5. Greedy post-pass for greedy timing

The two calibration stages are done by passing the model to an external timer.

Initialization

  1. Set each gate to the size with the minimal leakage power
  2. Fix the maximum load and maximum slew violations.
    1. Scan design in reverse topological order, increase the size of gates that exceed the gate’s maximum load capacity.
    2. Scan design in forward topological order, increase the drive strength of any cells whose output slew is too high.

Calibration

Pass the current model to an external timer (Synopsys PrimeTime) and update our parameters. In the second stage, only the effective capacitance of each gate is updated. In the fourth stage, all timing parameters (including effective capacitance) are updated.

LDP Solver

The is solved in two-substages:

  1. LR timing recovery
  2. LR power recovery

Each of these substages follow the same design, which is iterative until the desired parameter converges or a cap of 200 iterations is reached:

  1. At step :
    1. Solve to find optimal and
    2. Perform static timing analysis
    3. Update Lagrangian multipliers

Algorithm 9 Solve LRS/λLRS/\lambda

Compute local negative slack around each gate

for each gate gg in forward topolical order do

min_cost:=min\_cost:=\infty

best_cell:=best\_cell:=current of gg

for each valid cell alternative xgx_g do

cost:=xg.leakage()+g.lambda_delay_sum(xg)cost:=x_g.leakage() + g.lambda\_delay\_sum(x_g)

delta_tns:=g.local_slack_check(xg)delta\_tns := g.local\_slack\_check(x_g)

if cost<min_costcost < min\_cost and delta_tns0delta\_tns\le0 then

min_cost:=costmin\_cost:=cost

best_cell:=xgbest\_cell:=x_g

end if

end for

Apply best_cellbest\_cell to gg and update timing locally

end for

The algorithm walks through the design greedily setting each gate’s cell to the one with the minimal cost that reduces the , where cost is given by the sum of the cell’s leakage and a rough approximation of the delay (scaled by ):

Here “local-arc” refers to fanin-arcs, gate-arcs, side-arcs and fanout-arcs in the area surrounding gate (see Figure below).

Timing Models and Calibration Mechanism

They use a “simple” RC model to estimate the effective capcitance as well as delays and slews for gates and interconnects. They’re RC model is calibrated in stages two and four with Synopsys Primetime.

Given a design, a net or interconnect is an RC tree composed of taps and wire segments connecting two adjacent taps. Each tap has a corresponding capacitance and a subtree rooted at . Wire segments connecting the parent of tap , , to to tap has a upstream resistance give by . The sum of all the resistances on the path connecting the root of the to tap is denoted by .

For estimating effective capacitance of a net , they use

where is a net-specific parameter and is the drive resistance (computed via lookup table) of the arc that drives net . By default , during calibration is updated so that matches the result from Synopsys PrimeTime. Before calibration, had an average error of , but a large standard deviation of and maximum error of .

They estimate slew by

where

  • is the slew at the root of the net
  • is the Elmore delay from the root of the RC tree to tap
  • is the slew correction factor which initially is set to .

Elmore delay is given by the path from the root to tap :

where and are the upstream resistance and downstream capacitance at tap . They modify the Elmore delay by scaling it by a delay correction factor . is initially set to 1 and updated during calibration so that matches the result from PrimeTime.

Gate slew and gate delay are given by a lookup table then scaled by a slew correction factor and delay correction factor, respectively.

The calibration algorithm essentially boils down to three steps:

  1. Generate a verilog file for the design
  2. Run Synopsys PrimeTime
  3. Update various parameters so that our estimations match PrimeTime’s output

This is clearly the slowest part of their algorithm. On average, the calibration steps take of the runtime with a high of of the runtime.

Multi-Threaded LRS Solver

They speedup solving by using parallel computing. The idea is, that multiple gates can be sized simultaneously, but not any two gates can be resized at the same time.

In order for two or more gates to be resized simultaneously, they must satisfy two properties:

  1. None of them have a fan-in arc in common; and
  2. None of them lie in each other’s fan-out cone.

They first ensure property 1 is satisfied with an algorithm they call mutual exclusion edges (MEE):

Algorithm 10 MEE assignment

// Stage 1: Assign random IDs

max_id:=0max\_id:=0

for each level l=0l=0 to maximum topological level do

x:=max_idx:=max\_id

for each gate gg in level ll do

g.id:=xg.id:=x

while g.idg.id is not unique do

g.id:=x+rand()g.id := x + rand()

end while

if g.id>max_idg.id > max\_id then

max_id:=g.idmax\_id:=g.id

end if

end for

end for

// Stage 2: MEE assignment

for each gate gg in the design do

s:=s:= fan-outs of gg sorted by ascending IDs

for each i=0i=0 to s.size()2s.size()-2 do

Assign MEE from s[i]s[i] to s[i+1]s[i+1]

end for

end for

The MEE edges are essentially “dummy edges” to form a chain of fan-outs for every gate. For , they refer to as the pseudo fan-in of and as the pseudo fan-out of . An example is given in the Figure below; the dashed lines show the fanouts of () and () are connected by MEE edges. In this case, and cannot be resized simultaneously as they share a fan-in from . Likewise, and share a fan-in from . Finally and share a fan-in from . The MEEs enforce a sequential order for resizing fan-outs.

They ensure property 2 is satisfied with a DAG based netlist traversal:

  • For each gate, let be the number of fan-ins and pseudo fan-ins of that gate that are yet to be resized.
    • Initialize variable to total number of fan-ins and pseudo fan-ins.
  • After a gate is resized, the variable for all its fan-outs and pseudo fan-outs is decremented by 1.
  • Any gate whose is ready to be resized.