Set Up Tools - MATLAB & Simulink (original) (raw)

To generate HDL code, you must configure the tools, libraries, and compilers that you want to use. After you set up the third-party tools, you can prototype the generated code using supported third-party tools and hardware. For more information, see HDL Language Support and Supported Third-Party Tools and Hardware.

Synthesis Tool Path Setup

hdlsetuptoolpath Function

To use HDL Coder™ with one of the supported third-party FPGA synthesis tools, add the tool to your system path using the hdlsetuptoolpath function. Add the tool to your system path before opening the HDL Workflow Advisor. If you already have the HDL Workflow Advisor open, see Add Synthesis Tool for Current HDL Workflow Advisor Session. You cannot set up third-party FPGA synthesis tools in Simulink® Online™.

hdlsetuphlstoolpath Function

To use HDL Coder for SystemC™ code generation, set up the synthesis tool path by using thehdlsetuphlstoolpath function. Add the synthesis tool path before opening the HDL Workflow Advisor.

Add Synthesis Tool for Current HDL Workflow Advisor Session

Simulink to HDL Workflow

  1. At the MATLAB® command line, use the hdlsetuptoolpath function to add the synthesis tool.
  2. In the HDL Workflow Advisor, in the > step, to the right of Synthesis tool, click Refresh.
    The synthesis tool is now available.

MATLAB to HDL Workflow

  1. MATLAB to HDL code generation
    1. At the MATLAB command line, use the hdlsetuptoolpath function to add the synthesis tool.
    2. In the HDL Workflow Advisor, select Code Generation Workflow asMATLAB to HDL. In theSelect Code Generation Target step, to the right of Synthesis tool, click Refresh list.
      The synthesis tool is now available.
  2. MATLAB to SystemC code generation
    1. At the MATLAB command line, use the hdlsetuphlstoolpath function to add the synthesis tool.
    2. In the HDL Workflow Advisor, select Code Generation Workflow asMATLAB to SystemC. In theSelect Code Generation Target step, to the right of Synthesis tool, click Refresh list.
      The synthesis tool is now available.

Check Your Synthesis Tool Setup

To check your Intel® Quartus® Prime Standard synthesis tool setup in MATLAB, try launching the tool with the following command:

To check your Intel Quartus Pro synthesis tool setup in MATLAB, try launching the tool with the following command:

To check your Xilinx® Vivado® synthesis tool setup in MATLAB, try launching the tool with the following command:

To check your Xilinx ISE synthesis tool setup in MATLAB, try launching the tool with the following command:

To check your Microchip Libero® SoC synthesis tool setup in MATLAB, try launching the tool with the following command:

To check your Cadence® Stratus high level synthesis tool setup in MATLAB, try launching the tool with the following command:

Supported Tool Versions

For supported tool versions, see Third-Party Synthesis Tools and Version Support.

HDL Simulator Setup

To open the HDL simulator from MATLAB, enter these commands:

MATLAB Command to Open HDL Simulator

HDL Simulator Command to Open the Simulator
Cadence Incisive® nclaunch (HDL Verifier)
Siemens® ModelSim™ vsim (HDL Verifier)

When cosimulating with Xilinx Vivado simulator, the HDL files are compiled into a shared library (DLL), and you do not need to open the simulator separately.

For example, to open the Siemens ModelSim simulator, enter this command:

vsim('vsimdir','C:\Program Files\ModelSim\questasim\10.5c\win64\vsim.exe')

To learn more about how to set up ModelSim, Questa™, Vivado simulator, or Incisive® for HDL simulation, or for cosimulation with HDL Verifier™, see HDL Simulator Startup (HDL Verifier).

Add Simulation Tool for Current HDL Workflow Advisor Session

MATLAB to HDL Workflow

  1. Set up your simulation tool.
  2. In the HDL Workflow Advisor, in the > task, click Refresh list.
    The simulation tool is now available.

AMD Vitis Model Composer Setup

To generate code for a design containing both AMD® Vitis® Model Composer and Simulink blocks, you must open MATLAB with AMD Vitis Model Composer. For more information, see Vitis Model Composer on the AMD website.

Altera DSP Builder Setup

To generate code for a design containing both Altera® DSP Builder and Simulink blocks, you must open MATLAB with Altera DSP Builder. For more information, see DSP Builder for Intel FPGAs on the Intel website.

FPGA Simulation Library Setup

To map your design to an Altera or a Xilinx FPGA simulator library:

C/C++ Compiler Setup

HDL Coder locates and uses a supported installed compiler. For most platforms, a default compiler is supplied with MATLAB. For a list of supported compilers, see Supported Compilers.

See Also

hdlsetuptoolpath | hdlsetuphlstoolpath

Topics