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.

TMS320C6678: DDR 开启CACHE enable之后,性能提升大概三倍,是不是有点低了,有没有高手可以指导下原因在哪里

Part Number: TMS320C6678


代码如下:

#include "sw_cacheTest.h"

#pragma DATA_SECTION(imageData, ".imageData")
static int imageData[1024] = {1};

void ddrCacheEnableTask(){
    volatile unsigned long long startCycle = 0, totalCycle = 0;
    int readData = 0;
    int i = 0, acessCount = 1024;
    int *ptr = imageData;


    //DDR 开CACHE流程

    //step1 初始化L1P(32)
    CACHE_setL1PSize(CACHE_L1_32KCACHE);

    //step2 初始化L1D(32)
    CACHE_setL1DSize(CACHE_L1_32KCACHE);

    //step3 初始化L2
    CACHE_setL2Size(CACHE_256KCACHE);

    //step4 设置DDR CACHE enable
    //DDR cache enable 82000000h - 82FFFFFFh
    CACHE_enableCaching(130);




    startCycle = _itoll(TSCH,TSCL);

    for(i = 0; i < acessCount; i++){
        *ptr = i;
        readData = *ptr;
        ptr++;
    }
    totalCycle = _itoll(TSCH,TSCL) - startCycle;

    printf("totalCycle is %u \n", totalCycle);


}

经过测试之后发现开CACHE与不开CACHE的时钟周期数大概为 3  :1

网上有示例可以达到三十多倍的性能提升,所以想请问哪里可以去改善呢