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.

6678对DDR直接操作测试时间不同(在不同核)



在评估板6678evm上跑的程序,是对DDR地址直接操作数据代码如下:

uint8_t * srcBuff; uint8_t * srcBuff1; uint8_t * dstBuff;

int main(void) {

#ifndef SM_CH

 uint32_t i,j;

  int cycle=0;

 srcBuff=(uint8_t *)0x80000000;  

dstBuff=(uint8_t *)0x80100000;

 TSCL=0;

  for(i=0;i<144;i++)  

        for(j=0;j<10000;j++)   

                  {     *dstBuff++=*srcBuff++;    }  

cycle=TSCL;  

printf("\n数据处理时间是:%d\n",cycle);

 return 0;

cmd文件是:

-x -stack 0x10000 -heap 0x8000

MEMORY {    VECTORS: origin = 0x00800000 length = 0x00000400

   /*Local addresses*/   LL2MEM: origin = 0x00800400 length = 0x0007FC00

   /* M3 RAM */    MSMCSRAM: origin = 0x0C000000 length = 0x00200000 }

SECTIONS {   .csl_vect: > VECTORS

  .fout: > LL2MEM

  /* Boot Memory Sections */   .boot: > LL2MEM

  /* Text Memory Sections */   .text: > LL2MEM

  /* Data Memory Sections */   .data: > LL2MEM

  .fasttext:  >       LL2MEM  

 .cinit:     >       LL2MEM  

 .stack:     >       LL2MEM

  .bss:       >       LL2MEM

  .const:     >       LL2MEM

  .far:       >       LL2MEM

  .switch:    >       LL2MEM

   .sysmem:    >       LL2MEM

  .cio:       >       LL2MEM

  .heap       >       LL2MEM

  .fardata    > LL2MEM

  .neardata   > LL2MEM

  .rodata     > LL2MEM }

 

把程序放入0核中运行的结果是:

而在1核到7核中运行结果都这个:

请高手指点下这是为什么呢? 先谢谢了!!!

 

  • 我能想到的解释有两种

    1. DDR没被初始化, 如果加了gel文件来初始化DDR,无论跑哪个核在debug-launch的时候都要带上core0,否则DDR不会被初始化;

    2. 你的TSCL貌似写的有点问题,试试 

        TSCL = 0;

        cycle_start = TSCL;

        /*functions you run*/

                 ....

       cycle_end = TSCL;

      cycle_duration =  cycle_end - cycle_start ;

     注意cycle_end、cycle_start、 cycle_duration均是unsigned int