The AI Engine device has NPI registers
to allow scaling the AI Engine operation
frequency at runtime. The AI Engine driver
provides APIs for you to specify the frequency the application wants to change to.
Internally, it converts the frequency to the scale of the full frequency applied to the
AI Engine device. Then it uses eemi
ioctl
to send and set the quality of service (QoS) request to PLM. PLM
aggregates all the requests from different AI Engine users. If the max of the QoS is changed, it changes the
AI Engine core reference control NPI
register to change the frequency.
On Linux, it is possible to have multiple partitions on the same Linux system.
The Linux kernel AI Engine partition driver
provides ioctl
APIs to the application to set the required frequency of
the partition it owned. The AI Engine device
driver aggregates the required frequency of all the partitions managed in Linux. If the
highest of the required frequency has changed, it converts it to QoS and uses
eemi ioctl
to send the QoS change request to PLM.
The AI Engine driver
API's that allow frequency scaling is exposed to the developer through the command line
utility through which you can control the AI Engine frequency. The Xilinx board utility (xbutil) is a
standalone command line utility that is included with the Xilinx Runtime (XRT) installation package. The xbutil
utility uses the AI Engine SSW driver to enable AI Engine clock frequency scaling at runtime
using the sub-command advanced
to set/get the AI Engine clock frequency. As
shown in following figure, the --get
option can read
the frequency of the given AI Engine partition (in this case whole array is one single
partition) and with the --set
option. You can set the
frequency value (Hz) to set the given AI Engine partition to (for example 100L, 312.5M, 5G).