Targeting FPGA & SoC Hardware Overview - MATLAB & Simulink (original) (raw)

Target an FPGA or SoC device by following the steps that design and deploy your algorithm specifically on hardware. You start with a Simulink® model or MATLAB® function, choose a hardware platform to target, and follow the Hardware-Software Co-Design workflow. Explore the best ways to partition and deploy your design by iterating through these steps.

Targeting FPGA & SoC Hardware Worfklow

Choose your target platform. After modeling your design in Simulink or as a MATLAB function, decide what target platform you want to deploy your design to. Consider:

Hardware-Software Co-Design

The Hardware-Software Co-Design workflow is broken into two stages:

Prototype and Deploy HDL Algorithm for an FPGA

Prepare Model for Deployment

For the model and design of your algorithm to be deployable on your target device, these are the high-level tasks:

  1. Partition your design for hardware and software components of your target hardware, if you are using a platform containing a processor and an FPGA, such as an SoC device. You can partition your design to generate the hardware that targets the FPGA and the software that runs on the embedded processor.
  2. Map the inputs and outputs of your model to hardware interfaces, such as AXI4 interfaces, push buttons, and LEDs. The generated design can then communicate with the rest of the hardware system when it is deployed. For more information, see Target Platform Interfaces.

Prepare Model for Deployment Workflow

For an example on preparing a model for deployment, see Get Started with IP Core Generation from Simulink Model.

Generate IP Core and Bitstream

Once your design is prepared for deployment, you can use the HDL Workflow Advisor to:

Generate IP core and bitstream workflow

For an example on generating an IP core and bitstream, see Get Started with IP Core Generation from MATLAB Function.

Run and Verify IP Core on Target Hardware

Run and verify the generated bitstream from your IP core design on your target hardware:

  1. Prepare your target hardware by connecting it to the host machine. If you are using a platform containing an FPGA and processor, such as an SoC device, download a Linux® image for the processor. For more information, seeGuided Hardware Setup for AMD Boards for Xilinx Zynq® Platforms or Guided Hardware Setup for Intel Boards for Intel SoC Devices.
  2. Establish a JTAG or Ethernet connection from your host machine to the target hardware.
  3. Program your target device.
  4. Prototype, debug, and verify your design on your target hardware by using one of these prototyping approaches:
    • FPGA I/O. You can use the host interface model or host interface script generated by the HDL Workflow Advisor to communicate between your host PC, running MATLAB and Simulink, and the generated IP core deployed on your FPGA.
    • AXI Manager
    • FPGA Data Capture
    • FPGA-in-the-Loop (FIL)
    • Software Interface Model Generation, see Configure IP Core for Software Interface.

Run and Verify IP Core on Target Hardware Workflow

For an example, see Prototype Generated IP Core on Hardware using FPGA I/O.

Deploy C Algorithm for Processor

Configure Software Interface to FPGA

To target a complete hardware-software system, HDL Workflow Advisor generates a software interface model from your original Simulink model. The software interface model can be used for deployment to the on-board processor of your target platform. This model contains properly configured device drivers for the processor on-board your SoC device or target platform. If you are targeting an SoC device, this model is the second model required for the hardware-software design. The first model is the original model with your HDL algorithm to target the on-board FPGA. This software interface model targets your processor and communicates between the software deployed to the processor and the generated IP core deployed to the FPGA.

Configure Hardware Software Interface Workflow

For more information, see Generate Software Interface Model to Probe and Rapidly Prototype HDL IP Core.

Hardware-Software Deployment

Generate C code (requires Embedded Coder®) from your software interface model and use external mode or processor-in-the-loop (PIL) mode to deploy and run your hardware-software model on target hardware. The deployable design for your SoC device consists of:

Hardware-Software Deployment Workflow

The deployment of your complete partitioned design into generated C code for the processor, from the software interface model, and a bitstream for the on-board FPGA, from your original model containing your IP core, enables you to run your algorithm on board an SoC or a Simulink Real-Time target machine that has FPGA I/O boards.

For an example, see Debug IP Core Using Hardware-Software Deployment.

Create Custom Hardware Platform

If there are no platforms already available for your hardware, you can define a custom hardware platform to use with the Hardware-Software Codesign workflow. A custom hardware platform creates flexibility to define your hardware system and deploy your design. For example, you can define a custom platform when deploying to production hardware. Creating a hardware platform consists of creating a new board definition to describe your hardware and creating one or more new reference designs for your board. You can also create new reference designs for an existing board.

Create a custom hardware platform workflow

A reference design provides a level of abstraction between your algorithmic IP core and the hardware board, making it easier and more efficient to design an algorithm to deploy on hardware. The reference design acts as the layer between your algorithm and the hardware platform, which you can use to leverage resources within your hardware without having to model these specific hardware resources in your design. You can focus on your algorithm design without implementing low-level details of the hardware. You can also retarget your algorithm to different hardware. For example, you can retarget your algorithm design when you transition from an evaluation board used for prototyping to production hardware.

IP Core, Reference Design, and Hardware Board Stack Image

For more information, see Board and Reference Design Registration System.

See Also

Topics