Top Banner
1 © 2013 The MathWorks, Inc. Design and Verify Embedded Signal Processing Systems Using MATLAB and Simulink Giorgia Zucchelli, Application Engineer, MathWorks 10 January 2013, Technical University Eindhoven
29

Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

Feb 07, 2018

Download

Documents

ĐăngDũng
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

1 © 2013 The MathWorks, Inc.

Design and Verify

Embedded Signal Processing Systems

Using MATLAB and Simulink

Giorgia Zucchelli, Application Engineer, MathWorks

10 January 2013, Technical University Eindhoven

Page 2: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

2

Agenda

Introduction to Model Based Design

Application example: Parametric Audio Equalizer

– Targeting a fixed-point embedded processor

Workflow overview

Conclusions

Page 3: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

3

INTRODUCTION

Page 4: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

4

What is Model Based Design?

Methodology to design complex systems

– Using models and simulation

– Using tools for automation

Page 5: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

5

Why using Model Based Design?

Find errors early

Reduce costly prototypes

Increase productivity

Page 6: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

6

1. Focus on algorithmic design

2. Anticipate implementation

3. Verification test-benches

MathWorks model-based design

speeds up the development process

INTEGRATION

IMPLEMENTATION

TE

ST

& V

ER

IFIC

AT

ION

DESIGN

RESEARCH REQUIREMENTS

Page 7: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

7

Improve team communication with

multi-domain executable specifications

Many trusted functions

Use the most suitable

modeling approach

INTEGRATION

IMPLEMENTATION

DESIGN

TE

ST

& V

ER

IFIC

AT

ION

RESEARCH REQUIREMENTS

Algorithms

Page 8: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

8

Achieve early verification with refined models

anticipating real impairments

Bit-true simulation

Multi-domain physical

models

INTEGRATION

IMPLEMENTATION

DESIGN

TE

ST

& V

ER

IFIC

AT

ION

RESEARCH REQUIREMENTS

Fixed-Point

Physical Models

Algorithms

Analog Digital

Page 9: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

9

Rapid prototyping with code generation:

less debugging, better design

C / C++

Synthesizable HDL

INTEGRATION

IMPLEMENTATION

DESIGN

TE

ST

& V

ER

IFIC

AT

ION

RESEARCH REQUIREMENTS

Fixed-Point

Physical Models

Algorithms

Analog Digital

FPGA ASIC

VHDL, Verilog

MCU DSP

C, C++

Processors

Page 10: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

10

One testbench fits all:

unambiguous verification of the specs

INTEGRATION

IMPLEMENTATION

DESIGN

TE

ST

& V

ER

IFIC

AT

ION

RESEARCH REQUIREMENTS

Fixed-Point

Physical Models

Algorithms

Analog Digital System-level test

Co-simulation

“Hardware in the loop”

verification

FPGA ASIC

VHDL, Verilog

MCU DSP

C, C++

Processors

Page 11: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

11

APPLICATION EXAMPLE

Page 12: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

12

Demo: Parametric Audio Equalizer Digital filters used to adjust the frequency content of an audio signal

Parametric response that can be run-time controlled

Three band equalizer

– Low Band: 60 to 1500 Hz

– Mid Range: 1200 to 4800 Hz

– High Range: 4800 to 12 kHz

– Amplitude range: -8 to +8 dB

Page 13: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

13

TEXAS INSTRUMENTS

DM6437 EVM

Page 14: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

14

Target #1: TI DM6437 EVM

CAN/Serial Ethernet USB

JTAG

Processor

PCI

Video

Audio

PMU

Page 15: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

15

DM6437 EVM - Processor

Highest-performance fixed-point DSP

generation in the TMS320C6000™ DSP

platform

Very-long-instruction-word (VLIW)

architecture developed by Texas

Instruments (TI)

Some of the specs:

– 2.5-, 2-, 1.67, 1.51-, 1.43-ns Instruction Cycle

Time

– 400-, 500-, 600-, 660-, 700-MHz C64x+™

Clock Rate

– Eight 32-Bit C64x+ Instructions/Cycle

– 3200, 4000, 4800, 5280, 5600 MIPS

Page 16: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

16

DM6437 – Software stack

Page 17: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

17

WORKFLOW OVERVIEW

Page 18: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

18

Simulink - Host

PC-Based Audio Prototyping

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Fixed-Point

MCU DSP

C, C++

Processors

Algorithms

TE

ST

& V

ER

IFIC

AT

ION

Simulink / MATLAB

Data

source

Data

analysis

Page 19: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

19

Simulink - Host

Fixed-Point Modeling

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Fixed-Point

MCU DSP

C, C++

Processors

Algorithms

TE

ST

& V

ER

IFIC

AT

ION

Fixed-Point

Simulink / MATLAB

Data

source

Data

analysis

Page 20: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

20

Simulink - Host

C Code Verification

C code

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Fixed-Point

MCU DSP

C, C++

Processors

Algorithms

TE

ST

& V

ER

IFIC

AT

ION

Black Box

S-function

Data

analysis

Data

source

Page 21: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

21

Simulink - Host

Automatic C Code Generation

Embedded

C

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Fixed-Point

MCU DSP

C, C++

Processors

Algorithms

TE

ST

& V

ER

IFIC

AT

ION

Fixed-Point

Simulink / MATLAB

Data

analysis

Data

source

Page 22: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

22

Data

analysis

Data

source

Simulink - Host

Processor-in-the-Loop

?

Target

Embedded

C

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Fixed-Point

MCU DSP

C, C++

Processors

Algorithms

TE

ST

& V

ER

IFIC

AT

ION

Simulink / MATLAB

? ?

Page 23: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

23

Simulink - Host

On-Target Rapid Prototyping

?

Target

DA

C

Embedded

C AD

C

INTEGRATION

IMPLEMENTATION

DESIGN

REQUIREMENTS

Fixed-Point

MCU DSP

C, C++

Processors

Algorithms

TE

ST

& V

ER

IFIC

AT

ION

Simulink / MATLAB

Data

analysis

Data

source

Page 24: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

24

Fixed-point design: motivation

ASIC/FPGA or fixed-point DSP implementation

Saves power and/or cost

Word length and fraction length must be specified

sign + integer fractional

L

L-N N

Page 25: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

25

Fixed-point design: challenges

It introduces degradation that must be assessed

– Quantization error

– Overflow / Underflow

All variables must be converted including internals: this

is error prone and often uninspiring

sign + integer fractional

L

L-N N

Quantization overflow

Page 26: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

26

Fixed-point data type in MATLAB / Simulink

A_fp = fi(A, 1, 32, 10)

sign + integer fractional

L

L-N N

Quantization overflow

Page 27: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

27

CONCLUSIONS

Page 28: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

28

Quickly Iterate between Idea and Prototype

First prototype is functionally correct with automatic C

code generation

Spend your time in optimizing rather than debugging the

code

Find errors reusing the same testbench at each design

step

Page 29: Design and Verify Embedded Signal Processing Systems Using ...heco/courses/EmbeddedComputerArchitecture/Des… · Embedded Signal Processing Systems Using MATLAB and Simulink ...

29