CMPE222 Project Synthesis Optimization

38
CMPE222 Project Synthesis Optimization ------ analysis of DC & DW Zhenrong Wang , Mingcui Zhou @EE Instructor: Prof. Wakefield

description

CMPE222 Project Synthesis Optimization. ------ analysis of DC & DW Zhenrong Wang , Mingcui Zhou @EE Instructor: Prof. Wakefield. Outline. Preparation for Synthesis: source code HDL level Optimization Optimization using Design_analyzer constraints & DesignWare - PowerPoint PPT Presentation

Transcript of CMPE222 Project Synthesis Optimization

Page 1: CMPE222 Project Synthesis Optimization

CMPE222 Project

Synthesis Optimization------ analysis of DC & DW

Zhenrong Wang , Mingcui Zhou @EEInstructor: Prof. Wakefield

Page 2: CMPE222 Project Synthesis Optimization

2

OutlineOutline

• Preparation for Synthesis: source code

• HDL level Optimization

• Optimization using Design_analyzer constraints & DesignWare

• Depth study of Synthesis Optimization

----look into DesignWare *

• Build your own synthesis Library (Optional)

Page 3: CMPE222 Project Synthesis Optimization

3

(I) HDL Level Optimization

Using FIR 3 Tap • 3 latency version: combine status

(wait, load) and (shift, output)• Simulator: Modelsim 5.5 SEb

Page 4: CMPE222 Project Synthesis Optimization

4

Output verification

• 2 latency version : wait and combine all the calcuation sta

tes into one

Page 5: CMPE222 Project Synthesis Optimization

5

HDL level Optimization

• Compare compiling results:

Power Area Delay Total

2latency 6.96768 80242 9.6 5.367

3latency 9.89287 78825 9.61 7.493

Page 6: CMPE222 Project Synthesis Optimization

6

Reason for difference

• Less status for less Power

• More combined calculation hinder reuse of adders and multipliers

Page 7: CMPE222 Project Synthesis Optimization

7

Conclusion for HDL Optimization

Conciseness may not be the best

but it’s good approach!

Page 8: CMPE222 Project Synthesis Optimization

8

(II) Adding Constraints

Page 9: CMPE222 Project Synthesis Optimization

9

Wishing for the best result?

If constraints

( Max area == 0 && Max delay == 0

&& Power ==0 )

Compiling time = hours long;

Result = WORSE;

Page 10: CMPE222 Project Synthesis Optimization

10

Understand how it works

Page 11: CMPE222 Project Synthesis Optimization

11

Foundation Library

Design Library (.syn, etc)

contains the circuit descriptions that are immediately usable by the Synopsys tools.

Synthetic Library (.sldb)

links the circuits in a design library to the Synopsys Synthesis tools

/projects/cadlab/synopsys/2001.08/dw

/dw0*/lib Design library

/projects/cadalb/synopsys/2001.08

/libraries/syn Synthetic Library

Page 12: CMPE222 Project Synthesis Optimization

12

Default Synthesis Library

• standard.sldb• List name of default:

“Synthetic Operator”

“Synthetic Model”

“Implementations”

“binding relationship of each level”

Page 13: CMPE222 Project Synthesis Optimization

13

Synthetic Library Structure

Page 14: CMPE222 Project Synthesis Optimization

14

The standard.sldb of synopsys

• See what contains in the synopsys default synthesis library (different to users with different license)

• > cd /projects/cadlab/synopsys/2001.08

/library/syn/• >Source your_synopsys.rc• >dc_shell //enter dc_shell• dc_shell> report_synlib standard.sldb

Page 15: CMPE222 Project Synthesis Optimization

15

Contents of .sldb

• Synthetic operator type ADD_TC_CI_OP add ADD_TC_OP add Synthetic model desciprtion DW01_add design_library: DW01 HDL parameter: width =...• Synthetic model Implimentation DW02_mult sim v csa leg =

"(A_width>=1) &

Page 16: CMPE222 Project Synthesis Optimization

16

Examples of tracing component

Page 17: CMPE222 Project Synthesis Optimization

17

Bounding of each level• Synthetic Model• DW02_mult …• b2 bound_operator: MULT_UNS_OP • Pin Associations (module, oper):• A, A• B, B• … …• ---------------------------------------------------------------------------• Module Implementations Attributes/Parameters• --------------------------------------------------------------------------• • DW02_mult sim v csa leg = "(A_width>=1) &&…

Page 18: CMPE222 Project Synthesis Optimization

How constraints works?

Page 19: CMPE222 Project Synthesis Optimization

