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.

Linux/66AK2G12: A15 cpu speed looks slow in Dhrystone ?

Part Number: 66AK2G12
Other Parts Discussed in Thread: 66AK2G02

Tool/software: Linux

Hi,

My customer was saying the Dhrystone score on CortexA15 working with Processor SDK Linux looked small.

I just tried to boot Linux kernel and matrix app (from Processor SDK Linux 04.03.00.05) on K2G02 EVM and confirmed Dhrystone score :

it seems CPU is running 50Mhz... I also checked /proc/cpuinfo:

root@k2g-evm:~# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 48.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc0f
CPU revision : 4

Hardware : Keystone
Revision : 0000
Serial : 0000000000000000
root@k2g-evm:~#

As you see, No CPU Mhz.... But BogoMIPS indicates 48.0 (this sounds very small number).

I also checked no governor was working in /sys/devices/system/cpu/cpufreq.

I believe A15 is running on Mhz configured in u-boot and actually it was 600Mhz in u-boot stage. I confirmed like this:

--------- u-boot command --------
=> getclk

getclk - get clock rate

Usage:
getclk <clk index>
The indexes for clocks:
0 - core_pll_clk
1 - pass_pll_clk
2 - tetris_pll_clk
3 - ddr3a_pll_clk
4 - ddr3b_pll_clk
5 - sys_clk0_clk
6 - sys_clk0_1_clk
7 - sys_clk0_2_clk
8 - sys_clk0_3_clk
9 - sys_clk0_4_clk
10 - sys_clk0_6_clk
11 - sys_clk0_8_clk
12 - sys_clk0_12_clk
13 - sys_clk0_24_clk
14 - sys_clk1_clk
15 - sys_clk1_3_clk
16 - sys_clk1_4_clk
17 - sys_clk1_6_clk
18 - sys_clk1_12_clk
19 - sys_clk2_clk
20 - sys_clk3_clk
21 - uart_pll_clk

=> getclk 2
clock index [2] - frequency 600000000

In summary, the kernel looked running at 600Mhz, but BogoMIPS and Dhrystone show quite a small numbers. Is this expected behavior ?

Best Regards
NK


