A script for reading current values using the Power Monitor
Important: Request for Information
This work would be much more reliable if we had more information about the System Controller design. The system controller is implemented in a MAX II device, in the boards with power monitoring capability.
Some kits from Altera® include an LTC2148 ADC whose differential inputs are connected to shunt resistors in series with the power rails that supply current to the FPGA. The ADC is controller by an SLD node that can be controlled via JTAG using the System Console application.
If you know the shunt resistor values, you can calculate the current that passes through each rail. This is what this script does.
There is no installation, just put everything in the same folder.
To run the Ruby script, you need to have Ruby (the programming language) installed in your system. Download it from www.rubyinstaller.org. Version 2.0.0 should work.
Run the Ruby script. Depending on your environment, you could try:
Here is a sample output:
Board detected: Cyclone IV GX Transceiver Starter Kit
2.5_VCC 0.041 A Rail 8 0xbf 0x0
1.2_VCCL_GXB 0.068 A Rail 1 0x3f 0x1
2.5_VCC_GXB 0.057 A Rail 2 0xa 0x1
2.5_VCCIO 0.006 A Rail 3 0x1e 0x0
1.2_VCCINT 0.166 A Rail 4 0xe 0x3
1.2_VCCD_PLL 0.033 A Rail 5 0x9d 0x0
open 0.004 A Rail 6 0x11 0x0
open 0.005 A Rail 7 0x16 0x0
If you want, you can bypass the Ruby script and run the TCL script with System Console:
All scripts were developed and tested in Microsoft Windows 8.1 with Quartus II 14.0. Previous versions of Quartus should work as well (also tested with 13.1sp1). I have used Ruby 2.0.0p0, but other versions should work too.
This script has been tested with the following boards:
Cyclone IV GX Transceiver Starter Kit
Cyclone IV GX FPGA Development Kit
Adapting to other FPGA boards and environments
It should be possible to run it with little changes in other platforms compatible with the Power Monitor™ infrastructure. Here are some directions:
Change the value of QUARTUS_DIR in the Ruby script if it is not `\altera\13.0sp1\quartus`
Each of the two supported boards have different procedures for reading the ADC samples. You may have to adapt proc read_adc_channel in the TCL script.
The Ruby script is preconfigured with board information for the two mentioned kits. If you need to change it to support another kit:
Find the place in the Ruby script where the variable `rails` is set.
Look up the power rail names in the Power Monitor GUI and board schematics.
Look up the resistor values on the SMD resistors and in the board schematics.
Update the column `ADC_idx` with the index of the ADC channels for each rail.
Update the column `Rail #` with the values you see when you run the TCL script.
Please let me know if you succeed in doing so or if you need any help.
Community support is provided during standard business hours (Monday to Friday 7AM - 5PM PST). Other contact methods are available here.
Intel does not verify all solutions, including but not limited to any file transfers that may appear in this community. Accordingly, Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.