Accelerate FPGA Prototyping With MATLAB and Simulink
Accelerate FPGA Prototyping With MATLAB and Simulink
Algorithm Development
Key Takeaways
Automation of manual steps in FPGA prototyping allowing shorter iteration cycles Integration of FPGA development tools enhances verification Automatic A t ti HDL Code C d generation ti can b be adapted d t d to meet your requirement
3
Algorithm Development
Fixed Point Conversion HDL Code Creation HDL Verification FPGA Prototyping
MathWorks Solutions
DESIGN
Algorithm Development
Fixed Point Conversion HDL Code Creation HDL Verification FPGA Prototyping
Fixed-Point
IMPLEMENTATION
C, C++ MCU DSP VHDL, Verilog FPGA ASIC SPICE Analog Hardware
INTEGRATION
MathWorks Solutions
DESIGN
Algorithm Development
Fixed Point Conversion HDL Code Creation HDL Verification FPGA Prototyping
Fixed-Point
IMPLEMENTATION
C, C++ MCU DSP VHDL, Verilog FPGA ASIC SPICE Analog Hardware
INTEGRATION
FPGA
Pi = 01100100100010
Simulink Fixed-Point
MathWorks Solutions
DESIGN
Algorithm Development
Fixed Point Conversion HDL Code Creation HDL Verification FPGA Prototyping
Fixed-Point
IMPLEMENTATION
C, C++ MCU DSP VHDL, Verilog FPGA ASIC SPICE Analog Hardware
INTEGRATION
-- -------------------------------------------------------------- File Name: hdlsrc\Stage1 -- Created: 2010-06-22 15:42:41 -- Generated by MATLAB 7.11 and Simulink HDL Coder 2.0 --- --------------------------------------------------------------- -------------------------------------------------------------- Module: Stage1 -- Source Path: m03_ddc_hdlgen/ddc_hdl/Lowpass Filter/Stage1 --- ------------------------------------------------------------LIBRARY IEEE; USE IEEE.std_logic_1164.all; USE IEEE.numeric_std.ALL; IEEE numeric std ALL; ENTITY Stage1 IS PORT( clk : IN std_logic; enb_1_1_1 : IN std_logic; reset : IN std_logic; Stage1_in_re : IN std_logic_vector(17 Stage1_in_im : IN std_logic_vector(17 Stage1_out_re : OUT std_logic_vector(17 Stage1_out_im : OUT std_logic_vector(17 ); END Stage1;
BEGIN -- Block Statements ce_output : PROCESS (clk, reset) BEGIN IF reset = '1' THEN ring g_count <= to_unsigned(1, g 3); ELSIF clk'event AND clk = '1' THEN IF enb_1_1_1 = '1' THEN ring_count <= ring_count(0) & ring_count(2 DOWNTO 1); END IF; END IF; END PROCESS ce_output; phase_0 <= ring_count(0) phase_1 <= ring_count(1)
DOWNTO DOWNTO DOWNTO DOWNTO 0); 0); 0); 0) ----sfix18_En16 sfix18_En16 sfix18_En16 sfix18_En16
input_typeconvert_re _ _ <= signed(Stage1_in_re); _ _ input_typeconvert_im <= signed(Stage1_in_im); Delay_Pipeline_Phase0_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN input_pipeline_phase0_re <= (OTHERS => '0'); input_pipeline_phase0_im <= (OTHERS => '0'); ELSIF clk'event AND clk = '1' THEN IF phase_0 = '1' THEN input_pipeline_phase0_re <= input_typeconvert_re; input_pipeline_phase0_im <= input_typeconvert_im; END IF; END IF; END PROCESS Delay_Pipeline_Phase0_process; Delay_Pipeline_Phase1_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN input_pipeline_phase1_re(0 TO 1) <= (OTHERS => (OTHERS => '0')) input_pipeline_phase1_im(0 TO 1) <= (OTHERS => (OTHERS => '0')) ELSIF clk'event AND clk = '1' THEN IF phase_1 = '1' THEN input_pipeline_phase1_re(0) <= input_typeconvert_re; input_pipeline_phase1_re(1) <= input_pipeline_phase1_re(0); input_pipeline_phase1_im(0) <= input_typeconvert_im; input_pipeline_phase1_im(1) <= input_pipeline_phase1_im(0); END IF; END IF; END PROCESS Delay_Pipeline_Phase1_process;
-----------------------------------------------------------------Module Architecture: Stage1 ---------------------------------------------------------------ARCHITECTURE rtl OF Stage1 IS -- Local Functions -- Type T D Definitions fi iti TYPE input_pipeline_type IS ARRAY (NATURAL range <>) OF signed(17 DOWNTO 0); -- sfix18_En16 -- Constants CONSTANT coeffphase1_1 : signed(17 DOWNTO 0) := to_signed(20991, 18); -- sfix18_En18 CONSTANT coeffphase1_2 : signed(17 DOWNTO 0) := to_signed(65368, 18); -- sfix18_En18 CONSTANT coeffphase2_1 : signed(17 DOWNTO 0) := to_signed(65368, 18); -- sfix18_En18 CONSTANT coeffphase2_2 : signed(17 DOWNTO 0) := to_signed(20991, 18); -- sfix18_En18 CONSTANT coeffphase3_1 : signed(17 DOWNTO 0) := to_signed(89431, 18); -- sfix18_En18 CONSTANT coeffphase3_2 : signed(17 DOWNTO 0) := to_signed(0, 18); -- sfix18_En18 -- Signals SIGNAL ring_count SIGNAL phase_0 SIGNAL phase_1 SIGNAL phase_2 SIGNAL input_typeconvert_re SIGNAL input_typeconvert_im SIGNAL input_pipeline_phase0_re SIGNAL input_pipeline_phase0_im SIGNAL input_pipeline_phase1_re SIGNAL input_pipeline_phase1_im SIGNAL input_pipeline_phase2_re SIGNAL input_pipeline_phase2_im SIGNAL product_phase0_1_re SIGNAL product_phase0_1_im SIGNAL mul_temp SIGNAL mul_temp_1 SIGNAL product_phase0_2_re SIGNAL product product_phase0_2_im phase0 2 im SIGNAL mul_temp_2 SIGNAL mul_temp_3 SIGNAL product_phase1_1_re SIGNAL product_phase1_1_im SIGNAL mul_temp_4 SIGNAL mul_temp_5 SIGNAL product_phase1_2_re SIGNAL product_phase1_2_im SIGNAL mul temp 6
: : : : : : : : : : : : : : : : : : : : : : : : : : :
unsigned(2 DOWNTO 0); -- ufix3 std_logic; -- boolean std_logic; -- boolean std_logic; -- boolean signed(17 DOWNTO 0); -- sfix18_En16 signed(17 DOWNTO 0); -- sfix18_En16 signed(17 DOWNTO 0); -- sfix18_En16 signed(17 DOWNTO 0); -- sfix18_En16 input_pipeline_type(0 TO 1); -- sfix18_En16 input_pipeline_type(0 TO 1); -- sfix18_En16 signed(17 DOWNTO 0); -- sfix18_En16 signed(17 DOWNTO 0); -- sfix18_En16 signed(47 DOWNTO 0); -- sfix48_En48 signed(47 DOWNTO 0); -- sfix48_En48 signed(35 DOWNTO 0); -- sfix36_En34 signed(35 DOWNTO 0); -- sfix36_En34 signed(47 DOWNTO 0); -- sfix48_En48 signed(47 DOWNTO 0); -- sfix48_En48 sfix48 En48 signed(35 DOWNTO 0); -- sfix36_En34 signed(35 DOWNTO 0); -- sfix36_En34 signed(47 DOWNTO 0); -- sfix48_En48 signed(47 DOWNTO 0); -- sfix48_En48 signed(35 DOWNTO 0); -- sfix36_En34 signed(35 DOWNTO 0); -- sfix36_En34 signed(47 DOWNTO 0); -- sfix48_En48 signed(47 DOWNTO 0); -- sfix48_En48 signed(35 DOWNTO 0); -- sfix36 En34
Delay_Pipeline_Phase2_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN input_pipeline_phase2_re <= (OTHERS => '0');
10
Typical HDL designs contain many lines of code Days or maybe weeks to develop? How to implement Fixed Point in HDL? What if the specification changes?
Simulink HDL Coder generates bit-true, cycle-accurate, synthesizable HDL code from Si li k models, Simulink d l Stateflow St t fl charts, h t and d MATLAB code d A Accelerates l generation i and d verification ifi i of f vendor d independent, readable RTL code
12
MathWorks Solutions
DESIGN
Algorithm Development
Fixed Point Conversion HDL Code Creation HDL Verification FPGA Prototyping
Fixed-Point
IMPLEMENTATION
C, C++ MCU DSP VHDL, Verilog FPGA ASIC SPICE Analog Hardware
INTEGRATION
13
HDL Verification
Many stimuli-files from MATLAB These are ideal references which require pre- and post-processing How to analyze results?
15
Re-use of MATLAB/Simulink testbench Extended analysis capabilities Dynamic Testbench (closed loop verification, multi domain) Automatic creation of co-simulation models Integrating handwritten HDL code
16
MathWorks Solutions
DESIGN
Algorithm Development
Fixed Point Conversion HDL Code Creation HDL Verification FPGA Prototyping
Fixed-Point
IMPLEMENTATION
C, C++ MCU DSP VHDL, Verilog FPGA ASIC SPICE Analog Hardware
INTEGRATION
17
FPGA Prototyping
FPGA-in-the-Loop Simulation
20
Summary
Assisted Fixed Point Conversion Automatic HDL Code Generation FPGA Turnkey Flow
Next steps ..
Questions??
23