This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62P: AM62P -> DDR PERF TEST

Part Number: AM62P

Hi Team,

 

I am refering this example -> https://software-dl.ti.com/mcu-plus-sdk/esd/AM62AX/latest/exports/docs/api_guide_am62ax/EXAMPLES_DRIVERS_DDR_PERF.html

As per my understanding, it uses "memcpy" to major the BW. As seen from the example, Perf counters are started before and also after memcpy operation. But my doubt, does the counter run during memcpy operation is happening ?  How it measure BW here ? I want to know the working of PERF counters in DDR for any application to measure BW. 

Understanding - Start the counters + run app + Stop counters, but from the above code, I do not observe this behaviour. Could someone help me over here.

 

Regards,

Shriya

 

  • The counters are in the DDR subsystem and count read/write operations.  The counters don't start/stop, they are free running.  So you would just have to snapshot the counters before and after the test.

    Regards,

    James

  • Hi James, 

    Thanks for quick response and clarifying it. I have a doubt in this case. Suppose I am running a workload ex. GPU Triangle. I need to monitor DDR counters during the workload. So as per the explaination -

    1. Read the counter value.

    2. Run the GPU workload.

    3. Read the counter value.

    Get the difference in the readings and time to get the BW.  Is this correct ?

    After referring the DDR PERF example, I got confused as it doesn't calculate the BW like this.

    Snippet of code :

    //Reset the counters, get the BW value within the snapshot window which is 2 seconds here.

    DDR_statsResetDdrLoadCalcAll();
    DDR_perfStatsAccumulate();

    //Workfload

    memcpy(gDdrTestRxBuf,gDdrTestTxBulkBuf,DDR_PERF_APP_10MB_SIZE);

    // get the BW value within the snapshot window which is 2 seconds here.

    DDR_perfStatsAccumulate();
    DdrPerfApp_performanceStatusPrint();

    In the above case, we are not measuring the difference in the before and after . So how we are measuring BW during WORKFLOAD ? This is my doubt.

    Kindly please help me here.

    Thank you.

    Shriya

  • Check inside DDR_perfStatsAccumulate.  It takes a snapshot of the current time, then it reads the performance counters i mentioned above and calculates BW in MB/s based on elapsed time.  The DDR_statsReadCounters() reads the counters in the DDRSS and determines the difference since the last read.

    Regards,

    James

  • Thanks for info, yes, I have looked into ->DDR_perfStatsAccumulate which gets the totaltime,totalread.totalwrite value and copies to structure ( this is before the workload) and reading DDR_perfStatsAccumulate again after workfload  .

    Query -

    1. I am clear on the time , how difference it calculates between two snapshot. But from counter perspective, this is part of the code is not clear - 

    for (ddrInst = 0; ddrInst < DDR_NUM_INSTANCES; ddrInst++)
            {
                /* cnt0 is counting reads, cnt1 is counting writes, cnt2, cnt3 not used */
                *cntSel[ddrInst] = (DDR_STATS_CTR0_VAL <<  0U) |
                           (DDR_STATS_CTR1_VAL <<  8U) |
                           (DDR_STATS_CTR2_VAL << 16U) |
                           (DDR_STATS_CTR3_VAL << 24U);

                lastCnt0 += *cnt0[ddrInst];
                lastCnt1 += *cnt1[ddrInst];
                lastCnt2 += *cnt2[ddrInst];
                lastCnt3 += *cnt3[ddrInst];
            }

    During 2nd snapshot window , as the counter is running, how it records the lastcnt value (value from 1st snapshot) to calculate the difference ?

    2. I am currently using DDR PERF to measure GPU workload to get the GPU Bandwidth. Instead of memcpy , I am using GPU workload. Will this help ? Please guide me if I am on wrong track.

    Thanks,

    Shriya

  • 1.  The funciton is just returning the difference between the last count and the current count.  The difference is in diffCnt, which is calculated with the current count (curCnt) and last count (lastCnt)

    2. I don't know what GPU workload is, but you should be able to use DDR Pert to measure bw for any application.

    Regards,

    James

  • Hi James,

    Thanks for information.

    Info - GPU workload :  Existing TI example to render GPU triangle. 

    Your input helped to understand DDR Perf Test better. We can close this.

    Thanks,

    Shriya