42
Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer Student: LU Shanqi 13116151D 1

Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Final Year Project

High-level Synthesis Design Space Exploration

Supervisor: Dr. Benjamin Carrion Schafer

Student: LU Shanqi 13116151D

1

Page 2: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Content

• Part1: Introduction– High-level Synthesis

• Part2: Methodology– Tool CyberWorkBench– Algorithm

• Part3: Graphical User Interface– Functions– Plotting widget

• Part4: Results– Comparison between brute force and simulated

annealing

2

Page 3: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

High-level Synthesis

• A process of converting behavior descriptions to hardware implementation

• From SystemC to hardware

• Tools: CyberWorkBench, Xilinx Vivado….

3Prart1: Introduction

Page 4: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Higher Abstract Level

• Advantages

– shorter marketing cycle

– Increasing reusability of programming codes

• Disadvantages

– Numerous synthesis options are available, hence hard to find optimal designs

4Prart1: Introduction

Page 5: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Design Space Exploration• An exploration process aiming to find optimal designs

among uncountable candidates in high level synthesis

• Multi-objective optimization problemArea

Latency

design0

design1

design3

design2

design5

design6

design4

design4pareto-optimal frontier

5Prart1: Introduction

• One design pareto dominate another.

• One design is not inferior to another design in all objectives, additionally, there is at least one better objective.

Page 6: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Objectives of this project

• To automate the process of design space exploration

• To develop a heuristic to accelerate design space exploration

• To develop a graphical user interface(GUI) to plot results dynamically

6Prart1: Introduction

Page 7: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Tool: CyberWorkBench

• Parse description language(e.g. SystemC)

– Special pragmas can be recognized by parser

• Generate constraint files(e.g. Functional Units constraint file)

• Synthesize

– Results are store in a *.CSV file

7Prart2: Methodology

Page 8: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Tool: CyberWorkBench• Pragma insertion

• Key word: Cyber

• Change high-level synthesis options(also called attributes) by inserting such kind of pragmas

8Prart2: Methodology

Page 9: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Tool: CyberWorkBench

array

RAM

REG

ROM

for loop

unroll all

unroll 2

unroll 0

function

inline

goto

variable x1

variable x2

variable x3

values

values

values

9Prart2: Methodology

Page 10: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Problem clarification

• Treat high-level synthesis process as a black box function

• Multiple input variables: x1,x2,x3…..

• Two objectives: area, latency

• Find more pareto optimal designs in shorter time

