Title: DSP Builder ????;????;????;???;?????
1?????
- ????
- DSP Builder ????????????????????
- ????
- DSP Builder ???????Simulink??????MATLAB?????DSP
Builder????,?????????????????????????
2??(1)
- ???? DSP Builder??
- DSP Builder??
- DSP Builder??
- DSP Builder????
- DSP Builder????
- ??
3??(2)
- ???? Altera DSP Builder???
- AltLab?
- ???
- ?????
- ??????
- Rate Change???
- ??????
- ???(Storage)???
- MegaCore????
- ???
4Implementing DSP Designs in FPGA
5The Programmable Solutions Company
6Agenda
- Overview
- Designing with DSP Builder Library Blocks
- Simulating Debugging with DSP Builder
- Intellectual Property (IP) Implementation
- FIR, NCO and FFT IP Functions
- Appendix
- Introduction to Altera Devices
- Hardware Acceleration Using Nios II
7What Is a DSP Processor?
- Microprocessor With Specialized Instructions
Hardware for DSP Applications - Optimized For High-Performance, Repetitive and
Numerically Intensive Tasks - Hardware
- Fixed Floating Point Multipliers
- Co-Processors
- Special Memory Structures
- Multiple Access Memories For Faster Computations
- Run Arithmetic Calculations Faster than General
Processors
8What Is an FPGA?
- Field Programmable Gate Array
- Device that Has a Regular Architecture (Set of
Blocks) that Can Be Programmed for Various
Functions - Glue Logic
- Customizable Hardware Solution
- Configurable Processors
9DSP Processors vs. FPGAs
High Speed DSP Processor
High Level of Parallel Processing in FPGA
- 1-8 Multipliers
- Needs looping for more than 8 multiplications
- Needs multiple clock cycles because of serial
computation - 200 Tap FIR Filter would need 25 clock cycles
per sample with an 8 MAC unit processor
- Can implement hundreds of MAC functions in an
FPGA - Parallel implementation allows for faster
throughput - 200 Tap FIR Filter would need 1 clock cycle per
sample
10Extending Range of Altera Reconfigurable DSP
Solutions
New!
600 -
Performance (MMACs/sec)
100 -
Complete Hardware Implementation
Embedded Processors
Embedded Processors Hardware Acceleration
11FPGA / DSP Challenges
- Designing With FPGAs Is Different!!
- Different Set of Tools
- C-Code vs. VHDL / Verilog
- System-Level Development Verification
- Software/Hardware Co-Development
- Software Design Optimization
12Addressing Challenges
- 1) System-level Development Verification
- DSP Builder Tool
- System Integration
- Bit-true Cycle Accurate Models
- Automatic Translation into Hardware
- 2) Hardware/Software Integration
- SOPC Builder Tool Nios II Processor
- 3) Design Optimization
- Hardware Acceleration
- Flexibility in System Partitioning
13Implementing DSP Designs in FPGAs
14The Mathworks
- Headquarters in Natick, near Boston
- Founded in 1984, Privately Held
- Over 1000 employees
- Direct Offices in UK, France, Italy, Germany,
Switzerland, Spain, Benelux - Distributors in 20 Countries
15The Mathworks Product Family
DAQ cards Instruments
Slide Courtesy of The MathWorks
16The Mathworks Design Environment
- Top-Down Design
- Design Test System Behavior Early in the Design
Process - Create Validated Reference Design
- Detect Design Flaws Early
- Reduced Design Risk Cost
- Reduced Time-to-Market
17MATLAB Environment
Current Working Directory
Simulink
Variables
Results of Commands Errors, etc.
Command History
18Simulink
- Hierarchical Block Diagram Design Simulation
Tool - Digital, Analog/Mixed Signal Event Driven
- Visualize Signals
- Integrated with MATLAB
19Simulink Blockset Libraries
- Simulink
- Sources
- Sinks
- Continuous
- Discrete
- Non-Linear
- Math
-
-
- Fixed-Point Blockset
- DSP Blockset
- Communications Blockset
- SimPowerSystems Blockset
- Others
Altera DSP Builder
20Matlab / Simulink Model Created with Altera DSP
Builder Libraries
21Design Flow with DSP Builder
(???)
22What Is DSP Builder?
- Links MATLAB/Simulink Design Environment to
- Quartus II Development Tool for Altera FPGAs
- Automatic HDL Code Generation from Simulink Model
Generated by DSP Builder Libraries - Generates Bit Cycle Accurate Models for DSP
Functions - Automatic Generation of HDL Testbench
- Integrated Intellectual Property (IP) Library
Support - Enables Rapid Prototyping with Altera DSP
Development Board - Facilitates Integration of Complex DSP Functions
23DSP Builder Overview
24Altera DSP Builder Libraries
- AltLab
- Arithmetic
- Boards
- Complex Type
- Gate Control
- IO Bus
- Rate Change
- SOPC Builder Links
- State Machine Functions
- Storage
- MegaCore Functions
- Video and Image Processing
25 Design Flow Overview
- Create Design in Simulink Using Altera Libraries
- Simulate in Simulink
- Add Signal Compiler to Model
- Create HDL Code Generate Testbench
- Perform RTL Simulation
- Synthesize HDL Code Place Route
- Program Device
- Signal Tap II Logic Analyzer
26Step 1- Create Design in Simulink Using Altera
Libraries
- Drag Drop Library Blocks into Simulink Design
Parameterize Each Block
27Parameterization of IP Megacores
28Step 2 - Simulate in Simulink
29Step 3 - Add Signal Compiler to Model to
Generate HDL code
30Step 4 - Create HDL Code Generate Testbench
altrfir32.mdl
31HDL Code Generation
32DSP Builder Report File
- Lists All Converted Blocks
- Port Widths
- Sampling Frequencies
- Warnings Messages
33Step 5 Perform RTL Simulation
( ModelSim )
- Set working directory (File gt Change Directory)
- Run TCL file (Tools gt Execute Macro)
34 Perform Verification
35Step 6 - Synthesize HDL Place Route
36Step 7 Program Device
37Step 8 - SignalTap II Logic Analyzer
- Embedded Logic Analyzer
- Downloads into Device with Design
- Captures State of Internal Nodes
- Uses JTAG for Communication
38SignalTap II Logic Analyzer
Imported Data
Imported Plot
39Design Flow Review with DSP Builder
- Create Design in Simulink Using Altera Libraries
- Simulate in Simulink
- Add Signal Compiler to Model
- Create HDL Code Generate Testbench
- Perform RTL Simulation
- Synthesize HDL Code Place Route
- Program Device
- Signal Tap II Logic Analyzer
40Quartus II Assignments Settings
41Stratix II DSP Development Board
42Stratix II DSP Board Block Diagram
43(No Transcript)
44 Demos Provided with DSP Builder
45??? Altera DSP Builder???
- AltLab?
- ???
- ?????
- ??????
- Rate Change???
- ??????
- ???(Storage)???
- MegaCore????
- ??
46Altera DSP Builder Libraries
- AltLab
- Arithmetic
- Boards
- Complex Type
- Gate Control
- IO Bus
- Rate Change
- SOPC Builder Links
- State Machine Functions
- Storage
- MegaCore Functions
- Video and Image Processing
471?AltLab?(1)
- AltLab?????????????,???????????RTL??VHDL???
48AltLab Library
- Signal Compiler
- HDL SubSystem
- Build Hierarchical System
- HDL Import
- SignalTap II Block
- SignalTap II Analysis
- BP Bus Probe
- Device programmer
- HIL
- Quartus II Global Project Assignment
- Quartus II Pinout Assignment
- VcdSink
- SubSystem Builder
- Creates Black-Box
491?AltLab?(2)
- SignalCompiler??
- SignalCompiler???DSP Builder?????,
- ??????
- ?Simulink?????????RTL VHDL
- ??VHDL testbenches
- ??Verilog testbenches
- ??Quartus II??Verilog HDL????
- ?Simulink?????VHDL testbench???txt???????
- ??Tcl ????Quartus II???
- ?????LeonardoSpectrum?Precision RTL
Synthesis?Synplify?ModelSim?????Tcl?? - ??Quartus II???????
- ??PTF????,??????SOPC Builder
- ????SignalTap II (.stp) ??
- ??Quartus II??????(.bsf) ?
501?AltLab?(3)
- SignalCompiler??
- ???Simulink???????Simulink????,?????????VHDL???,??
?SignalCompiler??????sc_altera??????????
Update DiagramSignalCompiler?????Simulink????????
???DSP Builder?????? AnalyzeSignalCompiler??????
?????mdl??,?????????????DSP Builder???????????????
???????????? Skip Analyze???????
511?AltLab?(4)
- ????????????????????????????????????????????????
???????????reset?????????SignalTap
II???????????????????SOPC ptf???????Verilog??? - ?????????????Signal Compiler???????,
???????,?MDL???VHDL,?????Tcl????
?????VHDL????????Quartus II???????????DSP???????
???????DSP????? - ???Project Info??????????Report
File???SignalCompiler?????????
52AltLab HDL SubSystem
- Create Hierarchical Design
- Separate HDL Code for Each Subsystem
53AltLab HDL SubSystem (cont.)
542????
- ?????????????????,??????????????Use Dedicated
Circuitry????,?????????Altera tratix II?Stratix?
Stratix GX?Cyclone II????DSP??????
55Arithmetic Library
- Comparator
- Divide
- Gain
- Increment Decrement
- Magnitude
- Multiply Accumulate
- Multiply Add
- Parallel Adder Subtractor
- Product
- Sum of Partial Products
- Integrator
- Differentiator
56Arithmetic Library Multiply Add
57Arithmetic LibraryDifferentiator Integrator
BlocksEx CIC Filter(????????? )
58Arithmetic LibraryAdder Gain BlocksEx IIR
Filter(????????? )
593?I/O????????
- ?????????????????????bit ?????????????
60Bus Manipulation AltBus
61AltBus Modes
- Input Output Port
- Defines Hardware Boundaries
- Converts Floating-Point to Fixed-Point
- Internal Node
- Defines Internal Hardware Node Widths
- Converts SBF Formats
- Constant
- Implements Constants in Hardware
- Black Box
- Defined Later
62Bus Manipulation Bus Conversion
63IO Bus Library (cont.)Ex Floating Point
Operation
64Ex Floating Point Operationwith IO Bus
Library Blocks (Cont.)
65BP Bus Probe
664???????
67Complex Signals Library
- Butterfly
- Complex Multiplexer
- Complex Conjugate
- Complex Delay
- Complex Product
- Complex AddSub
- Complex Constant
- Complex to Real-imag
- Real-imag to Complex
68ButterFly
- Implement Decimation in Time FFT Butterfly
- a,b,W,A,B Are Complex Number (Signed Integer)
- axjX byjY W vjV
- A abW B a-bW
- A (xyv)YV j(XYv-yV)
- B (x-yv)-YV j(X-YvyV)
69Complex Real-Imag to Complex
- X a Bj
- Conjugate
- Conjugate(X) a - Bj
- Invert
- Invert(X) -a - Bj
- X a Bj
- Y C Dj
- Multiply
- X Y (AC BD) (AD BC)j
70Gate Control Library
- Case Statement
- If Statement
- Logical Bit Operator
- Logical Bus Operator
- Single Pulse
- LUT
- N-to-1 Multiplexer
- 1-to-N Demux
- Decoder
- Bitwise Logical Bus Operator
71Gate Control LibraryEx Convolutional
Interleaver
725????(Storage)???
73Storage Library
- Delay
- Down Sampling
- Dual-port RAM
- FIFO
- LFSR Sequence
- LUT
- Parallel to Serial
- Pattern
- ROM EAB
- Serial to Parallel
- Shift Taps
- Up Sampling
74Storage Shift Taps
75ROM EAB Shift Taps BlocksEx Polyphase Filter
76Memory Delay BlockEx 2D Filter
776?Rate Change???(1)
- ????????DSP Builder???Delay?Increment
Decrement?????????Simulink?VHDL????????????Simulin
k?Solver,?????? - ??Fixed-step
- ??discrete
- (no continuous state)
- ??Single Tasking??
786?Rate Change???(2)
- ClockAltr?? ????????????????
- PLL?? ????????????????????
- Multi-Rate DFF?? ?????????
- Tsamp ?? ??????????????
796?Rate Change???(3)
80Rate Change Multi-Rate DFF
- Synchronize data path intersections
- involving multiple rates
81Rate Change Tsamp PLL BlocksEx Polyphase
Filter
827?SOPC Builder Link(1)
- Nios II???????????????????????????,??????????????
????Nios II????????RISC CPU????????Cygnus?Red
Hat??GNUPro??? - ??????SOPC???????????????????,??SOPC
Builder????SOPC Builder??????????????? - ??Avalon?????
- ??Nios II????????????????????
837?SOPC Builder Link(2)
- ?????????VHDL?,SignalCompiler????class.ptf???Quart
us II???????????SOPC Builder? ???DSP Builder
SOPC Builder?????
84SOPC Builder Library DSP Acceleration
- Custom Peripheral
- Interface to Nios Through Avalon Bus
- Custom Instruction
- Adds Customized Logic to Nios ALU
85What is SOPC Builder?
86SOPC Builder LibraryCustom Instruction
- Add Custom Instruction Blocks to Simulink Model
87SOPC Builder Library Custom Peripheral
- Add Avalon Ports to Simulink Model
88SOPC Builder Library Avalon Blocks
89SOPC Builder Library Avalon Blocks
908?DSP????
91Board Library
929??????
9310?MegaCore ????
- Altera ?MegaCore???Altera?PLD???????????????,???M
egaCore???????Altera?MegaWizard Plug-In
Manager??????? - OpenCore Plus??????????????????????,??????????????
???,?????MegaCore??????? - DSP Builder??????IP?
- FIR Compiler
- IIR Compiler
- Reed-Solomon Compiler
- Viterbi Compiler
- FFT Compiler
- NCO Compiler
94Alteras IP Megafunctions
- Shrink-Wrapped Functions Customers can Drop into
Altera FPGA Designs - Optimized for Altera Architectures
- Easily Parameterized through MegaWizard Plug-in
Manager
95Megacore IP in DSP Builder
DSP IP Type
FIR Compiler Filtering
FFT/IFFT Compiler Transforms
NCO Compiler Signal Generation
Reed-Solomon Compiler Error Detection/ Correction
Viterbi Compiler Error Detection / Correction
96FIR Compiler
1.Generate Floating-Point Coefficients based on
Filter Parameters 2. Scale Coefficients to
Fixed-Point Values 3. Select Input/Output
Specifications 4. Determine Filter
Architecture 5. Select Output Simulation Files
97Numerically Controlled Oscillators (NCO)
- Purpose
- To Generate a Discrete-Time, Discrete-Value
Waveform Approximating a Continuous Waveform to a
Defined Precision - Primary Application Area
- Direct Digital Synthesis (DDS) of Sinusoidal
Waveforms - - I-Q Modulation
- - Carrier Recovery
- - Pilot Generation.
98Advanced Features
- Black Boxing
- Modelling Guidelines
- - Clock Design Rules
- - Multi-Rate Designs
- - Data Width Propagation
- - Automatic Sign Extension
- - Word Growth
99Black-Boxing
- What is a black-box and why is it used?
- Module or Group of Blocks Left Unprocessed by DSP
Builder - Surrounding Blocks Still Converted to HDL
- Allows HDL Code to Be Added to Simulink Design
- Use Blocks, C-Based Model or M-File for Simulink
Simulation - Output Netlist Includes Port Connections to
Black-Box - Black-Box Code is Inserted by Quartus II
- Uses Altbus Blocks in Block Box Input Output Mode
100Replace With Black Box
101Looking Under Black Box
102AltBus Black Box Mode
- Black Box Input Output Port
- Creates Black Box
- Not Converted to HDL
- Port Connections Remain
103???(?)
104???(?)
105????