Hardware-Software Implementation With Model-Based

advertisement
®
®
Sudhir Sharma
Product Manager,
HDL Code Generation And Verification
The MathWorks
© 2007 The MathWorks, Inc.
Hardware-Software Implementation With
Model-Based Design
®
®
Agenda
ƒ What is the System Design Challenge
ƒ Solutions for Embedded Software Development
ƒ Automatic Code Generation
ƒ Verification
ƒ Solutions for Hardware Development
ƒ Automatic Code Generation
ƒ Verification
2
®
®
System design to implementation gap
Algorithm
Algorithm and
and System
System Design
Design
HDL
C
MCU
DSP
FPGA
ASIC
3
®
®
Integrated Design Flow for Embedded Software
and Hardware
„
Verify the software implementation
against the system model
„
Verify the hardware
implementation against the system
model
Simulink
Simulink HDL
HDL Coder
Coder
Co-simulation links
Co
Co-simulation
links
Generate
Automatically generate production
software for embedded processors
Real-Time Workshop
Real
Real-Time
Workshop
Embedded
Embedded Coder,
Coder,
Targets,
Links
Targets, Links
Generate
„
MATLAB
MATLAB®® and
and Simulink
Simulink®®
Algorithm
Algorithm and
and System
System Design
Design
HDL
C
MCU
Verify
Design, simulate, and validate
system models and algorithms in
MATLAB and Simulink
Verify
„
DSP
FPGA
ASIC
4
®
®
Case Study: Sobel Edge Detection Algorithm
5
®
®
Floating-Point System Specification
ƒ Start by developing a golden specification
6
®
®
Fixed-Point Modeling
Floating-point
model
Fixed-point
model
7
®
®
Fixed-Point Modeling
Floating-point
model
Fixed-point
model
8
®
®
Implementation on DSP, GPP, or an FPGA?
Fixed-point
model
9
®
®
Agenda
ƒ What is the System Design Challenge
ƒ Solutions for Embedded Software Development
ƒ Automatic Code Generation
ƒ Verification
ƒ Solutions for Hardware Development
ƒ Automatic Code Generation
ƒ Verification
10
®
®
Implementation on DSP and GPP
Fixed-point model
Code generation
options
and preferences
Select target or flavor
of generated code
11
®
®
Code Execution on Target and Profiling
ƒ Build and execute
ƒ Auto-generate ‘C’ and ASM
ƒ Integrate RTOS and scheduler
ƒ Create full CCS project
ƒ Invoke compiler, linker, and
download code
ƒ Run on target
ƒ Profile code performance
System
System profiling
profiling
includes entire DSP
application code
Subsystem profiling
12
®
®
Design Verification and Visualization:
Simulink as verification test bench
Processor
Processor and
and hardware-in-thehardware-in-theloop
loop testing,
testing, simulation,
simulation,
visualization,
visualization, and
and verification
verification of
of
embedded
embedded software
software with
with Simulink
Simulink
Simulink test bench
Device or design
under test (DUT)
Simulink system design
embedded on DSP
13
®
®
Review: Code Generation for Embedded Software
ƒ Code Generation
ƒ Real Time Workshop – ANSI/ISO C code for rapid prototyping, acceleration
ƒ Real Time Workshop Embedded Coder – Embedded deployment
ƒ Links
ƒ Link for Altium TASKING
!
ƒ Link for Analog Devices VisualDSP++
New
ƒ Link for TI Code Composer Studio
ƒ Targets
ƒ
ƒ
ƒ
ƒ
Target for TI C6000 DSP
Target for TI C2000 DSP
Target for Infineon C166 Microcontrollers
Target for Freescale MPC5xx Microcontrollers
14
®
®
Agenda
ƒ What is the System Design Challenge
ƒ Solutions for Embedded Software Development
ƒ Automatic Code Generation
ƒ Verification
ƒ Solutions for Hardware Development
ƒ Automatic Code Generation
ƒ Verification
15
®
®
Code Generation for Hardware
Simulink HDL Coder
Correct-by-construction
VHDL and Verilog code
Generated Verilog code
Simulink
data path
Stateflow
control logic
16
®
®
Fixed-Point Implementation on an FPGA
Floating-point
model
Fixed-point
model
Hardware
specific
model
17
®
®
Design Space Exploration
ƒ Speed
How fast can this design run?
ƒ Area
Can I use a smaller chip?
ƒ Power
Can I target a mobile device?
ƒ Implementation Alternatives
Sum & Product: Linear, Cascade, and Tree
Gain: Multiplier, CSD, Factored-CSD
Minimum/Maximum: Tree and Cascade
Lookup Table: Inline or hierarchical
18
®
®
Code Generation Options
Select subsystem, target
language, directory
Select output options
Check model for errors
Generate HDL Code
19
®
®
More Code Generation Options
Select reset and
clock options
Set language-specific
options: input/output
datatypes, timescale
directives, …
20
®
®
Generate HDL Test Bench
Self-checking HDL test bench compares
Simulink results to HDL results
21
®
®
Automatic HDL Code Generation
ƒ ‘Correct-by-construction’
ƒ
ƒ
ƒ
Matches Fixed-Point System Model
Faster design implementation
Reduces verification burden
ƒ Benefits Include:
1
Rapid FPGA implementation
Automatic
Automatic
HDL
HDL
2
Reference code for HDL engineers
Automatic
Automatic
HDL
HDL
Hand
Hand
Customized
Customized
HDL
HDL
Co-Simulate
Co-Simulate
22
®
®
Verification with system specification
Link for ModelSim
23
®
®
Making full use of the system model
ƒ Promotes parallelism in design and verification tasks
ƒ Improves focus on critical areas
Verify
Verify Interfaces
Interfaces
System
System
metrics
metrics
24
®
®
Making full use of the system model
ƒ Promotes parallelism in design and verification tasks
ƒ Improves focus on critical areas
ƒ Accelerates verification at all levels
25
®
®
Making full use of the system model
ƒ Promotes parallelism in design and verification tasks
ƒ Improves focus on critical areas
ƒ Accelerates verification at all levels
ƒ Supports re-use and “what-if” scenarios
26
®
®
Implementation on an FPGA
27
®
®
Review: Code Generation for Hardware
ƒ Code Generation
w!
ƒ Simulink® HDL Coder – FPGA and ASIC deployment using VHDL Ne
and Verilog
ƒ Filter Design HDL Coder – Filter implementation from MATLAB
ƒ Links
ƒ Link for Mentor ModelSim
!
ƒ Link for Cadence® Incisive® New
28
®
®
Summary
Simulink
SimulinkHDL
HDLCoder
Coder
Link
for
ModelSim®
®
ModelSim
Link for ModelSim®
®®Incisive®®
Link
for
Cadence
Link for Cadence Incisive
Generate
HDL
C
MCU
Verify
Real-Time Workshop
Real
Real-Time
Workshop
Embedded
EmbeddedCoder,
Coder,
Targets,
Targets,Links
Links
Generate
ƒ Accelerate product
development using
Model-Based Design
MATLAB
MATLAB®® and
and Simulink
Simulink®®
Algorithm
Algorithm and
and System
System Design
Design
Verify
ƒ Design and verify
software and hardware
from MATLAB and Simulink
DSP
FPGA
ASIC
29
Download