final year project - university of texas at dallasschaferb/darclab/... · final year project...
TRANSCRIPT
![Page 1: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/1.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/2.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/3.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/4.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/5.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/6.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/7.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/8.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/9.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/10.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/11.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/12.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/13.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/14.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/15.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/16.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/17.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/18.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/19.jpg)
Graphical User Interfacefor
Design Space Exploration
19
![Page 20: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/20.jpg)
20Part3: Graphical User Interface
![Page 21: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/21.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/22.jpg)
Functions of the developed GUI
• ComboBox
• Selecting files or options
22Part3: Graphical User Interface
![Page 23: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/23.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/24.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/25.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/26.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/27.jpg)
Plotting widget
27Part3: Graphical User Interface
![Page 28: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/28.jpg)
Plotting widget
• Zoom out and zoom in using mouse wheel
28Part3: Graphical User Interface
![Page 29: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/29.jpg)
Plotting widget functions
• Interactivity• Mouse clicking
29Part3: Graphical User Interface
mouse clicking
design folder
![Page 30: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/30.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/31.jpg)
Timer
• Elapsed time
• Remaining time
31Part3: Graphical User Interface
![Page 32: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/32.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/33.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/34.jpg)
Change Coordinate• Change to area versus throughput
34Part3: Graphical User Interface
change to
![Page 35: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/35.jpg)
Show optimal designs
• Click button
35Part3: Graphical User Interface
![Page 36: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/36.jpg)
Synthesis Results
• Three benchmarks
36Part4: Results
![Page 37: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/37.jpg)
Brute Force Results
37Part4: Results
fir qsort
adpcm_encoder
![Page 38: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/38.jpg)
Simulated Annealing Results
38Part4: Results
fir qsort
adpcm_encoder
![Page 39: Final Year Project - University of Texas at Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/39.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/40.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/41.jpg)
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 Dallasschaferb/darclab/... · Final Year Project High-level Synthesis Design Space Exploration Supervisor: Dr. Benjamin Carrion Schafer](https://reader033.vdocuments.net/reader033/viewer/2022060410/5f1056567e708231d4489c61/html5/thumbnails/42.jpg)
Q&A
42