high-level and model-based design

27
CO-DEVELOPMENT MANUFACTURING INNOVATION & SUPPORT Sander Ter Burg, FPGA System Engineer High-Level and Model-Based Design Targeting FPGAs and SoCs

Upload: others

Post on 15-Oct-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: High-Level and Model-Based Design

CO-DEVELOPMENT MANUFACTURING INNOVATION & SUPPORT

Sander Ter Burg, FPGA System Engineer

High-Level and Model-Based DesignTargeting FPGAs and SoCs

Page 2: High-Level and Model-Based Design

3T B.V.

What we do:

■ Electronic and Embedded Systems

■ Co-Development and Re-design

■ Manufacturing (together with production partners)

■ Consulting & Support

Where we are:

■ Enschede + Eindhoven

More info:

■ www.3T.nl

[email protected]

30 May 2017www.3t.eu 2

Page 3: High-Level and Model-Based Design

Summary

High-Level Design and Synthesis

Model-Based Design

Model-Based Design Examples

■ SCARA Robot Braking Controller

■ Radar Tracking Module

30 May 2017www.3t.eu 3

Page 4: High-Level and Model-Based Design

Traditional HDL Design example

All code written in HDL

No CPUs on-board

HDL to Low Level Logic

HDL = Hardware Description Language

30 May 2017www.3t.eu 4

FPGA Design

HDL

HDLHDL

HDL

Page 5: High-Level and Model-Based Design

High(er)-Level Design example

Higher Level Design Blocks

High-Level Model to HDL

C/C++ code running on a CPU

HLS examples

C/C++ to HDL + synthesis

MATLAB to HDL + synthesis

… to HDL + synthesis

30 May 2017www.3t.eu 5

PSoC

Logic (FPGA)

HDL

HDL

High-Level Model

µC (Arm)

C/C++

Page 6: High-Level and Model-Based Design

High Level Design Tools

For FPGA devices:

Vivado HLS (Xilinx)

HLS Compiler (Intel)

HDL Coder (MathWorks)

and more…

For SoC devices:

SDSoC (Xilinx)

SDK for OpenCL (Intel)

Embedded Coder (MathWorks)

and more…

30 May 2017www.3t.eu 6

Page 7: High-Level and Model-Based Design

High Level Design Pros …

Well suited for complex mathematical problems

Fast Functional Iterations

Freedom of implementation (CPU and/or Logic)

Simulation time reduction (in software)

Early resource estimation

HDL Co-Simulation in software environment

Software Engineers can now write Hardware

30 May 2017www.3t.eu 7

Page 8: High-Level and Model-Based Design

High Level Design Cons …

Hardware mind-set still needed

Code restructuring needed

Generated HDL is not very readable

Less suitable for (peripheral) interface controllers

But… tools keep getting better

30 May 2017www.3t.eu 8

Page 9: High-Level and Model-Based Design

Model-Based Design

A form of High-Level Designing

Mathematical and visual design method

To design:

■ Complex controllers

■ Signal processing

■ Communication systems

Applications fields examples:

■ Industrial

■ Aerospace

■ Automotive

30 May 2017www.3t.eu 9

Page 10: High-Level and Model-Based Design

Real vs. Virtual World

30 May 2017www.3t.eu 10

ControllerModel

PlantModel

ApplicationModel

Plant ApplicationController

VirtualWorld

RealWorld

Page 11: High-Level and Model-Based Design

Model-Based Design

Multidisciplinary Design Approach

Design with Virtual Models (without hardware)

Simulation in the Virtual environment

Models are always a complexity / effort trade-off

Controller Model as good as your Plant/Appl. Model

30 May 2017www.3t.eu 11

Page 12: High-Level and Model-Based Design

Model-Based Design Examples

SCARA Robot Braking Controller

Radar Tracking Module

30 May 2017www.3t.eu 12

Page 13: High-Level and Model-Based Design

SCARA Robot Braking Application

Move intermediate semiconductor products

Controlled emergency braking

Braking Requirements:

■ Follow robot trajectory while braking

■ Deviation from trajectory < 1mm

■ Rest is under NDA…

Customer provided Mechanical Models (in MATLAB Simulink)

■ SCARA Motor Model

■ Controller Model

30 May 2017www.3t.eu 13

Page 14: High-Level and Model-Based Design

Simulink Model of Plant and Controller

30 May 2017www.3t.eu 14

Braking Controller(Simulink)

Torque SCARA Motor Model(Simulink)Angle

Angular Velocity

Page 15: High-Level and Model-Based Design

Simulink Braking Controller Model

30 May 2017www.3t.eu 15

Braking Controller Model

Torque

Angle

AngularVelocity

Hardware Model

FPGA Model E2MDACADCM2E

