adopting model-based design for fpga, asic, and soc ......system architecture system integration...

50
1 © 2015 The MathWorks, Inc. Adopting Model-Based Design for FPGA, ASIC, and SoC Development Fahd Morchid

Upload: others

Post on 09-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

1© 2015 The MathWorks, Inc.

Adopting Model-Based Design for

FPGA, ASIC, and SoC

Development

Fahd Morchid

Page 2: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

2

Agenda

▪ Why Model-Based Design for FPGA, ASIC, or SoC?

▪ Case Study – Pulse Detector

▪ HW/SW Co-Design

▪ Customer results

Just an example, the workflow is the

same for...

Page 3: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

3

Agenda

▪ Why Model-Based Design for FPGA, ASIC, or SoC?

▪ Case Study – Pulse Detector

▪ HW/SW Co-Design

▪ Customer results

Page 4: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

4

FPGA, ASIC, and SoC Development Projects

67% of ASIC/FPGA projects are behind schedule

75% of ASIC projects require a silicon re-spin

Over 50% of project time is spent on verification

Statistics from 2018 Mentor Graphics / Wilson

Research survey, averaged over FPGA/ASIC

84% of FPGA projects have non-trivial

bugs escape into production

Page 5: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

5

SPECIFICATIONS

SPECIFICATIONS

Many Different Skill Sets Need to Collaborate

Algorithms

System Architecture

System Integration

REQUIREMENTSRESEARCHRESEARCH

SPECIFICATIONS

Verification

Analog

Hardware

Embedded

Software

Digital

Hardware

• Poor communication across teams

• Key decisions made in silos

• System-level issues found in late stages

• Hard to adapt to changing requirements

“Rapid innovation under a rapid timeline

– that’s when this flow falls apart.”

Jamie Haas

Allegro Microsystems

Page 6: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

6

DESIGN

SoC Collaboration with Model-Based Design

Algorithms

System Architecture

System Integration

REQUIREMENTSRESEARCHRESEARCH

Analog

Hardware

Embedded

SoftwareDigital

Hardware

Implementation Architectures

Implementation Knowledge

Generate Code

Export Models

Verific

atio

nV

alid

atio

n &

HOW am I

making it?

Is it going to

work?

Have I made

it right?

Am I making

the right

thing?Design Elaboration

SIMULATION

WHAT am I

making?

MAKE IT!

Page 7: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

7

DESIGN

Algorithms

System Architecture

Implementation Architectures

MATLAB Simulink

✓ Large data sets

✓ Explore mathematics

✓ Control logic

✓ Data visualization

✓ Parallel architectures

✓ Timing

✓ Data type propagation

✓ Mixed-signal modeling

General Approach: Use the Strengths of MATLAB and Simulink

DESIGN

Algorithms

System Architecture

Implementation Architectures

Streaming

Algorithms

Streaming Hardware

Architectures

Fixed-Point Hardware

Architectures

Page 8: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

8

Agenda

▪ Why Model-Based Design for FPGA, ASIC, or SoC?

▪ Case Study – Pulse Detector

▪ HW/SW Co-Design

▪ Customer results

Page 9: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

9

Case Study | Pulse Detector

1. Example Overview

2. Reference Pulse Detector

3. Pulse Detector Design

4. Prepare for Hardware Implementation

5. Fixed-point Conversion

6. HDL code generation, synthesis and verification

Page 10: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

10

Case Study | Pulse Detector

1. Example Overview

2. Reference Pulse Detector

3. Pulse Detector Design

4. Prepare for Hardware Implementation

5. Fixed-point Conversion

6. HDL code generation, synthesis and verification

Page 11: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

11

Pulse Detector | Overview

Send Receive Detect

Hardware Implementation

(HDL)

Detector Design

(Simulink)

Reference Design

(MATLAB)

Page 12: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

12

Case Study | Pulse Detector

1. Example Overview

2. Reference Pulse Detector

3. Pulse Detector Design

4. Prepare for Hardware Implementation

5. Fixed-point Conversion

6. HDL code generation, synthesis and verification

Page 13: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

13

Pulse Detector | Reference Design (MATLAB)

Reference

Algorithm

Algorithm

StimulusAnalysis

Software

Algorithm

Page 14: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

14

Pulse Detector | Reference Design (MATLAB)

Algorithm

Stimulus

Verification

“Scoreboard”

Design Under Test

