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
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
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
@ Gina ,
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 ,
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.
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
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 resetI 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
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.
Be sure to read the OMAP4 Forum Guidelines & FAQ
@ 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;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_Debuggingnote: 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 arehttp://omapedia.org/wiki/Systemtap_OMAP_Profilerhttp://elinux.org/Kernel_Instrumentationhttp://omapedia.org/wiki/Power_Management_Debug_and_Profilingbetween 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.htmlhttp://www.gnu.org/software/libc/manual/html_node/Elapsed-Time.html#Elapsed-Time6. 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.nethttp://omapedia.org/wiki/Installing_and_Using_Ftrace7. For Android applications/system profiling you can check (see #1 for configuration in CCSv5)http://developer.android.com/guide/developing/tools/adt.htmlhttp://developer.android.com/guide/developing/debugging/ddms.htmlhttp://developer.android.com/guide/developing/debugging/debugging-tracing.htmlIf 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.
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.