Page 16: High-Level and Model-Based Design

Simulink FPGA Model

30 May 2017www.3t.eu 16

FPGA Model

Control / Status / Communication Logic

Regulator Model

Calculate Angle +

Direction

ADC Control

Braking Controller

DAC Control

Comm.

MotorFeedback

MotorController

Page 17: High-Level and Model-Based Design

Simulink Braking Regulator (Model to HDL)

30 May 2017www.3t.eu 17

Variable Time StepFloating Point Model

Fixed Time StepFixed Point HDL Code

Fixed Time StepFixed Point Model

Fixed Time StepFloating Point Model

Page 18: High-Level and Model-Based Design

Braking Regulator HDL Co-Simulation

30 May 2017www.3t.eu 18

Braking Controller(Simulink)

SCARA Motor Model(Simulink)

Torque

Angle

Angular Velocity

Regulator Model HDL Simulation

(ModelSim)

Page 19: High-Level and Model-Based Design

Design and Verification Summary

From “High Level Model” to “Generated HDL”

■ Various Model Translations

Generated HDL for Regulator Model (HDL Coder)

■ Angle/Direction Calculation + Braking Controller

Hardcoded Design Blocks (non HDL Coder)

■ ADC / DAC Control + Control / Status / Communication Blocks

Design Verification:

■ Co-Simulation + Hardware-in-the-Loop

Design Fine-tuning:

■ Timing Closure, Resource Sharing,

■ Xilinx IP Instantiation for FFT

30 May 2017www.3t.eu 19

Page 20: High-Level and Model-Based Design

Radar Tracking Module example

For Traffic Data processing

Customer provided a High-Level Model (MATLAB) including:

■ Radar Module

■ Signal Processing

■ Tracking Algorithm

System-on-Module Hardware Target

■ Enclustra Mars ZX3

30 May 2017www.3t.eu 20

Page 21: High-Level and Model-Based Design

SoC implementation setup

eCos RTOS on CPU1 ■ For real-time Control and Communication

■ Only available RTOS for this SoM

Tracking Algorithms on CPU2

■ Generated C/C++ from Matlab Model

■ Running bare-metal on CPU2

Image Processing in FPGA LOGIC

■ 2D Traffic Data Matrices Operations

30 May 2017www.3t.eu 21

FPGA LOGIC

Dual ARM Core

CPU 1

Control

CPU 2

Tracking

Ethernet

Data Acquisition

Image Processing

Ext. Buffers

Page 22: High-Level and Model-Based Design

Radar Tracking Model

30 May 2017www.3t.eu 22

Radar Tracking Model (MATLAB)

Image Processing Model

Dec. FFT 1 FFT 2Tracking

Algoritme

Radar Model

2D Traffic Data

Intermediate Result Files

Page 23: High-Level and Model-Based Design

Image Processing Module Simulation

Intermediate Model Results used in HDL TestBench

HDL TestBench Results verified in the Model

30 May 2017www.3t.eu 23

Image Processing Block(Decimate / FFT1 / FFT2)

File In File OutHDL TestBench

Page 24: High-Level and Model-Based Design

Hardware-in-the-Loop Verification

30 May 2017www.3t.eu 24

FPGA LOGIC

Dual ARM Core

CPU 2

Tracking

CPU 1

Control

Ethernet

Data Acquisition

Data Control

External Buffers

Decimate FFT 1 FFT 2

Page 25: High-Level and Model-Based Design

Tooling

30 May 2017www.3t.eu 25

Mathworks Tools:

■ MATLAB: Complete Radar Tracking Model

■ Embedded coder: Tracking Algorithms Implementation

■ Instrument Control toolbox: Hardware-in-the-Loop Verification

■ Signal processing toolbox: Digital Filter Design

Xilinx Vivado:

■ Xilinx IP: FFTs for Image Processing

■ Xilinx IP: Gbit Ethernet for UDP communication

■ Custom IP: Decimate for Image Processing

Xilinx to MATLAB: Xilinx FFT C-model converted to MATLAB file

Page 26: High-Level and Model-Based Design

Summary and More Info:

High-Level Design and Synthesis

Model-Based Design

SCARA Robot Braking Controller

Radar Tracking Module

Email : [email protected]

Web : www.3T.nl

Stand: 7A108

Next Up:

Herman Kuster

Topic Embedded Systems

Hardware platform for industrial ultrasound steel plate Inspection

30 May 2017www.3t.eu 26

Page 27: High-Level and Model-Based Design

3T B.V.Institutenweg 1 Esp 4017521 PH Enschede 5633 AJ EindhovenThe Netherlands The Netherlands

T. +31 53 4 33 66 33F. +31 53 4 33 68 69E. [email protected]. www.3t.eu