我在为dm8168的dsp核写算法,现在用模拟器跑出的时间和板子上真实的时间相差较大。有一个怀疑是模拟器使用了l2ram,而板子上没有用l2ram。因此在测试工程的cmd文件里这样写:
MEMORY
{
DSPL2ROM o = 0x00700000 l = 0x00100000 /* 1MB L2 Internal ROM */
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 /* 2GB DDR2 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 memForAlg[20*1024*1024];
unsigned char originalFrame[15*352*288*3/2];
unsigned char binaryFrame[15*352*288*3/2];
。。。
char memNoUse[256*1024];
#pragma DATA_SECTION(memNoUse, ".testSect");
编译的时候输出2个警告:
warning #10247-D: creating output section ".testSect" without a SECTIONS specification
warning #10281-D: Section ".bss" requires a STATIC_BASE relative relocation, but is located at 0xc228cb60, which is probably out of range of the STATIC_BASE. STATIC_BASE is located at 0xc2274948. Might be required to correct placement of ".bss" so it lies within 0x8000 of the STATIC_BASE
运行的时候得到几个数组的地址如下:
binaryFrame=0xC162CE00,
originalFrame=0xC1400000,
memForAlg=0x00700000,
memNoUse=0x00000000
显然memForAlg没有分配在片外,而memNoUse也没有分配在L2ram。我应该怎么写cmd文件?谢谢。