Managing Clock Frequencies - 2020.2 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
Release Date
2021-03-22
Version
2020.2 English
Important: The --clock options described here are not supported by legacy platforms of Data Center accelerator cards. On older platforms, kernels operate at the default operating frequency of the platform.

Generally, in embedded processor platforms, and also in newer Data Center accelerator cards, the device binary can connect multiple kernels to the platform with different clock frequencies. Each kernel, or unique instance of the kernel can connect to a specified clock frequency, or multiple clocks, and different kernels can use different clock frequencies generated by the platform.

You can specify the kernel frequency during compilation using the --hls.clock command. This lets you compile the kernel targeting the specified frequency, and lets the Vitis HLS tool perform validation of the kernel logic at the specified frequency. This is just an implementation target for compilation, but does provide optimization and feedback.

During the linking process, when the kernels are connected to the platform to build the device binary, you can specify the clock frequency for the kernels using the --clock Options of the v++ command.

  1. Compile the HLS code using the Vitis compiler. For RTL kernels, go to step 2.
    v++ -c -k <krnl_name> --hls.clock freqHz:<krnl_name>
    Note: To change the frequency at which Vitis HLS kernels are compiled, use --hls.clock arg:kernelName. arg must be in Hz (for example, 250000000Hz is 250 MHz).
  2. During linking, specify the clock frequency or clock ID for each clock signal in a kernel with the following command:
    v++ -l ... --clock.freqHz <freqHz>:kernelName.ap_clk

When specifying the clock ID, the kernel frequency is specified by the clock frequency of the specified clock on the platform. When specifying the clock frequency, the platform attempts to create the specified frequency by scaling the platform clocks. In some cases, the clock frequency can only be achieved in some approximation, and you can specify the --clock.tolerance or --clock.default_tolerance to indicate an acceptable range. If the specified clock frequency cannot be scaled within the acceptable tolerance, a warning is issued and the kernel is connected to the default clock.