PS
This is just a side note; EVM TRM state IP address should be displayed on LCD, but I could not see any IP information when the linux kernel is booted on A15. Is this expected behavior ?

  • Hi,

    This is just a side note; EVM TRM state IP address should be displayed on LCD, but I could not see any IP information when the linux kernel is booted on A15. Is this expected behavior ?


    To get the IP address, you need to have the K2G EVM ethernet connected to a PC, which is configured as DHCP server. So, if you don't have the EVM ethernet connected, then YES, this is expected.

    [qoute]In summary, the kernel looked running at 600Mhz, but BogoMIPS and Dhrystone show quite a small numbers. Is this expected behavior ?[/quote]

    This does not seem to be a normal behavior of the board. Let me check the SDK sources and I will update.

    Best Regards,
    Yordan
  • Hello Yordan,

    Thanks for your reply. Please note: in my case, i had connected the EVM to my local network via ethernet cable. Also, i had assigned an unique static IP address to EVM by issuing 'setenv ipaddr xx.xx.xx.xx' in u-boot stage.
    After the kernel booted, I verified the specified ip address assigned to EVM via ifconfig command and accessed that ip address via browser (PC in the same network) to launch matrix UI. Yes, it actually worked, however, i didn't see the ip on LCD... I think this could happen in DHCP use case.

    As for the performance issue, please let me know if you have any findings.

    Best Regards,
    NK
  • I'm now out of office and I can't confirm in detail, but i believe my 66AK2G02 EVM revision is D1.3. Just for your information.
  • Naoki Kawada said:
    I'm now out of office and I can't confirm in detail, but i believe my 66AK2G02 EVM revision is D1.3. Just for your information.

    I verified that this was correct for my environment.

    So, did you find any problems at your side ?

    Best Regards,
    NK

  • Hi, Naoki,

    The BogoMips does not reflect the CPU frequency, but "getclk 2" does.

    Please take a look at the Dhrystone Makefile and read the comments of "Adjust for your system" section in the Makefile.
    TI's performance measurement can be found in the Performance Guide,
    software-dl.ti.com/.../Release_Specific.html

    Dhrystone is one of the benchmarks we run nightly.

    Rex

  • Hi Rex,

    Can you specify the exact file for makefile ? I saw ti-processor-sdk-linux-k2g-evm-04.03.00.05\example-applications\arm-benchmarks-1.3\dhrystone\Makefile, but I could not find the comments.

    Also, please suggest for IP address issue (No IP address printed on LCD).

    Best Regards,
    NK
  • Hi, Naoki,

    Sorry, I was referring to the older version of dhrystone downloaded from internet a few years back when I ran the benchmark. Take a look at the dhry.h file in ProcSDK. The .h file also serves as a user guide on how to use it.

    Rex
  • Please submit a separate thread for LCD IP issue.

    Rex
  • Hi Rex

    I checked the following script and added debug print (see echo "NK Debug: CPU Freq = $CPUFREQ")

    ti-processor-sdk-linux-k2g-evm-04.03.00.05\example-applications\arm-benchmarks-1.3\scripts\runDhrystone

    echo ""
    echo ""
    echo ""
    echo "Dhrystone running ..."
    echo ""
    echo "Execution time 10 seconds or longer depending on your CPU clock speed"
    if test -e /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq; then
    CPUFREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq`
    else if test -e /proc/cpuinfo; then
            a=(`cat /proc/cpuinfo | grep Bogo | awk '{print $3}'`)
            b=`echo "($a+5)/10*10" | bc`
            let CPUFREQ=b*1000
         fi
    fi
    echo "NK Debug: CPU Freq = $CPUFREQ"
    dhrystone 200000000 $CPUFREQ
    echo ""

    As a result, I got the log of "NK Debug: CPU Freq = 50000" when executed the dhrystone. 
    Because of no entry for /sys/devices/system/cpu/cpu0/cpufreq, It seemed the script estimated the CPU freq from the BogoMIPS.

    So in summary, the root cause looked the result of BogoMIPS number is far from the expected value.

    Any comment ?

    Best Regards,
    NK

     

  • Hi, Naoki,

    You do realize that the dhrystone benchmark is not TI software and is available in public domain. Any question regarding dhrystone should go to public forum, or study the code to understand how it works.

    I find the following code in dhry_1.c which explain what you see.

     if(argc == 1)

     {

       printf ("Please give the number of runs through the benchmark: ");

       {

         int n;

         scanf ("%d", &n);

         Number_Of_Runs = n;

       }

     }

     else

     {

       Number_Of_Runs = atoi(argv[1]);

       printf("number of runs = %d",Number_Of_Runs);

     }

     if(argc == 3)

     {

       CpuFreq = atoi(argv[2])/1000;

     }

    Rex

  • Hi, Naoki,

    I just realize what's our difference. I didn't know such script file existed and couldn't understand why you keep using BogoMIPS. That script file is for our nightly test trying to use one single file for all platforms. I don't think the script is correct. When I ran Dhrystone myself, I didn't use the script file but provide correct frequency for the platform I ran.
    I'll check with System test to see why it uses the BogoMips, and it needs to be corrected.

    Rex
  • Hi, Rex

    I`m not asking the implementation of dhrystone. I know it is open source, so I read the code by myself and understood the cpu freq had been passed as an argument of dhrystone. And I did grep the existing code and found the script i shared in the previous post was actually passed wrong number for cpu freq (It had been actually originated from BogoMIPS). I know BogoMIPS is not accurate, but it is too far from the actual cpu frequency. This can be problem for dhrystone benchmark. Or, from the different point of view, we should use /proc/cpuinfo rather than bogoMIPS, but there is no cpu freq entry. That may be another problem.

    Anyway, i think we are in sync. Please ask your internal test team.

    Best Regards,
    NK
  • Hi, Naoki,

    The script only applies to platforms having power management from which cpu frequencies can be retrieved from proc file. According to our System Test group on using BogoMips in Dhrystone test, it says "You are right (on the incorrect value from using BogoMIPS) but we do fix the values when we publish the data in the performance page."

    Rex

  • Hi Rex,

    OK, thanks. I got the same number for DMIPS/Mhz (i.e, 3.6) with the performance guide on my setup.

    The run script looks like this:

    echo ""
    echo ""
    echo ""
    echo "Dhrystone running ..."
    echo ""
    echo "Execution time 10 seconds or longer depending on your CPU clock speed"
    if test -e /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq; then
    CPUFREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq`
    else if test -e /proc/cpuinfo; then
            a=(`cat /proc/cpuinfo | grep Bogo | awk '{print $3}'`)
            b=`echo "($a+5)/10*10" | bc`
    #        let CPUFREQ=b*1000
            let CPUFREQ=600*1000
    		echo "Overriden CPU Freq (kHz): $CPUFREQ"
         fi
    fi
    dhrystone 200000000 $CPUFREQ
    echo ""

    The script is very confusing, so maybe, it is good to fix it in the future release of SDK to be more K2G specific. Thanks for your consideration.

    Now I close the thread. Thanks for all your support.

    Best Regards,
    NK

  • Hi, Naoki,

    Thanks for your suggestion on the script, but it will only apply to K2G02 device. Other devices without PM have different frequencies from K2G02's 600MHz. The script file from System Test covers certain targeted devices. For other devices, such as K2G, it manually fixes the frequencies to publish. What users should do is to follow Dhrystone user's guide in public domain. 

    Rex

  • Naoki,

    A side note on IP address not displaying on LCD. It seems that it is broken when migrating to ProcSDK 4.x. It was working in ProcSDK 3.x. I'll submit a bug to have it fixed.

    Rex
  • Ok, i got it! Thanks for your notification.

    Best Regards,
    NK