This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how many cycles to execute a cache operation

Other Parts Discussed in Thread: SYSBIOS

When I want to count the cycles of "Cache_wb((void *)src, len, Cache_Type_ALLD, true );"I find that it cost so much time.

For example, arm A8 cpu 1G clock, len = 32768 bytes, time is about 16 us.

Can you tell me how many cycles to execute a cache operation such as instruction below?

mcr     p15, #0, r0, c7, c10, #1 ; write back a cache line

mcr     p15, #0, r0, c7, c14, #1 ; writeback inv a cache line

mcrne   p15, #0, r0, c7, c10, #4 ; drain write buffer

  • Hi Lusheng zhang,

    Which version of BIOS are you using?

    Which hardware platform are you using?

    Lusheng zhang said:

    When I want to count the cycles of "Cache_wb((void *)src, len, Cache_Type_ALLD, true );"I find that it cost so much time.

    For example, arm A8 cpu 1G clock, len = 32768 bytes, time is about 16 us.

    What method did you use to determine this?

    Steve

  • At dm8168 platform, arm clock 987M, sysclock8 is about 400M, ddr3 is about 796M. Cache_wb len=0x8000, timer (27M)ticks = 450, about 450 * 1000/27 ns(about 16us)

  • Hi all,

    At dm8168 platform, arm clock 987M, sysclock8 is about 400M, ddr3 is about 796M. Cache_wb len=0x8000, timer (27M)ticks = 450, about 450 * 1000/27 ns(about 16us),

    sysbios verison: bios_6_33_05_46

    xdcversion: xdctools_3_23_03_53

    I am counting the access speed for some operation.

    For example, read TIMER_COUNTER for 1000 times, it need 3500 timer ticks(timer clock is 27M, about 130 us) 

     reading write DMA controller register for 1000 times, it need 2400 timer ticks(timer clock is 27M, about 89us) .

    I want to know the actual cycles to read or write one register in L4 level. 

    I want to know the actual cycles to do some cache operation such as wb and inv. 

    Thanks again.


  • You can use the Timestamp_get32() function to benchmark code.  The basic idea is that you call Timestamp_get32() before and after the code you want to benchmark.  Then you take the difference and that tells you the time.

    The SYS/BIOS benchmarks are determined like this.  You can see them in the tar ball attached to this post.  See the file 'timing.c' and the Bench_start() and Bench_end() functions.

    Steve