+ All Categories
Home > Documents > Intro to FPGA Design Using MATLAB and Simulink Published

Intro to FPGA Design Using MATLAB and Simulink Published

Date post: 21-Apr-2015
Category:
Upload: electrocarbon
View: 189 times
Download: 13 times
Share this document with a friend
31
1 © 2011 The MathWorks, Inc. Introduction to FPGA Design Using MATLAB and Simulink Eric Cigan MathWorks Jordon Inkeles Altera
Transcript
Page 1: Intro to FPGA Design Using MATLAB and Simulink Published

1 © 2011 The MathWorks, Inc.

Introduction to FPGA Design

Using MATLAB and Simulink

Eric Cigan – MathWorks

Jordon Inkeles – Altera

Page 2: Intro to FPGA Design Using MATLAB and Simulink Published

2

FPGA Designer System Designer

Algorithm Design

Fixed-Point

Timing and Control Logic

Architecture Exploration

Algorithms / IP

System Test Bench

Environment Models

Algorithms / IP

Analog Models

Digital Models

RTL Design

IP Interfaces

Hardware Architecture

Verification

Functional Simulation

Static Timing Analysis

Timing Simulation

Behavioral Simulation

Back Annotation Implement Design

Map

Place & Route

Synthesis

FPGA Hardware

FPGA Requirements

Hardware Specification

Test Stimulus

Separate Views of FPGA Design

Page 3: Intro to FPGA Design Using MATLAB and Simulink Published

3

MATLAB® and Simulink®

System and Algorithm Design

Model-Based Design for FPGAs

Algorithm Design

Fixed-Point

Timing and Control Logic

Architecture Exploration

Algorithms / IP

System Test Bench

Environment Models

Algorithms / IP

Analog Models

Digital Models

RTL Design

IP Interfaces

Hardware Architecture

Verification

Functional Simulation

Static Timing Analysis

Timing Simulation

Behavioral Simulation

Back Annotation Implement Design

Map

Place & Route

Synthesis

FPGA Hardware

FPGA Requirements

Hardware Specification

Test Stimulus

Page 4: Intro to FPGA Design Using MATLAB and Simulink Published

4

MATLAB® and Simulink®

Algorithm and System Design

Model-Based Design for FPGAs

RTL Design

IP Interfaces

Hardware Architecture

Verification

Functional Simulation

Static Timing Analysis

Timing Simulation

Behavioral Simulation

Back Annotation Implement Design

Map

Place & Route

Synthesis

FPGA Hardware

Automatic HDL

Code Generation

RTL

Page 5: Intro to FPGA Design Using MATLAB and Simulink Published

5

MATLAB® and Simulink®

Algorithm and System Design

Model-Based Design for FPGAs

Verification

Functional Simulation

Static Timing Analysis

Timing Simulation

Behavioral Simulation

Back Annotation Implement Design

Map

Place & Route

Synthesis

FPGA Hardware

Behavioral

Cosimulation

Automatic HDL

Code Generation

RTL

Page 6: Intro to FPGA Design Using MATLAB and Simulink Published

6

MATLAB® and Simulink®

Algorithm and System Design

Model-Based Design for FPGAs

Verification

Static Timing Analysis

Timing Simulation

Back Annotation Implement Design

Map

Place & Route

Synthesis

FPGA Hardware

Implement Design

Map

Place & Route

Synthesis

Back Annotation

Functional Simulation

Verification

Static Timing Analysis

Timing Simulation

Functional Simulation

Behavioral

Cosimulation

Automatic HDL

Code Generation

RTL

Page 7: Intro to FPGA Design Using MATLAB and Simulink Published

7

FPGA Hardware

Model-Based Design for FPGAs

FPGA Hardware

MATLAB® and Simulink®

Algorithm and System Design

Implement Design

Map

Place & Route

Synthesis

Back Annotation

Verification

Static Timing Analysis

Timing Simulation

Functional Simulation

Behavioral

Cosimulation

Automatic HDL

Code Generation

RTL