𝐴𝑟𝑒𝑎, 𝑙𝑎𝑡𝑒𝑛𝑐𝑦) = 𝑓(𝑥1, 𝑥2, 𝑥3. . . . .

10Prart2: Methodology

Page 11: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Problem clarification

array=RAM loop=unroll all function=inline

array=RAM loop=unroll all function=goto

design1

design2

𝐴𝑟𝑒𝑎, 𝑙𝑎𝑡𝑒𝑛𝑐𝑦) = 𝑓(𝑥1, 𝑥2, 𝑥3…

x1 x2 x3

high-level synthesis process

Area

Latency

design0

design1

design3

design2

design5

design6

design4

design4pareto-optimal frontier

synthesis resultsdesign curve

11Prart2: Methodology

Page 12: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Program structure

12

Input C file

Examining and inserting pragmas

Generating a header file which defines preprocessor macros

Synthesizing

displaying results dynamically

Showing final results including optimal designs and time information

generating a new design

Prart2: Methodology

Page 13: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Algorithms

• Brute Force(exhaustion method)

– a generate-and-test algorithm to check all possible candidates that satisfy specification of a problem

• Simulated Annealing

– probabilistic heuristic

– other heuristics(e.g. genetic algorithm)

13Prart2: Methodology

Page 14: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Simulated Annealing• Step1: Generate a initial design randomly as the base

design and synthesize it. Synthesized result is used tocalculate first GCF as base state of system. Set an initialtemperature for the system.

𝐺𝐶𝐹 = 𝜕𝐴 + 𝛽𝐿

array=RAM loop=unroll all function=inlinedesign1 …

• Global cost function is defined as:

14Prart2: Methodology

Page 15: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Simulated Annealing• Step 2: Generate a new design from base design by

randomly modifying one attribute's value.

𝑃 = 𝑒−𝛥𝐺𝐶𝐹𝑘

array=RAM loop=unroll all function=inline

x1 x2 x3

• Step3: Compare new GCF and previous GCF. Then,determine whether to accept the new design. Probability toaccept a worse design:

array=RAM loop=unroll 0 function=inline …

change

Initial design

new design

15Prart2: Methodology

Page 16: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Simulated Annealing

• Step4: If 5 better designs are consecutivelygenerated, reduce current temperature by10%. Change parameters in GCF for every 8designs.

• If no exit condition is met, iterate from step2to step 4. Exit iteration if one exit conditionis met.

16Prart2: Methodology

Page 17: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Simulated Annealing

• Exit conditions:

i. Current temperature is less than threshold.

ii. Consecutively, more than 5 new designs areworse than previous design.

iii. Cannot generate new designs by changing oneof the attributes.

iv. Synthesized designs are more than 70% of alldesigns.

17Prart2: Methodology

Page 18: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Simulated Annealing

• Why SA?

• Some input sequence might lead to a good result. e.g.

𝐴𝑟𝑒𝑎, 𝑙𝑎𝑡𝑒𝑛𝑐𝑦) = 𝑓(𝑥1, 𝑥2, 𝑥3. . . . .

small area and small latency

• Change one attribute at a time while maintaining other attribute combinations

array=RAM loop=unroll all

18Prart2: Methodology

Page 19: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Graphical User Interfacefor

Design Space Exploration

19

Page 20: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

20Part3: Graphical User Interface

Page 21: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Qt Framework

• A cross-platform framework for developing applications

• Signals and Slots: Communication mechanism between different parts of the program

• QCustomPlot: An online open source widget for plotting

• Multithread programming: To prevent GUI freezing

• Model/View Programming: To modify data outside current program(used in file list)

21Part3: Graphical User Interface

Page 22: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Functions of the developed GUI

• ComboBox

• Selecting files or options

22Part3: Graphical User Interface

Page 23: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Functions of the developed GUI

• Selecting other benchmarks

• Selecting other libraries

• Filtering out files with wrong extensions

23Part3: Graphical User Interface

Page 24: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Functions of the developed GUI

• Automatic attribute insertion

• To examine input SystemC file and insert pragma automatically based on syntax.

24Part3: Graphical User Interface

Page 25: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Functions of the developed GUI

• To show selection information such as which technologylibrary has been selected.

• To Show design information dynamically while running,like that total number of designs, current number ofdesigns and synthesis results.

25Part3: Graphical User Interface

file information

design information

Page 26: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Functions of the developed GUI

• Embedded editor • To edit synthesis command• Standard shortcuts for editor like copy, cut and

paste can work

26Part3: Graphical User Interface

Page 27: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Plotting widget

27Part3: Graphical User Interface

Page 28: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Plotting widget

• Zoom out and zoom in using mouse wheel

28Part3: Graphical User Interface

Page 29: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Plotting widget functions

• Interactivity• Mouse clicking

29Part3: Graphical User Interface

mouse clicking

design folder

Page 30: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Plotting widget functions• File list

30Part3: Graphical User Interface

attribute combination

“sa” stands for simulated annealing

Page 31: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Timer

• Elapsed time

• Remaining time

31Part3: Graphical User Interface

Page 32: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Progress Bar

• To show progress

• Relatively accurate for brute force

• Not useful if simulated annealing method is used

32Part3: Graphical User Interface

Page 33: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Conflict handling• Conflicts between widgets in program sometimes

appear and render program's crashing

• Mechanisms to check conflicts and pop up warning messages

33

Page 34: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Change Coordinate• Change to area versus throughput

34Part3: Graphical User Interface

change to

Page 35: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Show optimal designs

• Click button

35Part3: Graphical User Interface

Page 36: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Synthesis Results

• Three benchmarks

36Part4: Results

Page 37: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Brute Force Results

37Part4: Results

fir qsort

adpcm_encoder

Page 38: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Simulated Annealing Results

38Part4: Results

fir qsort

adpcm_encoder

Page 39: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Comparison

• Time Comparison• Averagely, running time of simulated annealing

algorithm for these three benchmarks is 21.8 percent of brute force algorithm, which means SA algorithm’s speed is 4.59 times of BF algorithm’s speed.

39Part4: Results

Page 40: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Comparison

• Qualitative comparison• In these experiments, brute force method has gone through all

designs. Therefore, pareto dominance for brute force is 100% • It has been found that simulated annealing could find 66%

pareto dominated points.

40Part4: Results

Page 41: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Conclusion

Achievements

• This project has completed the main goals. It has developed one heuristic (simulated annealing) for design space exploration that achieved around four times faster speed than brute force method.

• A graphical user interface that could display synthesis results dynamically was developed .

Limitations and future works

• Other heuristics can be developed and compared to simulated annealing

• Number of tested benchmarks is not enough

• Automatic attribute insertion could only support special language formats

Part4: Results 41

Page 42: Final Year Project - University of Texas at Dallasbxc162630/darclab/... · Final Year Project High-level Synthesis Design Space Exploration ... Showing final results including optimal

Q&A

42