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.

我的算法,在模拟器上统计时间和在板子上的真实时间相差很远,是什么原因造成的?



模拟器选择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没有使用。我们在板子上的环境也是这样的。
 
但是模拟器和板子的执行时间却相差很远,不知道为什么。换句话说,我想知道为什么板子跑慢了。
  • 我看了一下模拟器的说明:

    simulates the c674x core in a cycle accurate manner. supports a flat memory system and 2 timers. does not model the cache system and any other peripherals.

    这是否说明他总是默认cache是命中的,或者认为代码或者数据总是在L1ram、L2ram里?

  • 你好,

    1. 请问你使用的是cycle accurate simulator,functional simulator?

    2. 在simulator下是无法模拟现实情况下的DDR吞吐,请问你在板子上运行的时候是所有程序都跑起来了么? 能否把你的代码/数据都放在L2上,这样来比较一下?

  • cycle accurate simulator。

    我板子上是所有的代码都在跑的,但是dsp核上也没什么太多代码,而且我测的只是我自己的算法的耗时。你是说让我把代码和数据都放在板子的L2上试一下,看看和模拟器统计时间是否一致?


    我有个疑问,我如何查看和配置我的模拟器的cpu和内存和emif的频率?我用的是ccs5.4。