Você está na página 1de 7

Gate-Level Budgeting Equations and Examples

Doc Id: 005976 Product: Design Compiler Last Modified: 07/09/2003




Question:
I have the following questions about gate-level budgeting:

- How does dc_allocate_budgets allocate slack to calculate path budgets for
gate-level budgeting?

- How are these budgets used to calculate input_delay and output_delay values?

- Will dc_allocate_budgets budget paths with positive slack differently than
paths with negative slack?

- How does dc_allocate_budgets treat glue logic?
Answer:
For gate-level budgeting, dc_allocate_budgets allocates slack to a path
by first calculating its total path delay (its actual delay based
on the existing netlist) and then calculating the path constraint. A path's
path constraint is the amount of time based on the clock period that the
path has before it exceeds the timing goal. If a path's total path delay
is less than its path constraint, the path has positive slack. If a path's
total path delay exceeds its path constraint, the path has negative slack.
The dc_allocate_budgets command uses a path's total path delay and path
constraint values to allocate slack (thus determining budget values) along
the path. From these budget values, dc_allocate_budgets calculates either an
input delay value or an output delay value for each of the ports on the blocks
being budgeted.

To demonstrate the details of this budgeting process, here is a simple example
that consists of a single Verilog file, all.v, containing a top module, top,
and two submodules, a and b. This example contains two paths, starting in a and
ending in b. One path has negative slack and one path has positive slack. Both
paths contain interblock logic, which is combinational logic that resides between
blocks being budgeted.

This example demonstrates three budgeting scenarios:

Default budgeting (dc_allocate_budgets)

Budgeting with interblock logic treated as fixed-delay
(dc_allocate_budgets -no_interblock_logic)

Budgeting where only positive slack is budgeted
(dc_allocate_budgets -positive_slack_only)



You can run this example by executing the run.dc script. Both all.v and
run.dc are included at the end of this article. The run.dc script produces
four report files:

tim.rpt - Timing report for both the negative-slack path and the
positive-slack path

default.rpt - Budget report for both the negative-slack path and the
positive-slack path after dc_allocate_budgets

no_interblock_logic.rpt - Budget report for both the negative-slack path
and the positive-slack path after dc_allocate_budgets -no_interblock_logic

positive_slack_only.rpt - Budget report for both the negative-slack path
and the positive-slack path after dc_allocate_budgets -positive_slack_only



The run.dc script also produces six constraint files, three for each block, when
the -write_script option of dc_allocate_budgets is used:

BlkA_default.tcl BlkB_default.tcl
BlkA_no_interblock_logic.tcl BlkB_no_interblock_logic.tcl
BlkA_positive_slack_only.tcl BlkB_positive_slack_only.tcl

To calculate values, use the following equations (both explicit and implied)
from the Budgeting for Synthesis User Guide.

total_path_delay = delay_from_clock_at_startpoint_flop_to_data_at_endpoint_flop - fixed_delay

path_constraint = clock_period + (clock_network_delay_at_endpoint_flop - \
clock_network_delay_at_startpoint_flop) - setup_time_at_endpoint_flop - \
fixed_delay

path_budget_for_a_block =
(path_delay_within_block / total_path_delay) * path_constraint

output_delay =
path_budget_external_to_block + fixed_delay + setup_at_endpoint_flop - \
clock_network_delay_at_endpoint_flop

input_delay =
clock_network_delay_at_startpoint_flop + path_budget_external_to_block + \
fixed_delay - transition_time_of_input_driver


The scenarios described below should solidify the meaning of most of these
terms. There are, however, two terms that warrant special mention: fixed_delay
and transition_time_of_input_driver.


fixed_delay - This term describes the delay of a cell that for a number of
reasons is unable to be budgeted. For example, a cell with either an explicit
or an implicit dont_touch attribute is considered fixed for budgeting. Also,
you will see that cells affected by the -no_interblock_logic option are also
considered fixed for budgeting. Cells that are fixed are designated with an F
in the report created by report_path_budgets. Cells that are not fixed are
designated with an A, indicating that they are automatically budgeted.


