模拟器选择c6748,在模拟器上的clock时间为118096739,clock的单位是cpu.cycles。硬件是dm8168,按照文档上写,他的dsp核为主频是1.125g的c674x,那么时间为118096739/1.125/1024/1024/1024=100ms左右。
实际上在板子上跑为250ms左右。为什么相差这么远?
模拟器上的cmd文件写法为
MEMORY
{
。。。
DSPL2RAM o = 0x00800000 l = 0x00040000 /* 256kB L2 Internal RAM */
DSPL1PRAM o = 0x00E00000 l = 0x00008000 /* 32kB L1 Internal Program RAM */
DSPL1DRAM o = 0x00F00000 l = 0x00008000 /* 32kB L1 Internal Data RAM */
。。。
DDR o = 0x80000000 l = 0x80000000 /* 2G Data */
}
SECTIONS
{
.text > DDR
.stack > DDR
.bss > DDR
.cio > DDR
.const > DDR
.data > DDR
.switch > DDR
.sysmem > DDR
.far > DDR
.args > DDR
.ppinfo > DDR
.ppdata > DDR
/* COFF sections */
.pinit > DDR
.cinit > DDR
/* EABI sections */
.binit > DDR
.init_array > DDR
.neardata > DDR
.fardata > DDR
.rodata > DDR
.c6xabi.exidx > DDR
.c6xabi.extab > DDR
.testSect > DSPL2RAM
}
代码里写
char memNoUse[128*1024];
#pragma DATA_SECTION(memNoUse, ".testSect");
意思是所有数据和代码都放在片外,cache只使用128k,还有128k没有使用。我们在板子上的环境也是这样的。
但是模拟器和板子的执行时间却相差很远,不知道为什么。换句话说,我想知道为什么板子跑慢了。