Main Content

fpga

Access target FPGA or SoC device from MATLAB

Description

This object represents a connection from MATLAB® to the target FPGA or SoC device. To interact with the target device, use this object with the functions listed in Object Functions.

Creation

Description

example

hFPGA = fpga(Vendor) creates a hardware object that you can use to connect to your target Intel® or Xilinx® pure-FPGA device.

example

hFPGA= fpga(p) creates a hardware object by taking in a processor connection object intelsoc or xilinxsoc that you can use to connect to your target Intel or Xilinx SoC device.

Input Arguments

expand all

Connect to an Intel or Xilinx pure-FPGA target device from MATLAB.

When connecting to an SoC board, specify a processor connection object as the input.

Example: hFPGA = fpga("Intel")

Data Types: string | char

For SoC boards, specify a processor connection object as the input when creating the FPGA connection object. Pass in a xilinxsoc object for Xilinx SoC board. Pass in an intelsoc object for an Intel SoC board.

Example: hFPGA = fpga(p)

Output Arguments

expand all

Connection from MATLAB to the FPGA on the Xilinx or Intel board. You can use this connection to interact with the hardware board and attached devices.​

Object Functions

Use the object functions to interact with your FPGA or SoC device.

addAXI4SlaveInterfaceWrite data to IP core or read data from IP core using AXI4 or AXI4-Lite interface
addAXI4StreamInterfaceWrite data to IP core or read data from IP core using AXI4-Stream interface
mapPortMaps a DUT port to specified AXI4 interface in HDL IP core
writePortWrite data to a DUT port from MATLAB
readPortReads output data and returns it with the port data type and dimension
releaseRelease the hardware resources associated with the fpga object

Examples

collapse all

Create an fpga object to connect to a Xilinx target device.

Create an fpga object with Vendor as Xilinx.

hFPGA = fpga("Xilinx")
hFPGA = 

  fpga with properties:

       Vendor: "Xilinx"
   Interfaces: [0x0 fpgaio.interface.InterfaceBase]

    

Create an fpga object to connect to an Intel target.

Create an fpga object with Intel as Vendor.

hFPGA = fpga("Intel")
hFPGA = 

  fpga with properties:

       Vendor: "Intel"
   Interfaces: [0x0 fpgaio.interface.InterfaceBase]

    

Create a hardware processor object to connect to a Xilinx SoC board. You can use the object to program your FPGA on-board the SoC board at the MATLAB command-line and to create an fpga object that connects to the FPGA through the processor on the SoC board.

Create a Xilinx processor hardware object and connect to the processor on-board the Xilinx SoC board.​

p = xilinxsoc('192.168.1.101', 'root', 'root');

Program the FPGA and set the corresponding device tree from processor on the SoC board by using the xilinxsoc object function programFPGA.

programFPGA(p, "myBitstream.bit", "myDeviceTree.dtb");

For more information on device trees, see Generate Device Tree for IP Core.

Connect to the FPGA on-board the SoC board by using the fpga function. Use the processor hardware object p as an input to the fpga function.

f = fpga(p);

Version History

Introduced in R2020b