transition_time_of_input_driver - The transition time on a cell's
output is included in the cell's delay increment in the timing report
(the report_timing -transition_time option displays the transition time
component of a cell's delay increment). Transition time is based on
interconnect capacitance plus pin capacitance of the next stage. Since
the interconnect load and pin capacitances are expected to change when a
budgeted block is resynthesized, transition time is not known at the time
an input_delay value is calculated. Therefore dc_allocate_budgets must
subtract this transition time from the delay of the cell that drives an
input port on a budgeted block. This transition time is accounted for in
the budgeted constraint script by set_driving_cell on the input port.



DEFAULT SCENARIO (dc_allocate_budgets)

In the default.rpt file, see the Delay column in the budget report
for both the negative- and positive-slack paths. Verify these numbers
directly against those in the timing report (the tim.rpt file) for each path.
The budget report is organized in the same manner as the timing report
(arrival time followed by required time), so this should be straightforward.
Note the A designation in the Type column, indicating that both the negative-
slack path and the interblock logic have been budgeted.

Next, plug values into the above equations to validate the Budget column
for both the negative- and the positive-slack path in default.rpt. Further,
validate the BlkA output_delay values and the BlkB input_delay values
for both the positive- and the negative-slack paths.

Negative-slack path
total_path_delay = (1.4223 + 0.7223 + 0.7223) - 0 = 2.8669
path_constraint = 2.5000 + (1.6815 - 0.9129) - 0.8000 - 0 = 2.4686
block A budget (BlkA/ff1/Q) = (1.4223/2.8669) * 2.4686 = 1.2247
interblock budget (BlkB/in1) = (0.7223/2.8669) * 2.4686 = 0.6220
block B budget (BlkB/ff1/D) = (0.7223/2.8669) * 2.4686 = 0.6220
output_delay for A/out1 = (0.6220 + 0.6220) + 0 + 0.8000 - 1.6815 = 0.3625
input_delay for B/in1 = 0.9129 + (1.2247 + 0.6220) + 0 - 0.0523 = 2.7073

Positive-slack path
total_path_delay = (1.4223 + 0.7223) - 0 = 2.1446
path_constraint = 2.5000 + (1.6815 - 0.9129) - 0.8000 - 0 = 2.4686
block A budget (BlkA/ff2/Q) = (1.4223/2.1446) * 2.4686 = 1.6372
interblock budget (BlkB/in2) = (0.7223/2.1446) * 2.4686 = 0.8314
block B budget (BlkB/ff2/D) = (0/2.1446) * 1.7463 = 0
output_delay for A/out2 = 0.8314 + 0 + 0.8000 - 1.6815 =-0.0501
input_delay for B/in2 = 0.9129 + (1.6372 + 0.8314) + 0 - 0.0523 = 3.3292

As you can see, these budget calculations produce the same values as reported
in the Budget column for each of the two paths. Totaled, these budget values
equal the path constraint, which is the goal of budgeting. Further, these
output_delay calculations for BlkA yield the same values as those produced
by dc_allocate_budgets -write_script in BlkA_default.tcl. Similarly, the
calculations for BlkB input_delay values match those in BlkB_default.tcl.
Additionally, the max_delay timing report indicates the fall transition on
these ports (denoted by the f designation for BlkA/out1 and BlkA/out2
path delay increments in tim.rpt), so input_delay and output_delay
calculations are performed, here, only for the fall transition. Also,
note that negative values are possible for very short paths with positive
slack (as in the case of this simple example).

NO INTERBLOCK LOGIC SCENARIO (dc_allocate_budgets -no_interblock_logic)

In the no_interblock_logic.rpt file, note the F designation in the Type
column, indicating that the interblock logic (BlkB/in1, BlkB/in2) for both the
negative- and the positive-slack paths is considered fixed and has not been
budgeted.

Negative-slack path
total_path_delay = (1.4223 + 0.7233 + 0.7223) - 0.7233 = 2.1446
path_constraint = 2.5000 + (1.6815 - 0.9129) - 0.8000 - 0.7223 = 1.7463
block A budget (BlkA/ff1/Q) = (1.4223/2.1446) * 1.7463 = 1.1581
block B budget (BlkB/ff1/D) = (0.7223/2.1446) * 1.7463 = 0.5882
output_delay for A/out1 = 0.5882 + 0.7223 + 0.8000 - 1.6815 = 0.4290
input_delay for B/in1 = 0.9129 + 1.1581 + 0.7223 - 0.0523 = 2.7410

Positive-slack path
total_path_delay = (1.4223 + 0.7223) - 0.7223 = 1.4223
path_constraint = 2.5000 + (1.6815 - 0.9129) - 0.8000 - 0.7223 = 1.7463
block A budget (BlkA/ff2/Q) = (1.4223/1.4223) * 1.7463 = 1.7463
block B budget (BlkB/ff2/D) = (0/2.1446) * 1.7463 = 0
output_delay for A/out2 = 0 + 0.7223 + 0.8000 - 1.6815 =-0.1592
input_delay for B/in2 = 0.9129 + 1.7463 + 0.7223 - 0.0523 = 3.3292

As you can see, these budget calculations produce the same values as
reported in the Budget column for each of the paths. Note that for
the interblock logic path segments (BlkB/in1, BlkB/in2), the values
in the Budget column match those in the Delay column, confirming that
no budgeting was performed on the interblock logic (considered fixed).
Further, these output_delay calculations for BlkA yield the same values
as those produced by dc_allocate_budgets -write_script in
BlkA_no_interblock_logic.tcl. Similarly, these calculations for BlkB
input_delay values match those in BlkB_no_interblock_logic.tcl.


POSITIVE SLACK ONLY SCENARIO (dc_allocate_budgets -positive_slack_only)

In the positive_slack_only.rpt file, note the F designation in the Type column,
indicating that the negative-slack path (BlkA/ff1/Q, BlkB/in1) is considered
fixed and has not been budgeted.

Negative-slack path
(path is not budgeted so no budget calculations are performed)
output_delay for A/out1 = (0.7223 + 0.7223) + 0.8000 - 1.6815 = 0.5631
input_delay for B/in1 = 0.9129 + (1.4223 + 0.7223) - 0.0523 = 3.0052

Positive-slack path (same as default)
total_path_delay = (1.4223 + 0.7223) - 0 = 2.1446
path_constraint = 2.5000 + (1.6815 - 0.9129) - 0.8000 - 0 = 2.4686
block A budget (BlkA/ff2/Q) = (1.4223/2.1446) * 2.4686 = 1.6372
interblock budget (BlkB/in2) = (0.7223/2.1446) * 2.4686 = 0.8314
block B budget (BlkB/ff2/D) = (0/2.1446) * 1.7463 = 0
output_delay for A/out2 = 0.8314 + 0 + 0.8000 - 1.6815 =-0.0501
input_delay for B/in2 = 0.9129 + (1.6372 + 0.8314) + 0 - 0.0523 = 3.3292

As you can see, these budget calculations produce the same values as reported
in the Budget column for each of the paths. Note that for the negative-slack
path, the values in the Budget column match those in the Delay column,
confirming that no budgeting was performed on this path (all path segments are
considered fixed). Further, these output_delay calculations for BlkA yield
the same values as those produced by dc_allocate_budgets -write_script in
BlkA_positive_slack_only.tcl. Similarly, these calculations for BlkB
input_delay values match those in BlkB_positive_slack_only.tcl.

SCRIPTS

all.v
module a(in1,in2,clk,out1,out2);
input in1,in2,clk;
output out1,out2;
FD1 ff1 (.D(in1),.CP(clk),.Q(out1));
FD1 ff2 (.D(in2),.CP(clk),.Q(out2));
endmodule

module b(in1,in2,clk,out1,out2);
input in1,in2,clk;
output out1,out2;
IVDA U1 (.A(in1),.Z(int1));
IVDA U2 (.A(clk),.Z(clkint));
FD1 ff1 (.D(int1),.CP(clkint),.Q(out1));
FD1 ff2 (.D(in2),.CP(clkint),.Q(out2));
endmodule

module top(in1,in2,clk,out1,out2);
input in1,in2,clk;
output out1,out2;
IVDA U0 (.A(clk),.Z(clkint));
IVDA U1 (.A(int1),.Z(glue1));
IVDA U2 (.A(int2),.Z(glue2));
a BlkA (.in1(in1),.in2(in2),.clk(clkint),.out1(int1),.out2(int2));
b BlkB (.in1(glue1),.in2(glue2),.clk(clkint),.out1(out1),.out2(out2));
endmodule

run.dc
set target_library "lsi_10k.db"
set link_library "*"
set search_path ". $synopsys_root/libraries/syn"
set link_library [concat $link_library $target_library]

read_verilog {all.v}
current_design top
link
create_clock -p 2.5 clk
set_propagated_clock clk
set_input_delay 1 {in1 in2} -clock clk
set_output_delay 1 {out1 out2} -clock clk
check_timing
write_file -format db -hier -output all.db

echo " " > tim.rpt
echo "############################################" >> tim.rpt
echo "# Timing report for path with negative slack" >> tim.rpt
echo "# " >> tim.rpt
report_timing -from [get_pins "BlkA/ff1/CP"] -to [get_pins "BlkB/ff1/D"] -sig 4 >> tim.rpt

echo " " >> tim.rpt
echo "############################################" >> tim.rpt
echo "# Timing report for path with positive slack" >> tim.rpt
echo "# " >> tim.rpt
report_timing -trans -from [get_pins "BlkA/ff2/CP"] -to [get_pins "BlkB/ff2/D"] \
-sig 4 >> tim.rpt

dc_allocate_budgets -write_script -file_format_spec ./%C_default.tcl

echo " " > default.rpt
echo "############################################" >> default.rpt
echo "# dc_allocate_budgets " >> default.rpt
echo "# Budget report for path with negative slack" >> default.rpt
echo "# " >> default.rpt
report_path_budget -from [get_pins "BlkA/ff1/CP"] -to [get_pins "BlkB/ff1/D"] \
-sig 4 >> default.rpt

echo " " >> default.rpt
echo "############################################" >> default.rpt
echo "# dc_allocate_budgets " >> default.rpt
echo "# Budget report for path with positive slack" >> default.rpt
echo "# " >> default.rpt
report_path_budget -from [get_pins "BlkA/ff2/CP"] -to [get_pins "BlkB/ff2/D"] \
-sig 4 >> default.rpt

read_db all.db
dc_allocate_budgets -no_interblock_logic -write_script -file_format_spec \
./%C_no_interblock_logic.tcl

echo " " > no_interblock_logic.rpt
echo "############################################" >> no_interblock_logic.rpt
echo "# dc_allocate_budgets -no_interblock_logic " >> no_interblock_logic.rpt
echo "# Budget report for path with negative slack" >> no_interblock_logic.rpt
echo "# " >> no_interblock_logic.rpt
report_path_budget -from [get_pins "BlkA/ff1/CP"] -to [get_pins "BlkB/ff1/D"] \
-sig 4 >> no_interblock_logic.rpt

echo " " >> no_interblock_logic.rpt
echo "############################################" >> no_interblock_logic.rpt
echo "# dc_allocate_budgets -no_interblock_logic " >> no_interblock_logic.rpt
echo "# Budget report for path with positive slack" >> no_interblock_logic.rpt
echo "# " >> no_interblock_logic.rpt
report_path_budget -from [get_pins "BlkA/ff2/CP"] -to [get_pins "BlkB/ff2/D"] \
-sig 4 >> no_interblock_logic.rpt

read_db all.db
dc_allocate_budgets -positive_slack_only -write_script -file_format_spec \
./%C_positive_slack_only.tcl

echo " " > positive_slack_only.rpt
echo "############################################" >> positive_slack_only.rpt
echo "# dc_allocate_budgets -positive_slack_only " >> positive_slack_only.rpt
echo "# Budget report for path with negative slack" >> positive_slack_only.rpt
echo "# " >> positive_slack_only.rpt
report_path_budget -from [get_pins "BlkA/ff1/CP"] -to [get_pins "BlkB/ff1/D"] \
-sig 4 >> positive_slack_only.rpt

echo " " >> positive_slack_only.rpt
echo "############################################" >> positive_slack_only.rpt
echo "# dc_allocate_budgets -positive_slack_only " >> positive_slack_only.rpt
echo "# Budget report for path with positive slack" >> positive_slack_only.rpt
echo "# " >> positive_slack_only.rpt
report_path_budget -from [get_pins "BlkA/ff2/CP"] -to [get_pins "BlkB/ff2/D"] \
-sig 4 >> positive_slack_only.rpt

Você também pode gostar