Generating, Optimizing and Verifying HDL Code with MATLAB and Simulink Puneet Kumar Application Engineering Team

Similar documents
Product Development Flow Including Model- Based Design and System-Level Functional Verification

Embedded Vision on FPGAs The MathWorks, Inc. 1

Echtzeittesten mit MathWorks leicht gemacht Simulink Real-Time Tobias Kuschmider Applikationsingenieur

Schnell und effizient durch Automatische Codegenerierung

Integrating MATLAB into your C/C++ Product Development Workflow Andy Thé Product Marketing Image Processing Applications

Eli Levi Eli Levi holds B.Sc.EE from the Technion.Working as field application engineer for Systematics, Specializing in HDL design with MATLAB and

Model-based system-on-chip design on Altera and Xilinx platforms

Converting Models from Floating Point to Fixed Point for Production Code Generation

High-Level Synthesis for FPGA Designs

Introduction to Functional Verification. Niels Burkhardt

7a. System-on-chip design and prototyping platforms

Die wichtigsten Use Cases für MISRA, HIS, SQO, IEC, ISO und Co. - Warum Polyspace DIE Embedded Code-Verifikationslösung ist.

Float to Fix conversion

9/14/ :38

Entwicklung und Testen von Robotischen Anwendungen mit MATLAB und Simulink Maximilian Apfelbeck, MathWorks

STUDY ON HARDWARE REALIZATION OF GPS SIGNAL FAST ACQUISITION

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

Fastest Path to Your Design. Quartus Prime Software Key Benefits

Introduction to Xilinx System Generator Part II. Evan Everett and Michael Wu ELEC Spring 2013

DDS. 16-bit Direct Digital Synthesizer / Periodic waveform generator Rev Key Design Features. Block Diagram. Generic Parameters.

Software Development with Real- Time Workshop Embedded Coder Nigel Holliday Thales Missile Electronics. Missile Electronics

VHDL Test Bench Tutorial

Non-Data Aided Carrier Offset Compensation for SDR Implementation

AES1. Ultra-Compact Advanced Encryption Standard Core. General Description. Base Core Features. Symbol. Applications

Best Practices for Verification, Validation, and Test in Model- Based Design

Introduction to Digital System Design

Best Practices for Adopting Model-Based Design in Electronic System Development

Best Practises for LabVIEW FPGA Design Flow. uk.ni.com ireland.ni.com

Development of AUTOSAR Software Components within Model-Based Design

Introduction to MATLAB Gergely Somlay Application Engineer

Software Development Principles Applied to Graphical Model Development

Electronic system-level development: Finding the right mix of solutions for the right mix of engineers.

Architectures and Platforms

SDLC Controller. Documentation. Design File Formats. Verification

Chapter 13: Verification

Digital Design Verification

Model Based System Engineering (MBSE) For Accelerating Software Development Cycle

Vivado Design Suite Tutorial

Modeling a GPS Receiver Using SystemC

Agilent Technologies. Generating Custom, Real-World Waveforms Integrating Test Instrumentation into the Design Process Application Note 1360

System Generator for DSP

Video/Image Processing on FPGA

Extending the Power of FPGAs. Salil Raje, Xilinx

LMS is a simple but powerful algorithm and can be implemented to take advantage of the Lattice FPGA architecture.

Agenda. Michele Taliercio, Il circuito Integrato, Novembre 2001

Qsys and IP Core Integration

Power inverters: Efficient energy transformation through efficient TargetLink code

VHDL-Testbench as Executable Specification

MATLAB/Simulink Based Hardware/Software Co-Simulation for Designing Using FPGA Configured Soft Processors

9 REASONS WHY THE VIVADO DESIGN SUITE ACCELERATES DESIGN PRODUCTIVITY

Lecture 3 - Model-based Control Engineering

Digital Systems Design! Lecture 1 - Introduction!!

System-on. on-chip Design Flow. Prof. Jouni Tomberg Tampere University of Technology Institute of Digital and Computer Systems.

Quartus II Software Design Series : Foundation. Digitale Signalverarbeitung mit FPGA. Digitale Signalverarbeitung mit FPGA (DSF) Quartus II 1

