Accelerator Functional Unit Developer’s Guide for Intel® FPGA Programmable Acceleration Card

ID 683129
Date 7/20/2020
Public
Document Table of Contents

5.3.2.1.7. Specify AFU User Clock Timing

The clocks provided to the AFU by the clocks device interface are fixed in frequency except for the following user clocks:
  • uClk_usr
  • uClk_usrDiv2
The AFU specifies the frequency for uClk_usr in its platform configuration file using the following key:value pairs:
afu-image:clock-frequency-high:[<float-value>|”auto”|”auto-<float-value>”]

afu-image:clock-frequency-low:[<float-value>|”auto”|”auto-<float-value>”]

The above key:value pairs drive timing closure on the user clocks during AF compilation and are used to bound the frequency value configured in the PLL circuits of the target hardware platform that provides the user clocks through the clocks interface. The chosen frequency may vary in each compilation.

Setting the value field to a float number (e.g., 200.0 to specify 200 MHz) drives the AF generation process to close timing within the bounds set by the low and high keys and set in the AF’s JSON metadata to specify the user clock PLL circuit frequency values.

Below is an example of .json file that sets the AFU uClk frequency to 300 MHz and uClk_div2 to 200 MHz. It also operates the CCI-P interface on uClk instead of the default pClk clock domain.
{
   "version": 1,
   "afu-image": {
      "power": 0,
      "clock-frequency-high": "300",
      "clock-frequency-low": "200",
      "afu-top-interface":
         {
            "class": "ccip_std_afu"
            "module-ports" :
               [
                  {
                     "class": "cci-p",
                     "params":
                        {
                           "clock": "uClk_usr"
                        }
                  }
               ]
         },
      "accelerator-clusters":
         [
            {
               "name": "a_afu",
               "total-contexts": 1,
               "accelerator-type-uuid": "64e38106-4910-4488-ae90-94bfe46abfb3"
            }
         ]
   }
}

Below is an example of .json file that sets the AFU uClk frequency to 300 MHz or below and uClk_div2 to 150 MHz or below. The auto setting allows the build flow to make adjustments to the frequency in the event that timing cannot be met. It also operates the CCI-P interface on pClk and the local SDRAM on the uClk clock domain instead of the default SDRAM domain.
{
   "version": 1,
   "afu-image": {
      "power": 0,
      "clock-frequency-high": "auto-300",
      "clock-frequency-low": "auto-150",
      "afu-top-interface":
         {
            "class": "ccip_std_afu_avalon_mm"
            "module-ports" :
               [
                  {
                     "class": "cci-p",
                     "params":
                        {
                           "clock": "pClk"
                        }
                  },
                  {
                     "class": "local-memory",
                     "params":
                        {
                           "clock": "uClk_usr"
                        }
                  }
               ]
         },
      "accelerator-clusters":
         [
            {
               "name": "b_afu",
               "total-contexts": 1,
               "accelerator-type-uuid": "233254b9-7db4-42a2-91db-1f1c53d12a76"
            }
         ]
   }
}
Warning: AFU developers must ensure the hardware design meets timing by analyzing the static timing reports in Timing Analyzer. AFU developers must inform software developers of the maximum operating frequency (Fmax) of the user clocks so that the maximum frequency never exceeds. Exceeding the Fmax of any clock leads to indeterministic behavior of the accelerator and potentially the overall system.
Note:

AFUs that use uClk or uClk_div2 may not have accurate timing analysis results shown in the Intel® Quartus® Prime timing summary. This is a result of PLL tuning post compilation that occurs to determine if your AFU meets timing. You must either load the compiled design in Timing Analyzer or view the results of the /build/output _files/timing_report directory. Each of these methods accounts for the uClk and uClk_div2 frequencies being adjusted. To determine if there are any failing paths in your design, you can inspect the file /build/output_files/timing_report/clocks.sta.fail.summary. If this file is empty then there are no timing failures in the design.

Note: There are two clock sources provided for the user clock. Clk_1x and Clk_2x. The high setting controls the Clk_2x and low setting controls the Clk_1x. There is a fixed relationship between these two clocks, except when low clock exceeds 300 MHz, then the high clock frequency matches the low clock frequency.

The "auto" setting enables the auto-timing closure mode during AF generation. The AF generation build process automatically converge on a maximum frequency of operation on the user clocks and generate AF JSON metadata to specify the auto-timing closure frequency achieved to OPAE tools.

You can combine the "auto" mode with an upper bound specification using the "auto-<float-value>" format (e.g., "auto-300" to specify auto-timing closure bounded to 300MHz).

For example, the hello_mem_afu sample AFU synchronizes all interfaces to uClk_usr and uses auto-timing closure mode:

$OPAE_PLATFORM_ROOT/hw/samples/hello_mem_afu/hw/rtl/hello_mem_afu.json