19

Implementation Selection

Page 20: CMPE222 Project Synthesis Optimization

20

How to optimize

• To characterize the implementations for comparison, the synthesis tool creates a pre-optimized model for each one, in the user’s target technology. The timing and area characteristics of the models serve as the basis for implementation selection.

Page 21: CMPE222 Project Synthesis Optimization

21

Content of technology .db

• Main parts

• Area

• time

• cell(OR2I) {• area : 2;• cell_footprint : "or2";• pin(A) {• direction : input;• capacitance : 1;• } … …• {• intrinsic_rise : 0.18;• intrinsic_fall : 0.65;• rise_resistance : 0.223;• fall_resistance : 0.0083;•

Page 22: CMPE222 Project Synthesis Optimization

What if we choose both: max area==0&&delay==0

Page 23: CMPE222 Project Synthesis Optimization

Tools optimize timing first by default!

Page 24: CMPE222 Project Synthesis Optimization

24

One constraint Each time(1)

2-latency version Typical db

Dynamic Power

Cell Area Arrival Time

Total

Default 6.9676 80242 9.6 5.367

Area 7.0365 80708 9.61 5.457

Timing 7.603 86439 9.61 6.315

Fanout 6.9093 78333 9.6 5.195

Page 25: CMPE222 Project Synthesis Optimization

25

One constraint each time (2)

3-latency version Typical db

Dynamic Power

Cell Area Arrival Time

Total

Default 9.8928 78825 9.61 7.493

Area 9.4758 73453 9.61 6.688

Timing 9.4939 77421 9.56 7.268

Fanout 9.4045 77548 9.62 7.015

Page 26: CMPE222 Project Synthesis Optimization

26

Tips

• Area constraint has the more impact on the optimization compared to others

• High-level behavioral optimization reduces the area, power a lot.

• Fanout constraint reduce the timing but increase the dynamic power

• Default optimization is, in common case, good enough for timing optimization

Page 27: CMPE222 Project Synthesis Optimization

27

III DesignWare

Best case for non-DW

& DW

Dynamic Power

Cell Area

Arrival Time

Total

DW 6.78 60933 9.6 3.966

Non-DW 9.4758 73453 9.61 6.688

Page 28: CMPE222 Project Synthesis Optimization

28

Advantages of using DW

• It offers many different design descriptions (implementations) for a given function;

• users let the synthesis tools choose which implementation to use in any given context.

Page 29: CMPE222 Project Synthesis Optimization

29

See datasheet of DW

Page 30: CMPE222 Project Synthesis Optimization

30

Check information in datasheet

• symbols• Ports description• Parameter• Implimentations …

Page 31: CMPE222 Project Synthesis Optimization

31

Setup environment for DW

• you must set two dc_shell variables: synthetic_library and link_library.

• Add in .synopsys_dc.setup

“ … synthetic_library = dw01.sldb dw02.sldb;

link_library = { typical.db dw01.sldb dw02…}

Page 32: CMPE222 Project Synthesis Optimization

32

How are DesignWare Foundation Components Used?

• Component instantiation:

• Operator Inferencing

Page 33: CMPE222 Project Synthesis Optimization

33

Instantiate Example

// Instantiating DW02_multp in Verilog

• module adder(a, b, tc, out);

• parameter wordlength = 24;

• input [wordlength-1:0] a, b;

• … …

// instantiate DW01_addDW02_multp #(wordlength)U1(a,b,tc,out);

endmodule

Page 34: CMPE222 Project Synthesis Optimization

34

example

Page 35: CMPE222 Project Synthesis Optimization

35

Results after Instantiating

Using DW_multp/wall DesignWare db(3 latency)

Dynamic Power

Cell Area Arrival time

Total

Default 2.9248 54882 9.58 1.537

Area 2.9062 49729 9.55 1.38

Timing 2.9274 54353 9.42 1.498

Fanout 2.9319 55208 9.50 1.537

Page 36: CMPE222 Project Synthesis Optimization

36

Set model/implementation

always @(in1 or in2) begin :b1

/* synopsys resource r0:

map_to_module = ”DW01_add”,

implementation = ”cla”,

ops = ”a1”; */

sum <= in1 + in2; //synopsys label a1

Page 37: CMPE222 Project Synthesis Optimization

37

Disabling Selected Synthetic Modules and Implementations

• Tools use the first one if there’s models with same names

• Disable using models in synthetic lib:

set_dont_use standard.sldb/DW01_addsub

Page 38: CMPE222 Project Synthesis Optimization

38

Developing Synthetic Library