Page 8: Intro to FPGA Design Using MATLAB and Simulink Published

8

Model-Based Design with FPGA Workflows

MathWorks®

– HDL Coder™

Altera®

– DSP Builder

– DSP Builder Advanced Blockset

Page 9: Intro to FPGA Design Using MATLAB and Simulink Published

9

HDL Coder

HDL code generation from MATLAB code, Simulink models, and Stateflow charts

– Target-independent HDL code

– IEEE 1376 compliant VHDL

– IEEE 1364-2001 compliant Verilog

Verification

– Generate HDL test bench

– Cosimulate with Mentor Graphics® ModelSim® or Cadence® Incisive®

Workflow integration

– Integration with FPGA implementation tools e.g., Quartus® II

– Optimize for area/speed

– Generate bit stream

– Back-annotation of timing to Simulink model

MATLAB®, Simulink ®, Stateflow®

Algorithm and System Design

Link for ModelSim

HDL

HDL Coder™

HDL Verifier™

FPGA ASIC FPGA ASIC

HDL

Veri

fy

Veri

fy

Gen

era

te

Page 10: Intro to FPGA Design Using MATLAB and Simulink Published

10

Digital Down Converter

DDC accepts

– A high sample rate passband signal

(may be 50 to 100 Msps)

DDC produces

– A low sample-rate baseband signal

ready for demodulation

HDL

HW Implementation Model

Fixed-Point Model

MATLAB/Simulink

Algorithm Model

Page 11: Intro to FPGA Design Using MATLAB and Simulink Published

11

Fixed-Point Analysis Digital Down Converter

Convert floating-point to fixed-point models

– Automatic tracking of signal range (also intermediate quantities)

– Fraction lengths recommendation

Bit-true models in the same environment

– Quantify the impact of fixed point quantization

Find and fix issues

with fixed point

easily

Page 12: Intro to FPGA Design Using MATLAB and Simulink Published

12

Automatic HDL Code Generation Digital Down Converter

Automatically generate bit true,

cycle accurate HDL code from

Simulink, MATLAB, and Stateflow

Full traceability between

model and HDL code

Page 13: Intro to FPGA Design Using MATLAB and Simulink Published

13

Simulink Library Support for HDL HDL Supported Blocks Over 170 blocks supported

Core Simulink Blocks – Basic and Array Arithmetic, Look-Up Table,

Signal Routing (Mux/Demux, Delay, Selector),

Logic & Bit Operations, Dual and single port

RAM, FIFO, CORDIC

Signal Processing Blocks – NCO, FFT, Digital Filters (FIR, IIR, Multi-rate,

Adaptive), Rate Change (Up-/Down-sample),

Statistics (Min/Max)

Communications Blocks – Psuedo-random Sequence Generator,

Modulator / Demodulator, Interleaver / Deinterleaver, Viterbi Decoder

Page 14: Intro to FPGA Design Using MATLAB and Simulink Published

14

MATLAB Function Block – Subset of the MATLAB language

for modeling and generating HDL implementations

– MATLAB Function Block Design

Patterns for HDL

Stateflow – Tool for graphical modeling of

Mealy / Moore finite state machines

MATLAB and Stateflow HDL Supported Blocks

Page 15: Intro to FPGA Design Using MATLAB and Simulink Published

16

Use Cases for HDL Coder

MATLAB, Simulink , Stateflow

Algorithm and System Design

Link for ModelSim

HDL

HDL Coder

HDL Verifier

FPGA ASIC FPGA ASIC

HDL

Veri

fy

Veri

fy

Gen

era

te

System-level designers new to

hardware design

Companies/design teams that have

adopted Model-Based Design

Target-independent HDL is needed

Safety-critical applications (DO-254)

Retargeting algorithm between

software and hardware

Model includes MATLAB code or

Stateflow charts

Page 16: Intro to FPGA Design Using MATLAB and Simulink Published

17

Altera DSP Builder

Generates HDL optimized for Altera FPGAs from Simulink

Key Optimizations

