Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
1© 2016 The MathWorks, Inc.
Optimization and Implementation of
Embedded Signal Processing Algorithms
Jonas Rutström
Senior Application Engineer
2
1. What’s your algorithm?
Two important questions in embedded design...
3
2. What’s your target?
Two important questions in embedded design...
4
Targets are very different...
5
DSP MCU SoC/FPGA
The embedded hardware might be very different...
6
Workflow | Idea to implementation
7
Workflow | Idea to implementation
Prototyping
8
Workflow | Idea to implementation
Prototyping
9
Workflow | Idea to implementation
Prototyping Production
10
Workflow | Idea to implementation
Prototyping Production
11
Workflow | Idea to implementation
Prototyping Production
Optimization
12
Let’s take a step back...
13
What do we mean with optimization?
14
Memory ReadabilitySpeed Target
15
Memory ReadabilitySpeed Target
16
Optimization at different phases in the development...
C SoC/FPGAPrototyping
17
Optimization at different phases in the development...
C SoC/FPGAPrototyping
18
Optimization at different phases in the development...
C SoC/FPGAPrototyping
19
Optimization at different phases in the development...
Prototyping
20
Profiling!
21
Profiling in MATLAB
tic/toc
% start timer
tic
% execute code
out = myFunction(in);
% stop timer (and store
% elapsed time)
et = toc;
profile
% turn on profiler
profile on
% execute code
out = myFunction(in);
% turn off profiler
profile off
% open html report
profile report
Where are the bottlenecks?How long did it take?
22
Profiling in MATLAB
23
Profiling in Simulink
24
Example(Profiling when prototyping in MATLAB)
25
Optimization at different phases in the development...
C SoC/FPGAPrototyping
26
Now, lets take a closer look of the
workflow in embedded design!
27
Example: Workflow for embedded design
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
28
Example: Workflow for embedded design
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
29
Key Detection Algorithm
30
System Design
Component Integration
Optimize
System Object
System Object(Reference Design)
ARM
FPGA
RF
31
Example: Workflow for embedded design
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
32
Example: Workflow for embedded design
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
33
Example: Workflow for embedded design
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
34
Example: Workflow for embedded design
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
35
Example: Workflow for embedded design
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
Simulink
36
DEMO(System Integration and Generating Code for ARM Cortex A9 from Simulink)
(Including verification with PIL)
37
System Design
Component Integration
Optimize
System Object
System Object(Reference Design)
ARM
FPGA
RF
38
A few words about Embedded Coder...
39
Embedded Coder Quick Start
40
DEMO(Embedded Coder Quick Start)
41
Another use case...
42
Example: Workflow for embedded design
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
MATLAB
43
Example(Generating Code ARM Cortex A9 from MATLAB)
44
System Design
Component Integration
Optimize
System Object
System Object(Reference Design)
ARM
FPGA
RF
45
Example: Workflow for embedded design
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
46
Example: Workflow for embedded design
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
Speed / Area Optimizations
47
Area Optimization for FPGA implementation
ARM
FPGA
48
Example(Area Optimization for FPGA Implementation)
49
System Design
Component Integration
Optimize
System Object
System Object(Reference Design)
ARM
FPGA
RF
50
Summary Optimization and Implementation of Embedded Signal Processing Algorithms
Reference Design
Constrained Design(E.g. Fixed-Point)
Target Specific Design
C(E.g. Fixed-Point)
Target Specific Design
SoC/FPGA(E.g. Fixed-Point)
51
Questions?