Simulink Modeling Guidelines for High-Integrity Systems

Wireless Communication and RF System Design Using MATLAB and Simulink Giorgia Zucchelli Technical Marketing RF & Mixed-Signal

Data Analysis with MATLAB The MathWorks, Inc. 1

Floating Point Fused Add-Subtract and Fused Dot-Product Units

RAPID PROTOTYPING OF DIGITAL SYSTEMS Second Edition

Martin C. Alcock, M. Sc. (Dist), MIEEE Embedded Systems Specialist

Automatic Floating-Point to Fixed-Point Transformations

Example-driven Interconnect Synthesis for Heterogeneous Coarse-Grain Reconfigurable Logic

3D Position Tracking of Instruments in Laparoscopic Surgery Training

DO-254 Requirements Traceability

Aims and Objectives. E 3.05 Digital System Design. Course Syllabus. Course Syllabus (1) Programmable Logic

Lab 1: Full Adder 0.0

FPGAs for High-Performance DSP Applications

Guru Ghasidas Vishwavidyalaya, Bilaspur (C.G.) Institute of Technology. Electronics & Communication Engineering. B.

MathWorks Products and Prices North America Academic March 2013

LogiCORE IP AXI Performance Monitor v2.00.a

Understanding DO-254 Compliance for the Verification of Airborne Digital Hardware

Verification & Design Techniques Used in a Graduate Level VHDL Course

Engineering Change Order (ECO) Support in Programmable Logic Design

ARM Webinar series. ARM Based SoC. Abey Thomas

Introduction to Simulink & Stateflow. Coorous Mohtadi

Assertion Synthesis Enabling Assertion-Based Verification For Simulation, Formal and Emulation Flows

MIMO detector algorithms and their implementations for LTE/LTE-A

Codesign: The World Of Practice

Integrated Software-Defined Radio on Zynq All Programmable SoC Design Seminar

PowerPlay Power Analysis & Optimization Technology

Why Adopt Model-Based Design for Embedded Control Software Development?

ESP-CV Custom Design Formal Equivalence Checking Based on Symbolic Simulation

Design and Verification of Nine port Network Router

Caterpillar Automatic Code Generation

Hardware and Software

HDL Simulation Framework

Modeling Latches and Flip-flops

FPGA-Centric Functional Verification

The Designer's Guide to VHDL

Course Curriculum for Master Degree in Electrical Engineering/Wireless Communications

Quartus II Handbook Volume 3: Verification

Integrated Model-based Software Development and Testing with CSD and MTest

Rapid System Prototyping with FPGAs

Model-Based Development of Safety-Critical Software: Safe and Effi cient

ALFFT FAST FOURIER Transform Core Application Notes

Transcription:

Generating, Optimizing and Verifying HDL Code with MATLAB and Simulink Puneet Kumar Application Engineering Team 2012 The MathWorks, Inc. 1

Agenda Integrated Workflow for FPGA/ASIC Development Automatic HDL Code Generation & Optimization Refining DUT from floating to fixed point Automatic HDL Code Generation from MATLAB, Simulink, and Stateflow Integrated HDL Verification Automatically Measuring Test Coverage Generating Co-Simulation Test benches FPGA-in-Loop Verification with Xilinx ML 605 FPGA Board Q&A 2

Algorithm Development Process Requirements Research & Design Explore and discover Design Gain insight into problem Evaluate options, trade-offs Implementation Elaborate Test Test & Verification Desktop.dll.exe.c, C,.cpp C++ Embedded C, C C++ VHDL / Verilog Structured Text Design Elaborate Test 3

The Algorithm Design Challenge How can we: Implement designs faster? MATLAB Algorithm Design Reuse designs on a variety of hardware? FPGA MCU ASIC DSP FPGA ASIC 4

Solution: C and HDL Code Generation Design, execute, and verify algorithms in MATLAB MATLAB Algorithm Design Automatically generate C or HDL code Deploy generated code on hardware MATLAB Coder Generate HDL Coder Generate C VHDL/Verilog FPGA MCU ASIC DSP FPGA ASIC 5