– Silicon Architecture Aware

– Constraint Driven Design

Supports Floating Point

– Single Precision

– Double Precision

Verification

– Generate HDL test bench

– Cosimulate with ModelSim

Simulink

Algorithm and System Design

Link for ModelSim

HDL

DSP Builder

FPGA ASIC Altera

FPGA

Altera

HardCopy® ASIC

HDL

Veri

fy

Veri

fy

Gen

era

te

Page 17: Intro to FPGA Design Using MATLAB and Simulink Published

18

Altera DSP Builder

Simulink – Sources

– Sinks

– Continuous

– Discrete

– Nonlinear

– Math

Altera DSP Builder Advanced Blockset

Altera DSP Builder Blockset

Fixed-Point Blockset

DSP System Blockset

Simulink Coder

Communications System Blockset

Image Acquisition Toolbox

others

Page 18: Intro to FPGA Design Using MATLAB and Simulink Published

19

Altera DSP Builder Design Flow

MATLAB® / Simulink®

(System simulation and verification)

HDL / Hardware Domain ( Hardware implementation / RTL simulation)

Page 19: Intro to FPGA Design Using MATLAB and Simulink Published

20

Constraint-Driven Design (1)

1. Choose your type – Fixed or Floating Point

Page 20: Intro to FPGA Design Using MATLAB and Simulink Published

21

Constraint-Driven Design (2)

Use ModelIP or ModelPrim libraries

ModelIP

ModelPrim

2. Create Model

Page 21: Intro to FPGA Design Using MATLAB and Simulink Published

22

Constraint-Driven Design (3)

Device-independent modeling up to this level

Stratix II

AUTO

3. Select Device

Page 22: Intro to FPGA Design Using MATLAB and Simulink Published

23

Automatic pipelining or time sharing (ModelIP)

4. Set Frequency

Constraint-Driven Design (4)

Page 23: Intro to FPGA Design Using MATLAB and Simulink Published

24

Constraint-Driven Design (5)

5. Compile

Page 24: Intro to FPGA Design Using MATLAB and Simulink Published

25

Math.h Functions

Math.h - SIN - POW(x,y)

- COS - LDEXP

- TAN - FLOOR

- ASIN - CEIL

- ACOS - FABS

- ATAN - SQRT

- EXP - DIVIDE

- LOG - 1/SQRT

- LOG10

Implemented in Floating Point

Page 25: Intro to FPGA Design Using MATLAB and Simulink Published

26

Complex Functions Easily Realized in FPGA

Page 26: Intro to FPGA Design Using MATLAB and Simulink Published

27

Supports Single and Double Precision

Including complex (c)

Page 27: Intro to FPGA Design Using MATLAB and Simulink Published

28

Supports Fixed Point and Floating Point

Within the same model

Page 28: Intro to FPGA Design Using MATLAB and Simulink Published

29

Loop Block for “For i…” Loops

Page 29: Intro to FPGA Design Using MATLAB and Simulink Published

30

Nested Looping Functionality

Page 30: Intro to FPGA Design Using MATLAB and Simulink Published

31

Use Cases Summary

HDL Coder

System-level designers new to

hardware design

Companies that have adopted

Model-Based Design

Target-independent HDL needed

Safety-critical applications

Retargeting algorithm between

software and hardware

Model includes MATLAB code or

Stateflow charts

Altera DSP Builder

Hardware designers new to

Model-Based Design

Optimized for all Altera devices -

even ones we haven’t built yet

Constraint driven for high

performance designs

Supports floating-point

implementation

Supports integration into larger

systems with Altera Qsys

Page 31: Intro to FPGA Design Using MATLAB and Simulink Published

32

1. Visit mathworks.com/fpga

Get free FPGA Design Information Kit • View webinar – “Accelerate FPGA Design Using

Simulink HDL Coder”

Request trial of HDL Coder

2. Visit altera.com/dspbuilder

Technical resources

Request trial

3. Questions?

Write to [email protected]

Next Steps

MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list

of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective

holders


Recommended