Embedded System and Matlab SIMULINK PDF
Embedded System and Matlab SIMULINK PDF
Embedded System and Matlab SIMULINK PDF
2
Agenda
3
The System Design Challenge
We design, simulate, and MATLAB® and Simulink®
validate system models and Algorithm and System Design
algorithms in MATLAB®
and/or Simulink®
4
Integrated Design Flow for
Embedded Software and Hardware
Design, simulate, and validate MATLAB® and Simulink®
system models and algorithms in Algorithm and System Design
MATLAB and Simulink
Real-Time Workshop Simulink HDL Coder
Automatically generate C and Embedded Coder, Link for ModelSim
HDL Targets, Links Link for Cadence Incisive
Generate
Generate
Verify hardware and software
implementations against the
Verify
Verify
system and algorithm models
C HDL
5
Agenda
6
Integrated Design Flow for
Embedded Software
Implementation with
automatic C code generation MATLAB® and Simulink®
Algorithm and System Design
Implementation Real-Time Workshop Simulink HDL Coder
– Floating- and fixed-point code Embedded Coder,
Targets, Links
Link for ModelSim
Link for Cadence Incisive
– Integration with downstream
IDEs and tools
Generate
Generate
– Links to verification
Verify
Verify
– Device drivers
– Optimization options
C HDL
7
Representative Application – Video
Video system design and implementation Embedded Software
– Encapsulates challenges: complexity, Case Study:
convergence, time-to-market Video Edge Detection
on a DSP
– Sophisticated algorithms
– Floating- and fixed-point issues
– DSP or FPGA/ASIC implementations
Design flows and steps shown directly
applicable to other signal processing
applications
Live
MATLAB
Demo
8
Example: Video Edge Detection
Floating point video edge detection system based on
Prewitt algorithm
Compositing original image with detected edges
Utilizes blocks from Video and Image Processing Blockset
9
Converting to Fixed-Point
Polymorphic blocks capable of floating- and fixed-point
operation
8-bit input datatype – blocks inherit fixed-point data
Simulink Accelerator provides fast fixed-point simulation
10
Automatic Code Generation
for Implementation on GPPs and DSPs
Code generation
options
and preferences
Fixed-point model
11
Code Generation Report
HTML report
13
Target Code Generation Options
Incorporate
DSP/BIOS
14
Code Execution on Target and Profiling
Build and execute
– Auto-generate C and ASM
System profiling
includes entire DSP Subsystem profiling
application code
15
Code Optimization Options
Utilize target-specific blocks
– C-callable assembler libraries
– Simulate bit-true in Simulink
– Generate calls to hand-optimized
assembler libraries
– Highly optimized implementation
of core functionality
– C62x and C64x fixed-point DSPs
16
Design Verification and Visualization:
MATLAB as software test bench
Captured
Input video
video
MATLAB script
(test bench) 17
Design Verification and Visualization:
Simulink as software test bench
Generate
Generate
Use code profiles to identify
and optimize bottlenecks
Verify
Verify
Verify code with Links to
IDEs and processors C HDL
19
Agenda
20
Integrated Design Flow for Hardware
(FPGA and ASIC)
Design elaboration MATLAB® and Simulink®
Algorithm and System Design
Generate
Generate
– test bench generation
– Links to verification
Verify
Verify
– Integration with
synthesis tools
C HDL
21
What We Will Show In This Case Study
Behavioral modeling and simulation Hardware Case Study:
Fixed-point modeling and simulation Video Edge Detection
Design elaboration on an FPGA
HDL generation
Co-simulation using Link for ModelSim
Live
MATLAB
Demo
22
Executable Specification
23
Design Elaboration
Automatically generate
Verilog or VHDL code from
elaborated models
24
HDL Code Generation Using GUI
25
More Code Generation Options
Set language-specific
options: input/output
datatypes, timescale
directives, …
26
Automatically Generate Test Bench
27
Co-simulate Generated HDL
Generate
Generate
and test benches
Verify
Verify
Verify code with Links to
RTL simulators and C HDL
synthesis tools
MCU DSP FPGA ASIC
29
Agenda
30
Summary
Accelerate development using MATLAB® and Simulink®
Model-Based Design Algorithm and System Design
– Generate
Real-Time Workshop Simulink HDL Coder
• Real-Time Workshop Embedded Coder, Link for ModelSim
Targets, Links Link for Cadence Incisive
• Simulink HDL Coder
– Verify
Generate
Generate
• Link for Cadence
Verify
Verify
Incisive
31