Code Generation Products for VHDL/Verilog HDL Coder MATLAB Coder Fixed-Point Designer HDL Coder Automatically generate VHDL or Verilog from MATLAB code and Simulink Model MATLAB Coder Automatically generate C and C++ from MATLAB code Fixed-Point Designer provides fixed-point data types and arithmetic 6

Best Practice 1: Algorithm and System Design with Fixed-Point Quantization Analysis Use modeling and simulation to optimize at the system level using Simulink and Simulink Fixed Point 7

Best Practice 1: Algorithm and System Design with Fixed-Point Quantization Analysis Best Practice 2: Automatic HDL Code Generation Automatically generate readable, traceable HDL code for FPGA and ASIC designs using HDL Coder 8

Best Practice 1: Algorithm and System Design with Fixed-Point Quantization Analysis Best Practice 2: Automatic HDL Code Generation Best Practice 3: HDL Cosimulation Reuse system-level test benches with cosimulation for HDL verification using HDL Verifier 9

Best Practice 1: Algorithm and System Design with Fixed-Point Quantization Analysis Best Practice 2: Automatic HDL Code Generation Best Practice 3: HDL Cosimulation Implement Design Enable regression testing with FPGA-in-the-loop simulation using HDL Verifier Best Practice 4: FPGA Hardware-in-the-Loop 10

Audio Equalizer (A Brief Example) 11

Semtech Speeds Development of Digital Receiver FPGAs and ASICs Challenge Accelerate the development of optimized digital receiver chains for wireless RF devices Solution Use MathWorks tools for Model-Based Design to generate production VHDL code for rapid FPGA and ASIC implementation Results Prototypes created 50% faster Verification time reduced from weeks to days Optimized, better-performing design delivered The Semtech SX1231 wireless transceiver. Writing VHDL is tedious, and the handwritten code still needs to be verified. With Simulink and Simulink HDL Coder, once we have simulated the model we can generate VHDL directly and prototype an FPGA. It saves a lot of time, and the generated code contains some optimizations we hadn t thought of. Frantz Prianon Semtech 12

HDL Coder Generate VHDL and Verilog Code for FPGA and ASIC designs MATLAB HDL Coder Simulink New: MATLAB to HDL Automatic floating-point to fixed-point conversion HDL resource optimizations and reports Algorithm-to-HDL traceability Verilog and VHDL Integration with simulation & synthesis tools 13

Model-Based Design flow using MATLAB/Simulink from Algorithm to FPGA Implementation MATLAB and Simulink Algorithm and System Design DESIGN HDL Coder RTL Creation HDL Verifier HDL Co-Simulation Algorithm Development MATLAB Simulink Stateflow RTL Back Annotation Implement Design Verification Synthesis Functional Simulation Map Static Timing Analysis Place & Route Timing Simulation HDL Verifier FPGA in the Loop 14

Algorithm to HDL Workflows 1. Simulink to HDL (with MATLAB and Stateflow) 2. MATLAB to HDL 2 1 3. Hybrid workflow 3 VHDL & Verilog VHDL & Verilog 15

Using HDL Coder: 5-Step Workflow Prepare Fixed-Point Generate Simulate Synthesis, P&R *_FixPt.m *_wrapper_fixpt.m *_tb_fixpt.m *.vhd, *.v *.do, *.tcl *.wlf, *.txt *.edf, *.edn *.bit Prepare your MATLAB algorithm for code generation Use supported language features Make implementation choices Fixed-Point MATLAB code generation from your floating-point design using your MATLAB TestBench Accelerate TestBench for fast simulation Automatically propose Fixed-Point type Iterate data-type customization to optimize Verify Fixed-Point code against original Floating-Point code. Generate synthesizable RTL & TestBench code from Fixed-Point MATLAB code for final use Iterate your MATLAB code to optimize Implement as source, executable or library Simulation the generated HDL code with test vectors from the test bench using the specified simulation tool Synthesis, Place and Route the generated RTL code by creating project with ISE/Quartus II Check timing analysis report to optimize 16

