• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » OMAP™ Applications Processors » OMAP 4 Forum » omap4430_profiling_with ccs v5_windows platform ...?
Share
OMAP™ Applications Processors
  • Forums
Options
  • Subscribe via RSS

Forums

omap4430_profiling_with ccs v5_windows platform ...?

This question is answered
studinstru sggs
Posted by studinstru sggs
on May 08 2012 02:15 AM
Expert1870 points

HI,

I am using Panda board with omap 4430 on CCS V5 windows platform.

I just want to do the profiling of my code that is nothing but want to check the timing information for the code that is how much time the function is taking for example in below example the time taken by add() function and total time by main function ……?

 Working platform : CCS v5

OS : Windows

Processor :OMAP4430 (ARM)


just Example :

#include <stdio.h>
#include <dmtimer.h>

Void main (void)

{

Int a=10, b=5 ;

Int time_start, time_end;
Int sum;

time_start = omap_dm_timer_read_counter(gptimer);

Sum= add(a,b);

time_end = omap_dm_timer_read_counter(gptimer);
   
printf( "Total timer ticks = %d\n", (time_end-time_start));

return;

}

int add(int a,int b)

{

return(a+b);

}

--Above code is giving lots of error and not recognizing the dmtimer.h header file.

Please suggest me.

As with ccs v5.1 all drivers of panda board is installed but still such type of errors ....

Please suggest me the way...

