•
User must run any program that uses this code from when the function
count_start()
; starts,
to at least as far as the function
count_end
returns without halting or stepping to obtain an
accurate cycle count.
#include "bmtools.h"
int clock_start, clock count;
clock_start = count_start();
.
.
<insert code here>
.
clock_count = count_end(clock_start);
For a complete code example that shows the C version of the benchmark utility, see the DFT_c_bm
example that is included in the Examples folder.
An assembly version of the
count_start
and
count_end
functions are also available. To use this
version, insert a pair of function calls, one to start the cycle count (
count_start
) and another to end the
cycle count (
count_end
). The elapsed number of cycles is stored within a 48-bit wide memory location,
ecount_save. These functions are completely self contained, no saving or restoring of registers is
necessary.
•
User must Run any program that uses this code from when the function count_start; starts, to at
least as far as the function count_end returns without halting or stepping to obtain an accurate
cycle count.
Call count_start;
.
.
<insert code here>
.
Call count_end
For a complete code example that shows the assembly version of the benchmark utility, see the
DFT_assm_bm
program that is included in the Examples folder.
Note, that both the C and assembly utilities require that
bmtools.dlb be
included in the Libraries
statement of the project's LDF (Linker Description File). For more information on LDF files, refer to the
Linker & Utilities Manual for ADSP-21xxx Family DSPs
.
Both the assembly and C versions of the benchmarking utilities should operate on any SHARC processor.
The maximum number of cycles that can be counted is 2
32
- 1.
37
www.BDTIC.com/ADI