Simulink Library Support for HDL HDL Supported Blocks 180 blocks supported Core Simulink Blocks Basic and Array Arithmetic, Look-Up Tables, Signal Routing (Mux/Demux, Delays, Selectors), Logic & Bit Operations, Dual and single port RAMs, FIFOs, CORDICs, Busses Signal Processing Blocks NCOs, FFTs, Digital Filters (FIR, IIR, Multirate, Adaptive), Rate Changes (Up &Down Sample), Statistics (Min/Max) Communications Blocks Psuedo-random Sequence Generators, Modulators / Demodulators, Interleavers / Deinterleavers, Viterbi Decoders 17

Agenda Integrated Workflow for FPGA/ASIC Development Automatic HDL Code Generation & Optimization Refining DUT from floating to fixed point Automatic HDL Code Generation from MATLAB, Simulink, and Stateflow Integrated HDL Verification Automatically Measuring Test Coverage Generating Co-Simulation Test benches FPGA-in-Loop Verification with Xilinx ML 605 FPGA Board Q&A 18

From Algorithm to Synthesizable RTL MATLAB and Simulink Algorithm and System Design Model Refinement for Hardware Automatic HDL Code Generation HDL Co-Simulation Behavioral Simulation Back Annotation Implement Design Synthesis Map Place & Route Verification Functional Simulation Static Timing Analysis Timing Simulation FPGA Hardware FPGA-in-the-Loop 19

Best Practice 1 Use modeling and simulation to optimize at the system level Optimize on fixed-point word-length to reduce area and power Convert floating point to optimized fixed-point models Automatic tracking of signal range (also intermediate quantities) Word / Fraction lengths recommendation Bit-true models in the same environment 20

Best Practice 2 Automatically generate readable, traceable HDL code for FPGA and ASIC designs Automatically generate bit true, cycle accurate HDL code from Simulink, MATLAB and Stateflow Full bi-directional traceability!! Requirements 21

Speed optimization Use pipelining to improve speed Critical Path highlighting makes it easier to identify the true bottlenecks of the system Advanced Pipelining options for pipeline distribution and automatic delay compensation 22

Area optimization Use sharing and streaming to reduce area Use sharing and streaming to reduce area Automatically generated validation models Multipliers 10 Adders/Subtractors 36 Registers 292 RAMs 2 Multiplexers 116 Resource utilization reports provide early feedback on resource utilization 23

Agenda Integrated Workflow for FPGA/ASIC Development Automatic HDL Code Generation & Optimization Refining DUT from floating to fixed point Automatic HDL Code Generation from MATLAB, Simulink, and Stateflow Integrated HDL Verification Automatically Measuring Test Coverage Generating Co-Simulation Test benches FPGA-in-Loop Verification with Xilinx ML 605 FPGA Board Q&A 24

Which tests do you perform today? 25

Verification Landscape: Model VHDL / Verilog FPGA Requirements Functional Equivalence Coverage Property Proving Virtual Platforms Requirements Equivalence Coverage Assertions Equivalence Regression Timing Analysis 26

Verification Challenges: Stimuli-Driven Test Bench in HDL Simulators Digital waveforms are difficult to analyze Application specific analysis methods are needed How to get test vectors to achieve 100% test coverage? Formal methods to derive required test cases 27

Verification Landscape Solution: Re-use System Level Test Bench Model VHDL / Verilog FPGA Requirements Functional Equivalence Coverage Property Proving Virtual Platforms Requirements Equivalence Coverage Assertions Equivalence Regression Timing Analysis 28

Audio Equalizer Bank of 10 filters Controllable by up to +/-6dB 5 pre-programmed user settings for Rock, Pop, Jazz, Classical, Vocal Fits into available FPGA space No dead-locks or unreachable states Sounds good 29

Automatically Measuring Test Coverage Audio Equalizer Automatically collect and report test coverage Missed coverage 100% coverage 30

Test Generation for 100% Coverage Audio Equalizer Not the same as HDL code coverage Automatically generate tests to reach coverage objectives 31

Integrate with HDL Code Coverage Audio Equalizer Integrate with leading HDL Simulators Re-use test benches for equivalence checking --and-- code coverage analysis 32