Reference

Algorithm

Streaming

Algorithms

Streaming Hardware

Architectures

Fixed-Point Hardware

Architectures

Self-checking

Page 15: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

15

Verification

“Scoreboard”

Pulse Detector | Reference Design (MATLAB)

Algorithm

Stimulus

SystemVerilog verification environment

Scoreboard

Design Under

Test (DUT) RTLDriver Monitor

Seq.

Items

Scoreboard

▪ Reuse MATLAB/Simulink models in verification

– Scoreboard, stimulus, or models external to the RTL

– Runs natively in SystemVerilog simulator

– Eliminate re-work and miscommunication

– Save testbench development time

– Easy to update when requirements change

HDL

Verifier

DPI C

DPI C

DPI C

HDL

Verifier

DPI C

Reference

Algorithm

Page 16: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

16

MATLAB / Simulink

Pulse Detector | Reference Design (MATLAB)

HDL Simulator

DUT

RTL

HDL Verifier

cosimulation

▪ Co-simulate with 3rd-party HDL simulator

– Reuse MATLAB/Simulink test environment

– Run HDL design in a supported simulator*

– Generate co-simulation infrastructure and

handshaking

– Analyze both the design and test

environment

* Mentor Graphics® ModelSim® or Questa ®

Cadence ® Incisive ® or XceliumTM

Algorithm

Stimulus

Verification

“Scoreboard”

Reference

Algorithm

Page 17: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

17

Case Study | Pulse Detector

1. Example Overview

2. Reference Pulse Detector

3. Pulse Detector Design

4. Prepare for Hardware Implementation

5. Fixed-point Conversion

6. HDL code generation, synthesis and verification

Page 18: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

18

Pulse Detector | Design in SimulinkStreaming Architecture

Page 19: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

19

Pulse Detector | Design in SimulinkStreaming Architecture

Page 20: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

20

Case Study | Pulse Detector

1. Example Overview

2. Reference Pulse Detector

3. Pulse Detector Design

4. Prepare for Hardware Implementation

5. Fixed-point Conversion

6. HDL code generation, synthesis and verification

Page 21: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

21

Pulse Detector | Prepare for Hardware DesignMicro Architecture

In this step, we:

▪ prepare the model for HDL code generation

▪ pipeline the data path using various techniques

▪ add data valid control signal

▪ verify against MATLAB golden reference

Page 22: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

22

Pulse Detector | Prepare for Hardware DesignMicro Architecture

Page 23: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

23

Case Study | Pulse Detector

1. Example Overview

2. Reference Pulse Detector

3. Pulse Detector Design

4. Prepare for Hardware Implementation

5. Fixed-point Conversion

6. HDL code generation, synthesis and verification

Page 24: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

24

Pulse Detector | Fixed-Point Conversion

In this step, we:

▪ convert the model to fixed-point

▪ compare the Simulink fixed-point model to the MATLAB golden reference

Page 25: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

25

Pulse Detector | Fixed-Point Conversion

Page 26: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

26

Some words about Fixed-Point conversion...

Page 27: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

27

Fixed-Point Conversion | Automated Approach

Page 28: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

28

Fixed-Point Conversion | Native Floating-Point

Fixed-Point

Mix Fixed- and

Floating-Point

Saturate on overflow

High dynamic range

HDL Coder Native Floating Point

• Extensive math and trigonometric

operator support

• Optimal implementations without

sacrificing numerical accuracy

• Mix floating- and fixed-point operations

• Generate target-independent HDL

Page 29: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

29

Case Study | Pulse Detector

1. Example Overview

2. Reference Pulse Detector

3. Pulse Detector Design

4. Prepare for Hardware Implementation

5. Fixed-point Conversion

6. HDL code generation, synthesis and verification

Page 30: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

30

Pulse Detector | HDL Code Generation and Verification

In this step, we:

▪ generate HDL code and reports

▪ synthesize the design using Xilinx Vivado

▪ verify the design

Page 31: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

31

Pulse Detector | HDL Code Generation and Verification

Page 32: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

32

Pulse Detector | HDL Code Generation and Verification

Page 33: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

33

Is there more?

Page 34: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

34

Pulse Detector | HDL Code Generation and Verification

Page 35: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

35

Case Study | Pulse Detector

1. Example Overview

2. Reference Pulse Detector

3. Pulse Detector Design

4. Prepare for Hardware Implementation