-Studinstru

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Gina Glaser
    Posted by Gina Glaser
    on May 08 2012 07:52 AM
    Expert8055 points

    Studinstru,

    I don't know about the error that you are getting with CCS, but perhaps an easier way would be to use the OProfile tool:

    http://omappedia.org/wiki/Android_Debugging

    http://oprofile.sourceforge.net

    Would this meet your needs?

    Regards,

    Gina

    Please click the Verify Answer button on this post if it answers your question

    _______________________________________________________

    Be sure to read the OMAP4 and OMAP5 Forum Guidelines and FAQ 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Manuel Contreras
    Posted by Manuel Contreras
    on May 08 2012 14:34 PM
    Expert8425 points

    Studinstru;

    It could be that some project options are missing, check next link for some information

    http://processors.wiki.ti.com/index.php/How_to_create_GCC_projects_in_CCSv5

    Please click the Verify Answer button on this post if it answers your question
    _______________________________________________________
    Be sure to read the OMAP4 and OMAP5 Forum Guidelines and FAQ
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • studinstru sggs
    Posted by studinstru sggs
    on May 09 2012 01:48 AM
    Expert1870 points

    @ Gina ,

    http://omappedia.org/wiki/Android_Debugging

    http://oprofile.sourceforge.net

    Above two links you shared are with Linux based TOOLS .

    I am working  on Windows platform .

    I am not trying to create Linux GCC project in Windows hosted CCSv5

    I have panda board as hardware with omap4430 as processor.

    As I mentioned I want check number of cycles required to complete one task (profiling).

    I think I can use omap_dm_timer_read_counter(gptimer) related API  in windows based platform..

    For this which header file i have to add in my code to access all the API's related with the timer function in omap  ?????????

    I will mention once more that i am working on windows platform , NOT Linux platform .

    I want to know which header file i have to add to access the API's of timers of OMAP.

    @ Manuel ,

    It could be that some project options are missing, check next link for some information

    http://processors.wiki.ti.com/index.php/How_to_create_GCC_projects_in_CCSv5


    I am not trying to Create a Linux GCC project in Windows hosted CCSv5 ,

    I want to create my own project in windows based CCSv5.

    My target is Panda board with omap4430 processor.

    I want to use OMAP on chip timer that 11 GP timers and 2 watch dog timers.

    For this I read OMAP TRM also.

    so For checking the timing I  tried a small code of   " addition " (I already mentioned in my post also).

    But still this is not recognizing this API's of  OMAP timers like : omap_dm_timer_read_counter(gptimer) .

    And as I know that during installation of the CCS v5 all drivers of CCSv5 supported-hardware also installed and I think  there is no need to installed that OMAP4430 DRIVERS once again.

    My board is executing  other small program of printing  " hello world " etc.

    But accessing the timer is creating the problem that is 11GP timers .

    I think i mentioned my problem now clearly. and I hope i will get your reply on this soon.


    -Studinstru

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Manuel Contreras
    Posted by Manuel Contreras
    on May 09 2012 10:52 AM
    Expert8425 points

    Studinstru;

    Hi, you can find information about dmtimers in next locations:

    http://omapedia.org/wiki/Timer

    http://omapedia.org/wiki/Omap_timestamp.stp

    depending on how are you accessing it you could need to configure CCSv5 to reference kernel headers, and it could depend on your actual development environment;

    about GPTIMER11 it is in use by WDT by Ducati, check next post:

    http://e2e.ti.com/support/omap/f/849/p/169373/625329.aspx#625329

    http://e2e.ti.com/support/omap/f/849/p/180760/651987.aspx#651987

    Please click the Verify Answer button on this post if it answers your question
    _______________________________________________________
    Be sure to read the OMAP4 and OMAP5 Forum Guidelines and FAQ
    GPTIMER11 Kernel dmtimer
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • studinstru sggs
    Posted by studinstru sggs
    on May 10 2012 09:38 AM
    Expert1870 points

    Thanks Manuel for your reply.

    But still i didn't get proper answer.

    I tried in other way  for accessing the GPtimers. <Please check below>

    I want to profile the " Sum_test " function using GPTIMER-5 on cortex-A9 core0  .

    0x40138010 is for Cortex-A9(TRM) GPT_TIOCP_CFG register.


    Please check below my code that I wrote for the accessing the timer in c :

    #define GPTIMER_ENABLE          1             //GPTIMER5
         INT32 *pGPT_TI0CP_CFG                    =  (INT32 *)0x40138010;     
         INT32 *pGPT_TCLR                         =  (INT32 *)0x40138038;
         INT32 *pGPT_TCRR                         =  (INT32 *)0x4013803C;
         UINT32 op_start, op_end,op_total = 0;

         unsigned int Sum_test(unsigned int a, unsigned int b);

        void main()
        {
           UINT32 a,b,c,d;
           UINT32 resetbit;
           INT32 *pStatusReg, *pControlReg, *pCounterReg ;
           INT32 val;
           a = 10;
           b = 20;

    #if GPTIMER_ENABLE
           pStatusReg  = pGPT_TI0CP_CFG;
           pControlReg = pGPT_TCLR;
           pCounterReg = pGPT_TCRR;
           op_total   = 0;

           *pStatusReg = 0x1; // Enable reset

           while((*pStatusReg & 0x00000001))        //Wait till reset

           *pStatusReg = 0x2;                                      // EMU Free bit


           *pCounterReg = 0;                                        //Fill Zero


           *pControlReg = 0x1;                                    //Start the Timer
           *pCounterReg = 0x00001000;                 //Fill Timer value


           op_start   = *pControlReg;
    #endif

           c = Sum_test(a,b);

    #if GPTIMER_ENABLE
           op_end    = *pControlReg;
           op_total += op_end - op_start;
    #endif

           printf("After addition : %d",c);
           fflush(stdout);
        }

        unsigned int Sum_test (unsigned int a, unsigned int b)
        {
            unsigned int sum;
            sum = a+b;
            return sum;
        }

    This issue is encounter :

    First time in ccs5 debug mode when i hit the line *pStatusReg = 0x1; // Enable reset

    I am unable to go beyond this line as i am getting the "error : No source code available".

    Please suggest how to access the any GPTimer. Any specific bit/bits to enable for the GP timers????

    I want to profile the " Sum_test " function using GPTIMER-5 on cortex-A9 core0  .

    I hope I will get the satisfied reply now ......?

    Studinstru

     


    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Rodrigo Castaneda
    Posted by Rodrigo Castaneda
    on May 10 2012 13:29 PM
    Intellectual785 points

    Hi Studintru:

              My personal opinion is that using a hardware timer is far too complicated for a profiling tool, I suggest to use timer function included on windows like those mentioned on link bellow.

    http://msdn.microsoft.com/en-us/library/aa910696

           Other wise if you really need to use a hardware timer you need to know which timer is available, generate a interrupt service routine, and deal with problems of a low level implementation. Hope I have been helpful.

    Please click the Verify Answer button on this post if it answers your question

    _______________________________________________________

     

    Be sure to read the OMAP4 Forum Guidelines & FAQ

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • studinstru sggs
    Posted by studinstru sggs
    on May 11 2012 00:23 AM
    Expert1870 points

    @ Rodrigo,

    Thanks .

    But I think as I am working on hardware that is panda board (OMAP4430 AND DSP PROCESSOR),

    So using the  #include <windows.h> is not correct (as our processor is the omap4430 not the CPU ( i7 or i5 processor)).

    And if we use this API's of windows then it will give the timing cycle with respect to my computer CPU  (i7 or i5 processor) not with the panda board or omap4430 processor.

    So I can't get the exact performance .

    Then the profiling of this code is dependent on CPU of computer (that is i7 ,i5,i3 processor of cpu) not with the present hardware that is omap4430.

    What do u think on this .......?

    -Studinstru

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Manuel Contreras
    Posted by Manuel Contreras
    on May 11 2012 14:39 PM
    Expert8425 points

    Studinstru;

    1. You are using CCSv5 in Windows OS. if you are working in your Panda Board using Android you could need this link in the future to configure Android ADB/SDK and CCSv5 to do debug/profile.

    http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3.4-DevKit-2.1_DeveloperGuide#Application_Development_and_Debugging
    note: It is for other processor but instructions to install both applies.

    2. You are developing a native binary, this because of main() function, it is in user space.

    3. by next comments from http://omapedia.org/wiki/Timer I can think that it is used at Kernel level and it will require to create/access a driver/library to expose those functions to user space.

    "The library does not provide high-level abstractions."
    "This keeps the driver simple and flexible considering that GP Timer is not used by many"
    "How do I use a GP timer to benchmark kernel functions?"

    4. At Kernel level other options to measure or profile functions are

    http://omapedia.org/wiki/Systemtap_OMAP_Profiler
    http://elinux.org/Kernel_Instrumentation
    http://omapedia.org/wiki/Power_Management_Debug_and_Profiling
    between other available options.

    5. For user space you can use gettimeofday() got simple time measurement between function calls.

    http://www.gnu.org/software/libc/manual/html_node/High_002dResolution-Calendar.html
    http://www.gnu.org/software/libc/manual/html_node/Elapsed-Time.html#Elapsed-Time

    6. Other user space solutions are the ones that are already mentioned in this thread.

    http://omapedia.org/wiki/Android_Debugging
    (this link contains many options to use)
    http://oprofile.sourceforge.net
    http://omapedia.org/wiki/Installing_and_Using_Ftrace

    7. For Android applications/system profiling you can check (see #1 for configuration in CCSv5)

    http://developer.android.com/guide/developing/tools/adt.html
    http://developer.android.com/guide/developing/debugging/ddms.html
    http://developer.android.com/guide/developing/debugging/debugging-tracing.html

    If you want to use GPTIMERS from a main() function in user space you require to add proper interface code in order to access them, it is  creating  a driver that uses and exposes those functions to user space or use functions like described in #5.

    Please click the Verify Answer button on this post if it answers your question
    _______________________________________________________
    Be sure to read the OMAP4 and OMAP5 Forum Guidelines and FAQ
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • studinstru sggs
    Posted by studinstru sggs
    on May 16 2012 04:21 AM
    Verified Answer
    Verified by studinstru sggs
    Expert1870 points

    Hi Thanks for this reply.

    I am not developing any android application.

    I just want to burn my small code on panda.

    Any way i resolved this problem by changing the gel files corresponding to the timer in omap4430.

    Now i am able to use the GPTimer for my code.

    -Studinstru

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use