Best Practice 3 Re-use System Level Test Bench for HDL Verification Model VHDL / Verilog FPGA Requirements Functional Equivalence Coverage Property Proving Virtual Platforms Requirements Equivalence Coverage Assertions Equivalence Regression Timing Analysis On target prototyping 33

HDL cosimulation to verify HDL Re-use System Level Test Bench for HDL Verification Re-use test benches for equivalence checking Integrate with HDL code coverage analysis HDL Cosimulation Flexible test bench creation: closed loop, multi domain Also works with handwritten code Integrate with Modelsim/Questa and Incisive 34

Best Practice 4 Enable regression testing with FPGA-in-the-loop simulation Model VHDL / Verilog FPGA Requirements Functional Equivalence Coverage Property Proving Virtual Platforms Requirements Equivalence Coverage Assertions Equivalence Regression Timing Analysis On target prototyping 35

FPGA-in-the-loop Enable regression testing with FPGA-in-the-loop simulation Re-use test benches for regression testing Integrate with Altera / Xilinx FPGA Development Boards Flexible test bench creation: closed loop, multi domain Also works with handwritten code 36

Automation FPGA-in-the-loop Verification Supported FPGA boards Integration with FPGA development boards Automatic creation of FPGA-in-the-loop verification models 37

Additional Methods for Verification HDL Verification Techniques Generate stimuli-based test benches for standalone verification MATLAB based verification 38

Stimuli-based test benches for standalone verification MATLAB or Simulink Test bench Stimulus MATLAB or Simulink Design Targeted to Hardware Reference Results Can be used in any HDL Simulator Automatically Generated HDL Test Bench Stimulus HDL Design Actual Results Automatically generate selfchecking test benches 39

MATLAB Based Verification Re-use the MATLAB test bench Accelerate Verification with FPGA Hardware Stimulus MATLAB Functions Response Input stimuli Output response Input stimuli Output response 40

FPGA turnkey workflow FPGA on target prototyping Music in Music out Integrate with Altera / Xilinx FPGA Development Boards Stand alone testing of algorithms on FPGA hardware Automated workflow from model to FPGA prototype 41

Summary Best Practice 1: Algorithm and System Design with Fixed-Point Quantization Analysis Best Practice 2: Automatic HDL Code Generation Best Practice 3: HDL Cosimulation Implement Design Best Practice 4: FPGA Hardware-in-the-Loop 42

FLIR Accelerates Development of Thermal Imaging FPGA Challenge Accelerate the implementation of advanced thermal imaging filters and algorithms on FPGA hardware Solution Use MATLAB to develop, simulate, and evaluate algorithms, and use HDL Coder to implement the best algorithms on FPGAs Results Time from concept to field-testable prototype reduced by 60% Enhancements completed in hours, not weeks Code reuse increased from zero to 30% With MATLAB and HDL Coder we are much more responsive to marketplace needs. We now embrace change, because we can take a new idea to a real-time-capable hardware prototype in just a few weeks. There is more joy in engineering, so we ve increased job satisfaction as well as customer satisfaction. Nicholas Hogasten, FLIR Systems 43

Public Trainings in the next Few Months Course Dates Location Statistical Methods in MATLAB 2 Sep 3 Sep Bangalore MATLAB based Optimization Techniques 4 Sep Bangalore MATLAB Fundamentals 23 Sep 25 Sep Delhi Simulink for System and Algorithm Modeling 26 Sep 27 Sep Delhi MATLAB Fundamentals 07 Oct 09 Oct Pune Simulink for System and Algorithm Modeling 10 Oct 11 Oct Pune Generating HDL Code from Simulink 28 Nov 29 Nov Bangalore Email: training@mathworks.in URL: http://www.mathworks.in/services/training Phone: 080-6632-6000 44

Agenda Integrated Workflow for FPGA/ASIC Development Automatic HDL Code Generation & Optimization Refining DUT from floating to fixed point Automatic HDL Code Generation from MATLAB, Simulink, and Stateflow Integrated HDL Verification Automatically Measuring Test Coverage Generating Co-Simulation Test benches FPGA-in-Loop Verification with Xilinx ML 605 FPGA Board Q&A 45

Thank You! 46