5 Replies Latest reply on Oct 26, 2011 10:05 AM by tedk

    Measuring the fpga and board temperature from fpga registers

    andrea.bartolini

      Dear All,

      I'm currently issuing the following problem, thus I would like to know if anyone of you had encounterd it and maybe knows already the solution.

       

      I made a c program to sample the power consumption of SCC and the fpga and board temperatures directly from inside an SCC  core. This is done by using the power managment registers built in in the fpga with the latest 1.4.1 sccKit.

       

      I'm currently sampling them every 1s, I'm reading the SCC voltage and current and the digital part of the memory controller one plus the board temperature and fpga ones.

       

      Whereas the power ones work fine, sometime I obtain a spyke, but they change accorndingly with the workload in execution, the board temperature and fpga one stay constant. If I'm using instead the sccBmc -c status instead the board and fpga temperatures changes?

      Does any one of you did use the fpga and board temperature from inside? Is there any specific activation register, such as the one for the voltage and current one? I check in the sccKit specification but I didn't found it.

       

      Thanks in advance,

      Best,

      Andrea

       

      Here I post the setting and the way I access the counters:

       

      /*Define*/

      #define FPGA_REG  0xf9000000                            

      #define POW_BASE 0x08400
      #define POW_3V3SCC_V 0x0841C //[15..0] valid bit
      #define POW_3V3SCC_VS 0.0002500000 //[15..0] valid bit
      #define POW_3V3SCC_I 0x08424 //[15..0] valid bit
      #define POW_3V3SCC_IS 0.0062490250 //[15..0] valid bit
      #define POW_1V1VCCT_V 0x08508 //[15..0] valid bit
      #define POW_1V1VCCT_VS 0.0001250000 //[15..0] valid bit
      #define POW_1V1VCCT_I 0x0850C //[15..0] valid bit
      #define POW_1V1VCCT_IS 0.0006249025 //[15..0] valid bit
      #define TFPGA 0x08554 //[15..0] valid bit
      #define TSCC 0x08558 //[15..0] valid bit

       

      #define POW_WATCHDOGL 0x08568 //[7..0] valid bits
      #define POW_WATCHDOGH 0x0856C //[7..0] valid bits
      #define POW_ENREG 0x0842C //[12..0] bit valib
      #define POW_ENMASK 0x0F80 //0000 1111 1000 0000

       


      void* addressMemAl(unsigned int ConfigAddr, unsigned int * pageOffset, unsigned int NCMDeviceFD){
          unsigned int alignedAddr, PAGE_SIZE;
          PAGE_SIZE = getpagesize();

       

              alignedAddr = ConfigAddr & (~(PAGE_SIZE-1));
          *pageOffset = ConfigAddr - alignedAddr;
              return (void*) mmap(NULL, PAGE_SIZE, PROT_WRITE|PROT_READ,MAP_SHARED, NCMDeviceFD, alignedAddr);
      };

       

      /*Inizializzation */

      powAddr = addressMemAl(FPGA_REG + POW_BASE, &OffsetPow, NCMDeviceFD);
          *(unsigned int*)(powAddr + OffsetPow + POW_ENREG - POW_BASE) = POW_ENMASK;
          *(unsigned int*)(powAddr + OffsetPow + POW_WATCHDOGL - POW_BASE) = 0L;
          *(unsigned int*)(powAddr + OffsetPow + POW_WATCHDOGH - POW_BASE) = 0L;

       

       

      /* Data reading*/

             Dataf[0+i*4] =  (float)(*(unsigned int*)(powAddr + OffsetPow + POW_3V3SCC_V - POW_BASE))*POW_3V3SCC_VS ;
                Dataf[1+i*4] =  (float)(*(unsigned int*)(powAddr + OffsetPow + POW_3V3SCC_I - POW_BASE))*POW_3V3SCC_IS;
                Dataf[2+i*4] =  (float)(*(unsigned int*)(powAddr + OffsetPow + POW_1V1VCCT_V - POW_BASE))*POW_1V1VCCT_VS;
                Dataf[3+i*4] =  (float)(*(unsigned int*)(powAddr + OffsetPow + POW_1V1VCCT_I - POW_BASE))*POW_1V1VCCT_IS;
                Datai[0+i*2] =  (int)*(unsigned int*)(powAddr + OffsetPow + TFPGA - POW_BASE);
                Datai[1+i*2] =  (int)*(unsigned int*)(powAddr + OffsetPow + TSCC - POW_BASE);

        • 1. Re: Measuring the fpga and board temperature from fpga registers
          tedk

          Let's see if I understand this correctly ... basically you are saying that

           

          • you run your workload and when you read the fpga you see the FPGA and SCC temperatures remain constant. (i2c off)
          • you run your workload and when you issue sccBmc -c status, you now see the FPGA and SCC temperatures change. (i2c on)

           

          So you are suspecting that reading the FPGA and SCC temperatures through the FPGA may not be giving you accurate results. One might expect the temperature to change or not to change, but one would certainly expect both methods to be consistent. It is true that, reading the FPGA has a latency of milliseconds while reading BMC status has a latency of seconds, but if the workload is long and consistent, we should expect similar results.

           

          Has anyone else tried this? What is the nature of your workload? Is its activity constant, do you think, or does it experience flurries of activity? I'm assuming it runs for several seconds if not minutes? When you see the temperature change, what kind of slope does it have with time? Does it rise, plateau, and then decrease? Is this a workload you can share?

           

          I'm curious why you chose to read the voltages/currents for the VRC and SIF, rather than the power domains. From your code fragments ...

          0x841C    <== SCC_3V3   <== Input voltage to the VRC
          0x8424    <== SCC_3V3C  <== Current to the VRC

          0x8508    <== 1V1_VCCT  <== Voltage for system interface (SIF) and digital portion of memory controller
          0x850C    <== I_V1_VCCT <== Current for system interface (SIF) and digital portion of memory controller

           

          Message was edited by: Ted Kubaska: typos

          • 2. Re: Measuring the fpga and board temperature from fpga registers
            tedk

            Has this question been resolved? Has it been assigned a Bugzilla number? Andrea, is this holding up your work?

            • 3. Re: Measuring the fpga and board temperature from fpga registers
              tedk

              Without an app running I do see both methods returning about the same value. sccBmc -c status gives

               

              Temperatures:

                Board:      29 °C

                FPGA:       32 °C

               

              And then from the FPGA registers (after turning i2c off) I see the following.

               

              tekubasx@marc101:~$ sccDump -s 0x8558
              INFO: Packet tracing is disabled...
              INFO: Initializing System Interface (SCEMI setup)....
              INFO: Successfully connected to PCIe driver...
              INFO: Welcome to sccDump 1.4.1 (build date Jun 28 2011 - 16:02:28)...
              INFO: FPGA register at address 0x00008558 (34136d) contains 0x0000001d (29d)...<== 29 degrees
              tekubasx@marc101:~$ sccDump -s 0x8554
              INFO: Packet tracing is disabled...
              INFO: Initializing System Interface (SCEMI setup)....
              INFO: Successfully connected to PCIe driver...
              INFO: Welcome to sccDump 1.4.1 (build date Jun 28 2011 - 16:02:28)...
              INFO: FPGA register at address 0x00008554 (34132d) contains 0x00000021 (33d)... <== 33 degrees
              tekubasx@marc101:~$

               

              Have you tried running your app  and not programmatically reading FPGA but rather issuing sccDump on the MCPC as you would sccBmc -c status?

              • 4. Re: Measuring the fpga and board temperature from fpga registers
                michael.riepen

                I talked to Udo. It seems that you enable the "power measurement mode" (bit 11) and select some specific power values to be updated periodically. In this mode the temperature won't be updated anymore (as defined in the MAS document). There is no way to enable temperature updates in "power measurement mode".

                 

                If you don't rely on high update frequencies, we'd recommend to use the default settings (after enabling the i2c in BMC) of the FPGA. All values (including temp) will be updated. However, the update rate is slower than in power measurement mode (see MAS for details).

                 

                Hope this helps!

                • 5. Re: Measuring the fpga and board temperature from fpga registers
                  tedk

                  Thanks, Michael. Andrea, the bit 11 is the one in FPGA 0x842C in Table 39 in sccKit 1.4.1.x User's Guide Part 8