주요 콘텐츠

programFPGA

R2026b

Program FPGA and set corresponding device tree from processor on SoC board

Since R2022a

    Description

    programFPGA(p,bitFile,dtbFile) programs the FPGA on your SoC device with the bitstream specified by bitFile and sets the device tree for the processor specified by dtbFile.

    example

    programFPGA(p,bitFile,dtbFile,Name=Value) programs the FPGA on the RFSoC device for the specified bitstream and device tree by using name-value arguments.

    example

    Examples

    collapse all

    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);

    Create a hardware processor object to connect to AMD® RFSoC board.

    To connect to the AMD RFSoC board, create a xilinxsoc hardware object for the RFSoC target.

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

    Call programFPGA with the bitstream and device tree files and specify the path to the RF initialization configuration file by using the RFToolConfig name‑value argument. For example, RF_Init.cfg is the RF initialization configuration file in your workspace.

    programFPGA(p,"myBitstream.bit","myDeviceTree.dtb",RFToolConfig="RF_Init.cfg");

    When you program an RFSoC design, programFPGA detects the presence of the RFDC IP in the design and applies the appropriate RFSoC programming sequence. The function then copies the bitstream, device tree, and RF initialization files to the target. The target reboots once and runs the RF initialization. The workflow waits for RF initialization to complete and reports the programming status.

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

    f = fpga(p);

    Input Arguments

    collapse all

    Hardware processor object that represents the connection from MATLAB to the processor on a specific SoC hardware board, specified as a xilinxsoc object or intelsoc object.

    Path to the bitstream file to use to program the FPGA, specified as a character vector or string scalar. You can specify one of these files types:

    • Specify a bitstream file located on either the host computer or in the /mnt SD card folder on the SoC board.​

    • Specify a bitstream file on the SoC board by using a remoteFile(filePath) object, where filePath is the path to the file in the /mnt SD card folder.

    • Specify a bitstream file by either providing the file name when the current folder contains the file or by providing the full file path without changing directories.

    Example: "myBitstream.bit" specifies a bitstream file in the current directory on the host computer

    Example: remoteFile("system.bit") specifies a bitstream file in the current directory on the SoC board

    Example: remoteFile("/mnt/refDesigns/system.bit") specifies a bitstream file in the /mnt/refDesigns folder on the SoC board

    Device tree blob file to use to configure the processor, specified as a character vector or string scalar. You can specify one of these files types:

    • Specify a device tree file located on either the host computer or in the /mnt SD card folder on the SoC board.​

    • Specify a device tree file on the SoC board by using a remoteFile(filePath) object, where filePath is the path to the file in the /mnt SD card folder.

    • Specify a device tree file by either providing the file name when the current folder contains the file or by providing the full file path without changing directories.

    The device tree must contain nodes corresponding to resources in the bitstream that need to be accessed from the processor. For more information, see Generate Device Tree for IP Core.

    Example: "myDeviceTree.dtb" specifies a device tree file in the current directory on the host computer

    Example: remoteFile("devicetree.dtb") specifies a device tree file in the current directory on the SoC board

    Example: remoteFile("/mnt/refDesigns/devicetree.dtb") specifies a device tree in the /mnt/refDesigns folder on the SoC board

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: RFToolConfig="RF_Init.cfg"

    Path to the RF initialization configuration file for RFSoC devices, specified as a character vector or string scalar. Use this argument when programming RFSoC devices that require RF data converter initialization after FPGA programming.

    Example: "RF_Init.cfg"

    Version History

    Introduced in R2022a

    See Also

    Objects

    Functions