FPGA AI Suite: Getting Started Guide

ID 768970
Date 4/21/2025
Public
Document Table of Contents

6.8. Building an FPGA Bitstream for the PCIe Example Design

To complete this portion of the tutorial, you must meet the following prerequisites:
  • You must have a license for bitstream generation of the FPGA AI Suite IP.
  • You must have a specific version of Quartus® Prime Pro Edition installed:
    • The PCIe-based design example for Agilex™ 7 devices requires Quartus® Prime Pro Edition Version 22.4 or later. This document assumes that Version 25.1 is used.
  • You must have the following paths included in your $PATH environment variable:
    • quartus/bin
    • qsys/bin

If you do not have a license for FPGA AI Suite, the generated IP has a built-in inference-count limitation. Any inference operations that occur after the limit is reached generate an error message that indicates that a license is required. To reset the inference count limit, you must reprogram the bitstream onto the FPGA device.

Building an FPGA Bitstream for the PCIe-Based Design Example for Agilex™ 7 Devices

Run the following command for the PCIe-Based Design Example for Agilex™ 7 devices:
cd $COREDLA_WORK/demo

dla_build_example_design.py build agx7_de10_pcie \
    $COREDLA_ROOT/example_architectures/AGX7_Performance.arch \ 
    --output-dir $COREDLA_WORK/demo/my_bitstreams/

If the AOCL_BOARD_PACKAGE_ROOT environment variable is not set, the dla_build_example_design.py command returns an error message. To set this environment variable, review the instructions in Additional Software Prerequisites for the PCIe-based Design Example for Agilex 7 Devices.

The dla_build_example_design.py command has a number of actions it can take. For a full list of actions, run the following command:
dla_build_example_design.py --help
For a list of options supported by an action, run the following command:
dla_build_example_design.py <action> --help
For example, the dla_build_example_design.p build command provides a --seed option that you can use to vary the Quartus® Prime random seed.

This commands places the bitstreams into the my_bitstreams directory. The bitstream is named AGX7_Performance.sof.

After the bitstream is built, you must program it onto the FPGA following the instructions in section Programming the FPGA Device.

Building an FPGA Bitstream for the PCIe-Based Design Example for Agilex™ 7 Devices (WSL 2)

Important: The PCIe-Based Design Example for Agilex™ 7 devices explicitly supports a Windows* Subsystem for Linux 2 (WSL 2) environment. To compile this design example in WSL 2 environment, you must install Quartus® Prime Pro Edition for Windows* on the same system as your WSL 2 environment.
To build the FPGA bitstream for the PCIe-Based Design Example for Agilex™ 7 devices in a WSL 2 environment:
  1. On your Microsoft* Windows* system, start an Ubuntu* 20.04 terminal session.
  2. At the Ubuntu* command prompt, run the following commands:
    cd $COREDLA_WORK/demo
    
    dla_build_example_design.py build agx7_de10_pcie \  
      $COREDLA_ROOT/example_architectures/AGX7_Performance.arch \
      --wsl \
      --skip-compile \
      --o ./demo/my_bitstreams \
  3. Follow the instructions provided by the command output. The provided instructions guide you through the following tasks:
    • Compiling the bitstream with the quartus_sh command from a Windows* command prompt.
    • Generating a QoR report.
    WSL 2 Restrictions:
    • When you specify the --wsl option of the dla_build_example_design.py command, you cannot specify an absolute path in the -o/--output-dir option due to limitations in how WSL maps between guest and host paths.
    • Not all FPGA AI Suite design examples support WSL 2. For a list of design examples that support WSL 2, run the following commands:
      cd $COREDLA_WORK/demo
      
      dla_build_example_design.py list --supports-wsl2