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.

AM335x beaglebone+starterware demo application: no performance gain with cache on?

Hello,

We are evaluating the AM335x processor with a beaglebone board and the starterware package, one strange thing we just observed is, the performance seems same with cache/mmu ON and OFF, which makes no sense to us, could anybody here can help?

Our test is quite straight forward, the demo application in starterware package enable MMU and I-Cache already, we insert in a simple evaulation function call to access(RW)  the DDR with different cache hit ratio (e.g. 100% hit, 50% hit, 0% hit), and measure the duration of this function's execution. We have tested both cache/MMU ON and OFF case, but the puzzle thing is we saw similar performance duration. We also double checked the 'System Control Register' and 'Auxiliary Control Register' and TLB content to make sure the cache/MMU is ON/OFF correctly as we configured.

We just touched 2 lines of code for cache/MMU ON & OFF:

Cache ON:

MMUConfigAndEnable();

CacheEnable(CACHE_ALL);  //here we enable both I-Cache and D-Cache

Cache OFF:

CacheDisable(CACHE_ALL); //here we disable both I-Cache and D-Cache

 

Thanks,

James.

  • Hi James

    Hope you are using StarterWare 02.00.00.06. Could you please check if  your DDR and OCMC attribute is NON_SHAREABLE ? By default, its given MMU_MEMTYPE_NORMAL_SHAREABLE. Can you make it non-shareable as below and try?

       REGION regionDdr = {
                            MMU_PGTYPE_SECTION, START_ADDR_DDR, NUM_SECTIONS_DDR,
                            MMU_MEMTYPE_NORMAL_NON_SHAREABLE(MMU_CACHE_WT_NOWA,
                                                             MMU_CACHE_WB_WA),
                            MMU_REGION_NON_SECURE, MMU_AP_PRV_RW_USR_RW,
                            (unsigned int*)pageTable
                           };

    Also, demo application will not work with D-Cache enabled in StarterWare 02.00.00.06. Next StarterWare release, which is expected to happen in Early July will have D-Cache Support for demo applications.

    Regards,

    Sujith.

  • Hi Sujith,

    Ok, the non-shareable setting boost the performance, sounds like a bug in the chip? Anyway, thank a lot for the prompt and helpful response.

    BTW, just make one thing more clear, you're saying the July release (yes, currently I'm using 02.00.00.06) will enable D-Cache, does that mean it'll work as NON-SHAREABLE as you mentioned, or it can even workaround the 'bug' to support the 'shareable' mode as well?

    Though I suppose our apps can torerate the non-shareable fix, it will be nice if you can give further clarification.

    Thanks!

    James.

  • Hi James,

    Its not a bug actually. When we say a portion of memory is shareable, the chip has to make the cache and memory coherent. So performance will be less.

    Yes. The next release will have the attribute as NON-SHAREABLE.

    When you make it non-shareable, you have to explicitly do cache maintanance operations (data cache invlidation/clean) to make your cache and memory coherent, since whenever DMA operations are involved. Previous releases didnt include calling of these APIs. So apps will not work when we set the non-shareable attribute in previous releases. Next release we include calling of these APIs wherever required. So, its safe to set the attribute as non-shareable. 

    Regards,

    Sujith.

  • Ok, thanks Sujith, I got your point and we'll looking forward the new release.