Stateflow for Signal Processing and Communications Applications with Code Generation Capabilities

Similar documents
Design and Verification of FPGA and ASIC Applications Graham Reith MathWorks

Implementing MATLAB Algorithms in FPGAs and ASICs By Alexander Schreiber Senior Application Engineer MathWorks

Reducing the cost of FPGA/ASIC Verification with MATLAB and Simulink

Model-Based Design for Altera FPGAs Using HDL Code Generation The MathWorks, Inc. 1

How Real-Time Testing Improves the Design of a PMSM Controller

Design and Verification of FPGA Applications

Modelling and Simulation Made Easy with Simulink Tiffany Liang Application Engineer MathWorks

Weapon System Fault Detection, Isolation, and Analysis using Stateflow

Introducing Simulink R2012b for Signal Processing & Communications Graham Reith Senior Team Leader, UK Application Engineering

Finite-State Machine (FSM) Design

Stateflow Best Practices By Michael Burke

Graphical Programming Languages in Model-Based Design Vijay Raghavan Director of Engineering Design Automation

다중센서기반자율시스템의모델설계및개발 이제훈차장 The MathWorks, Inc. 2

Integrated Workflow to Implement Embedded Software and FPGA Designs on the Xilinx Zynq Platform Puneet Kumar Senior Team Lead - SPC

Introduction to C and HDL Code Generation from MATLAB

Model-Based Design for effective HW/SW Co-Design Alexander Schreiber Senior Application Engineer MathWorks, Germany

Hardware-Software Co-Design and Prototyping on SoC FPGAs Puneet Kumar Prateek Sikka Application Engineering Team

Accelerate FPGA Prototyping with

Design and simulate event-driven systems. modes. modes 4. left positions control points. hydraulic pressures

DRYING CONTROL LOGIC DEVELOPMENT USING MODEL BASED DESIGN

UNDERSTANDING MODEL AND CODE BEHAVIOR FOR STATEFLOW CONSTRUCTS

Integrating Mechanical Design and Multidomain Simulation with Simscape

Optimize DSP Designs and Code using Fixed-Point Designer

What s New with the MATLAB and Simulink Product Families. Marta Wilczkowiak & Coorous Mohtadi Application Engineering Group

Robotics System Toolbox

Implementation and Verification Daniel MARTINS Application Engineer MathWorks

Integrating Mechanical Design and Multidomain Simulation with Simscape

Modeling System Architecture and Resource Constraints Using Discrete-Event Simulation

Moving MATLAB Algorithms into Complete Designs with Fixed-Point Simulation and Code Generation

Introduction to Physical Modelling Rory Adams Senior Application Engineer

Simulation, prototyping and verification of standards-based wireless communications

Testing, Validating, and Verifying with Model-Based Design Phil Rottier

Collaboration in Teams: Simulink Projects Demonstration

Virtuelle Inbetriebnahme und Optimierung von Robotersystemen mit Simscape The MathWorks, Inc. 1

Developing AUTOSAR Compliant Embedded Software Senior Application Engineer Sang-Ho Yoon

MathWorks Products and Prices Euro Academic September 2016

Designing and Targeting Video Processing Subsystems for Hardware

Verification and Validation Introducing Simulink Design Verifier

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

Accelerating FPGA/ASIC Design and Verification

Optimization and Implementation of Embedded Signal Processing Algorithms Jonas Rutström Senior Application Engineer

PDHonline Course G349. State Machines. Mark A. Strain, P.E. PDH Online PDH Center

Hardware and Software Co-Design for Motor Control Applications

Designing and Prototyping Digital Systems on SoC FPGA The MathWorks, Inc. 1

Simulink 를이용한 효율적인레거시코드 검증방안

2015 The MathWorks, Inc. 1

MathWorks Products and Prices Euro Academic January 2018

MATLAB/Simulink 기반의프로그래머블 SoC 설계및검증

MathWorks Products and Prices North America January 2018

What s New in Simulink in R2015b and R2016a

What s New in MATLAB & Simulink. Prashant Rao Technical Manager MathWorks India

MathWorks Technology Session at GE Physical System Modeling with Simulink / Simscape

Signal Processing and Computer Vision Using MATLAB and Simulink

State Machine Diagrams

Advanced AC Motor Control S/W Development Sang-Ho Yoon Senior Application Engineer The MathWorks

Model-Based Design for Large High-Integrity Systems: A Discussion on Logic-Intensive Algorithms

Verification and Validation of Models for Embedded Software Development Prashant Hegde MathWorks India Pvt. Ltd.

Model-Based Design for Video/Image Processing Applications

Specifications Part 1

