DSPRelated.com
Forums

Mismatch in Timing measurements [2 Attachments]

Started by Vikram Ragukumar October 8, 2010
Vikram,

On first examination, I notice the following instruction:
CSR &= ~1;

'&' is generally used to turn bits OFF, given the 0 bits in a mask.
Your mask is '-1'.
minus 1 is 0xFFFFFFFF.
I.E. no bits are being turned off.

Here is a short document that discusses the CSR field: SPRU732J.pdf
which can be downloaded from ti.com

Also, all those invocations of the _nassert() feature are a lot of code to be
executed on every iteration of the outer loop.

I'm going to look at the asm code next and let you know what I see there.

R. Williams
---------- Original Message -----------
From: Vikram Ragukumar
To: "c..."
Sent: Fri, 08 Oct 2010 15:04:48 -0500
Subject: [c6x] Mismatch in Timing measurements [2 Attachments]

> All,
>
> We are in the process of verifying theoretical cycle time calculations,
> based on information from the generated asm file.
>
> Following results and questions pertain to the attached conv.c and a
> section of the generated conv.asm file.
> conv.c implements a basic convolution function.
>
> Our setup details are :
> - EVM6472, used to run .out file generated from a SYS/BIOS based
> project
> - CCS v4.2
> - SYS/BIOS (BIOSv6)
> - CGT v7.0.3
>
> There appears to be a mismatch in timing measurements, with "actual
> run time" being about 9 times the "computed run time".
>
> From the C code,
> Number of outer loop iterations = x_len + h_len = 196000+36000 = 232000
> Number of inner loop iterations = h_len = 36000
>
> From asm file, Cycle time for software pipelined loop is
>
> Total cycles (est) = 10 + trip_cnt * 2, with 2 DOTP2 instructions for
> a SINGLE SCHEDULED ITERATION.
>
> Hence, computed run time = x_len*(10+trip_cnt*2),
> trip_cnt = h_len/4 (2 DOTP2's per iteration)
>
> Therefore,
> Computed run time = x_len*(10+h_len/2) = 4178320000 cycles.
> At 700Mhz, this would correspond to a time of 6s (approx).
>
> However actual run time of the program was determined to be 52s. Run
> time was calculated by inserting SYS/BIOS (BIOS6) Clock_getTicks()
> calls right before and immediately after the outer loop. Also, we made
> sure that interrupts were disabled during execution of the loops, this
> had no effect on run time measured.
>
> (1) Is there something wrong with how "Computed run time" is being
> calculated or how we are measuring "Actual run time" ?
>
> (2) As part of the Software Pipeline information, the compiler outputs
> a line that reads something like "ii = 2 Schedule found with 6
> iterations in parallel". Does the word "iterations" in the above
> phrase correspond to actual inner loop iteration in c code ? If so, is
> the number 6 in the above example, to be used in computing "expected
> run time" ?
>
> Thank you in advance for your help.
>
> Regards,
> Vikram.
------- End of Original Message -------

_____________________________________