5. Fixed-point Conversion

6. HDL code generation, synthesis and verification

Page 36: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

36

Case Study | Workflow Summary

Golden

Reference

Hardware

Architecture

Fixed-point

Implementation

HDL Code Generation

and Optimization

Simulink

HDL Coder

Fixed Point

Designer

HDL Verification

and Targeting

MATLAB

Integrated Verification

Page 37: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

37

A few more words about code generation ...

Page 38: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

38

Automatically Generate Production RTL

DESIGN

Algorithms

Implementation Architectures

Streaming

Algorithms

Streaming Hardware

Architectures

Fixed-Point Hardware

Architectures

Implementation

Knowledge

HDL

Coder

Synthesizable RTL

AXI Interfaces

Synthesis scripts

▪ Choose from over 300 supported blocks

– Including MATLAB functions and Stateflow charts

▪ Quickly explore implementation options

▪ Generate readable, traceable Verilog/VHDL

– Optionally generate AXI interfaces with IP core

▪ Production-proven across a variety of

applications and FPGA, ASIC, and SoC targets

Page 39: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

39

Agenda

▪ Why Model-Based Design for FPGA, ASIC, or SoC?

▪ Case Study – Pulse Detector

▪ HW/SW Co-Design

▪ Customer results

Page 40: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

40

HW/SW Design

Page 41: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

41

Model Based Design Workflow for SoCDeploy to Hardware with Coders and HW Support Package

HDL C/C++

Interconnect

FPGA Memory ProcessorGPIO

ADC

DAC

PWMTCP/IPCAN

Algorithmic Model

Algorithmic Code

HW Support Package

(Reference Design)

Hardware Platform

Page 42: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

42

FPGA ARMMemory

Actual Data Exchange Between FPGA and Processor

Alg1 FIFO Alg2

Ts (ns)

Tf (ms)Burst

Frame

Tb (us)Memory

ReaderSample

FIFO size

Other Memory

Readers and

Writers

Other Threads

and Processes

ContentionContention

Buffer1

Buffer2

Buffer3

Buffer4

Data rate?

FIFO size?

Burst size?

Number of

buffers?

How to synchronize

incoming data with task

execution?

Page 43: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

43

SoC Blockset | Model and Simulate SoC Architecture

Page 44: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

44

• Simulate algorithms as well as

hardware/software architecture

➢ Memory

➢ Internal/external connectivity

➢ I/O

➢ Task scheduling

• Deploy on support hardware

• Profile performance using external

mode

Interconnect

FPGA Memory ProcessorGPIO

ADC

DAC

PWMTCP/IPCANTCP/IP

SoC Blockset | Model and Simulate SoC Architecture

Page 45: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

45

SoC Blockset | Example

Latency Requirements

Page 46: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

46

SoC Blockset | Workflow Summary

Page 47: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

47

Agenda

▪ Why Model-Based Design for FPGA, ASIC, or SoC?

▪ Case Study – Pulse Detector

▪ HW/SW Co-Design

▪ Customer results

Page 49: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

49

DESIGN

Getting Started Collaborating with Model-Based Design

Algorithms

System Architecture

System Integration

REQUIREMENTSRESEARCHRESEARCH

Analog

Hardware

Embedded

SoftwareDigital

Hardware

Implementation Architectures

Implementation Knowledge Generate Code

Export

Models

Verific

atio

nV

alid

atio

n &

❑ Refine algorithm toward implementation

❑ Verify refinements versus previous

versions

❑ Generate verification models

❑ Add hardware implementation detail and

generate optimized RTL

❑ Simulate System-on-Chip architecture

➢ Eliminate communication gaps

➢ Key decisions made via cross-skill

collaboration

➢ Identify and address system-level issues

before implementing subsystems

➢ Adapt to changing requirements with agility

Page 50: Adopting Model-Based Design for FPGA, ASIC, and SoC ......System Architecture System Integration RESEARCHRESEARCH REQUIREMENTS SPECIFICATIONS Verification Analog Hardware Embedded

50

Learn More

▪ Visit FPGA & SoC booth!

▪ Next steps to get started with:

– Verification: Improve RTL Verification by Connecting to MATLAB webinar

– Fixed-point quantization: Fixed-Point Made Easy webinar

– Incremental refinement, HDL code generation: HDL self-guided tutorial

– SoC Blockset: Getting Started with SoC Blockset