High-Level and Model-Based Design Targeting FPGAs and SoCs

Simulink as Your Enterprise Simulation Platform

Introducing Simulink Release 2012b for Control System Development Mark Walker MathWorks

Accelerating Simulink Optimization, Code Generation & Test Automation Through Parallelization

Model-Based Embedded System Design

Team-Based Collaboration in Simulink Chris Fillyaw Application Engineer Detroit, MI

FSM-based Digital Design using Veriiog HDL

Designing and Analysing Power Electronics Systems Using Simscape and SimPowerSystems

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

Architectural Blueprint The 4+1 View Model of Software Architecture. Philippe Kruchten

Real-Time Workshop Embedded Coder 4

AADECA 2004 XIX Congreso Argentino de Control Automático. Ethernet delay evaluation by an embedded real time Simulink model PC in asynchronous mode

RTL Design (Using ASM/SM Chart)

Sharing and Deploying MATLAB Programs Sundar Umamaheshwaran Amit Doshi Application Engineer-Technical Computing

MathWorks Products and Prices International September 2016

Hardware and Software Co-Design for Motor Control Applications

Model-Integrated Computing for Composition of Complex QoS Applications

Optimizing and Accelerating Your MATLAB Code

Control System Design and Rapid Prototyping Using Simulink Chirag Patel Sr. Application Engineer Modeling and Simulink MathWorks India

UML for Real-Time Overview

Real Time Testing of PMSM Controller using xpc Target Turnkey solution

Hardware Implementation and Verification by Model-Based Design Workflow - Communication Models to FPGA-based Radio

Team-Based Collaboration in Simulink

Targeting Motor Control Algorithms to System-on-Chip Devices

Architectural Blueprint

Model-Based Design for High Integrity Software Development Mike Anthony Senior Application Engineer The MathWorks, Inc.

Verification, Validation and Test in Model Based Design Manohar Reddy

Hardware and Software Co-Design for Motor Control Applications

Accelerating Stateflow With LLVM

ConfigurationDesk/RTI. Compatibility with Toolboxes and Blocksets Provided by MathWorks

ConfigurationDesk/RTI. Compatibility with Toolboxes and Blocksets Provided by MathWorks

Guido Sandmann MathWorks GmbH. Michael Seibt Mentor Graphics GmbH ABSTRACT INTRODUCTION - WORKFLOW OVERVIEW

Reprint. Transmission Systems Prototyping based on Stateflow/Simulink Models

[Sub Track 1-3] FPGA/ASIC 을타겟으로한알고리즘의효율적인생성방법및신기능소개

ECE 2300 Digital Logic & Computer Organization. More Finite State Machines

Modeling a 4G LTE System in MATLAB

Model Based Design Development Environment for Simulink /Stateflow Product Specification

Introduction to System Objects and System Toolboxes Tabrez Khan Application Engineer

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

Recitation Session 6

CS 151 Final. Q1 Q2 Q3 Q4 Q5 Total Credit Score. Instructions: Student ID. (Last Name) (First Name) Signature

Transcription:

Stateflow for Signal Processing and Communications Applications with Code Generation Capabilities MathWorks Korea 이웅재부장 Senior Application Engineer 2013 The MathWorks, Inc. 1

Agenda State Machines in Signal Processing & Communication Systems Overview of State Machine and Flow Graph Comparison between Different Approaches Designing State Machines using Model-Based Design Automatic Code Generation from State Machines Generating C code Generating HDL code Additional Resources 2

Example: WWV Digital Time-Code Receiver 3

Agenda State Machines in Signal Processing & Communication Systems Overview of State Machine and Flow Graph Comparison between Different Approaches Designing State Machines using Model-Based Design Automatic Code Generation from State Machines Generating C code Generating HDL code Additional Resources 4

State Machine in Signal Processing & Communication Applications Defense Industry - ECM, ELINT, Digital Receiver Communication Network System - Router, Ethernet Semiconductor - Microprocessor, SoC, Memories Consumer Electronics - Rice Cooker, Washing Machine Industry Machineries - SMT Machine, PCB Tester, Component Tester 5

Algorithms and Protocols: Signal Processing and Communications Mode/Supervisory Logic Dynamic Data/Signal Path Control System Controller Signal Acquisition and Tracking Call Processing Protocols Control Acknowledgement Schemes (Automatic Repeat Request) Event Driven or Reactive Algorithms Traffic Modeling For these algorithms, a finite state machine paradigm is more appropriate than a signal flow paradigm 6

Example Application: Video Processing Supervisory control logic Increased processing efficiency Advanced visualization 7

