Goal Monitoring power consumption on Zynq
Approach Reading voltage, current and power on different voltage rails on Zynq
Benefits Getting information about the power consumption of different parts of a design
Credit  This work has been done under the ENPOWER project (funded by EPSRC) at University of Bristol.

The power monitoring library provides a group of functions to monitor voltage, current and power on each voltage rail available on the ZC702 Evaluation Board.

These functions are divided into two groups. The first group return a value of voltage, current and power values of a given rail. The second group monitors all the voltage rails for a period of time in a separate thread from the application thread.

First group

The fpgacl_read_VCP function can be used to read the voltage, current and power on a given voltage rail. The prototype of the function is as follows:

int fpgacl_read_VCP(unsigned char device, unsigned char page, float *voltage, double *current, double *power);

in which device and page denote the voltage rail which are

The device can be VCCINT_DEVICE,  VCCPINT_DEVICE, VCCAUX_DEVICE, VCCPAUX_DEVICE, and VCC1V5_DEVICE and the corresponding pages are VCCINT_PAGE, VCCPINT_PAGE, VCCAUX_PAGE, VCCPAUX_PAGE and VCC1V5_PAGE.

voltage, current and power are pointers the point to the variable saving the corresponding return values.

Second group

The second group of function enables monitoring the power consumption when running a task on the FPGA or CPU.

Two macros encapsulate all the process of power monitoring which are

POWER_MONITORING_PROLOGUE();

and

POWER_MONITORING_EPILOGUE();

The values of voltage, current and power monitored during this process are saved in a file whose name is define by the variable log_file_name .

The following snippet code shows how to use the power monitoring feature.

Example:

extern char log_file_name[1000];

.....

strcpy(log_file_name, "log_power_monitor_overhead_");
file_power_profile_create(log_file_name);

POWER_MONITORING_PROLOGUE();

mxv_hw(n, m, a_hw, b_hw, c_hw);  // the function under power monitoring process

POWER_MONITORING_EPILOGUE();

The power monitoring library can be found at here.