Hi:
I'm using OMAPL137 with CGT 6.1.9. I'd like to benchmark C6747 code with TSCH, TSCL counter. Search forum I found many codes similar can be used, as I list in the bottom.
When I compile below programs, it will say TSCH, TSCL identifiers are undefined. So I add these two lines:
extern cregister volatile unsigned int TSCL;
extern cregister volatile unsigned int TSCH;
It can compiles OK now, but It seems benchmark result is different every time I run it. Tthe question is: What .h file I should include so that TSCH, TSCL is properly defined. Or what address for these two registers? Which document has detailed description for these two registers (sorry for the stupid question, but I did can't find these two registers in OMAPL137 data sheet, could you please show me where it is, I use SPRS563a).
Thanks.
The benchmark code I used is:
static __inline void C6_TIMER_START(void)
{
TSCL = 0;
}
static __inline uint64_t C6_TIMER_READ(void)
{
uint32_t cntl = TSCL;
return ((uint64_t) _itoll( TSCH, cntl ));
}
static __inline uint64_t C6_TIMER_DIFF(uint64_t time1, uint64_t time2)
{
return (time2 >= time1) ? (time2 - time1) : (time2 + (UINT64_MAX-time1));
}
static __inline uint64_t C6_TIMER_READ_AND_DIFF(uint64_t time1)
{
uint64_t time2 = C6_TIMER_READ();
return C6_TIMER_DIFF(time1, time2);
}