Example Application: Bluetooth Transmitter Bluetooth 2.0 with enhanced data rate (EDR) Multiple adaptive modes Scheduling of different signal processing algorithms 9

Agenda State Machines in Signal Processing & Communication Systems Overview of State Machine and Flow Graph Comparison between Different Approaches Designing State Machines using Model-Based Design Automatic Code Generation from State Machines Generating C code Generating HDL code Additional Resources 10

What Is a State Machine? Represent reactive systems that have states or modes States change based on defined conditions and events It can only behave in a predefined number of ways (states) Default transition States Transitions 11

What are Mealy and Moore machines? Mealy: all actions are condition actions output function of state and input Moore: all actions are state actions output function of state only 12

What is a Flow Graph? It represent an algorithm or process like flow chart It is used primarily for modeling stateless logic, where the flow graph maintains no memory of previous inputs or outputs. It can be used to model control flows like if-else condition, for-loop, and while-loop Junction 14

What is Stateflow? : SPC Case Model and simulate decision logic for reactive systems: supervisory/mode control task scheduling dynamic data path control protocol control reactive/event driven algorithm Develop mode-logic using state machines and flow charts Provide diagram animation and integrated debugger 16

How does Stateflow work with Simulink? Simulink is used to respond to continuous changes in dynamic systems. Stateflow is used to respond to instantaneous changes in dynamic systems. Real-world systems have to respond to both continuous and instantaneous changes. suspension dynamics gear changes propulsion system liftoff stages robot kinematics operation modes Use both Simulink and Stateflow so that you can use the right tool for the right job. 18

Agenda State Machines in Signal Processing & Communication Systems Overview of State Machine and Flow Graph Comparison between Different Approaches Designing State Machines using Model-Based Design Automatic Code Generation from State Machines Generating C code Generating HDL code Additional Resources 19

Different way of designing State Machine Provide a natural, graphical language for modeling state machines Simulink blocks State chart MATLAB Function function y = fcn(u) persistent x; if isempty(x) x = 1; end if (x == 1) if (u > 5) x = 2; end else if (u < -5) x = 1; end end if (x == 1) y = 0; else y = 1; end 20

Other Approaches for Modeling Control Logic Simulink C-code ~50 lines 21

22

Other Approaches for Modeling Control Logic Stateflow C-code >1000 lines 23

Agenda State Machines in Signal Processing & Communication Systems Overview of State Machine and Flow Graph Comparison between Different Approaches Designing State Machines using Model-Based Design Automatic Code Generation from State Machines Generating C code Generating HDL code Additional Resources 24

Designing State Machine: Demo National Institute of Standards and Technology (NIST) Time Decoder Radio Station WWV in Boulder, CO Broadcasts frequency reference standards and time code information Referenced to atomic time scales at NIST 25

{ Symbol Synchronization Search Goal: Establish synchronization (stringent) Algorithm: Search for successive edges with ~1 sec separation Symbols 1 sec Leading Edges Time Search Window Reset on false edges 26

Symbol Synchronization 27

Concept Review STATES represent modes of operation Exclusive States (OR) Parallel States (AND) TRANSITIONS represent paths between states FLOW GRAPHS represent complex time and condition based logic Types of functions Graphical MATLAB Simulink Truth Tables 28

Agenda State Machines in Signal Processing & Communication Systems Overview of State Machine and Flow Graph Comparison between Different Approaches Designing State Machines using Model-Based Design Automatic Code Generation from State Machines Generating C code Generating HDL code Additional Resources 29

Code Generation for Stateflow 31

Demo: Sequence Detector 32

Stateflow guidelines for HDL code generation Beware unsupported software constructs Prefer fixed point types to integer types Consider Mealy and Moore state machines when generating HDL code Enable the chart property Execute (enter) Chart at Initialization Parallel states do not imply concurrency Specify a fixed-point constant indirectly in action language by using a fixed-point context-sensitive constant 33

Agenda State Machines in Signal Processing & Communication Systems Overview of State Machine and Flow Graph Comparison between Different Approaches Designing State Machines using Model-Based Design Automatic Code Generation from State Machines Generating C code Generating HDL code Additional Resources 34

Additional Resources Product Web pages: www.mathworks.com/products/stateflow/ http://www.mathworks.com/products/embedded-coder/ http://www.mathworks.com/products/hdl-coder/ Signal Processing and Communications Web page: www.mathworks.com/applications/dsp_comm/ Webinars Recorded: www.mathworks.com/company/events/archived_webinars.html Upcoming: www.mathworks.com/company/events/webinars/upcoming.html MathWorks Training www.mathworks.com/services/training/ Contact your sales rep! 35