test_mem: increase dram buffer if possible, cap number of iterations
Change-Id: Ie034433184d0dfcd50e3b783b2b6d0b6a44d001f
This commit is contained in:
parent
e441c2696d
commit
7a8c9daf7e
1 changed files with 9 additions and 3 deletions
|
@ -25,16 +25,22 @@
|
|||
|
||||
#if PLUGIN_BUFFER_SIZE <= 0x8000
|
||||
#define BUF_SIZE (1<<12) /* 16 KB = (1<<12)*sizeof(int) */
|
||||
#else
|
||||
#elif PLUGIN_BUFFER_SIZE <= 0x10000
|
||||
#define BUF_SIZE (1<<13) /* 32 KB = (1<<13)*sizeof(int) */
|
||||
#elif PLUGIN_BUFFER_SIZE <= 0x20000
|
||||
#define BUF_SIZE (1<<14) /* 64 KB = (1<<14)*sizeof(int) */
|
||||
#else
|
||||
#define BUF_SIZE (1<<15) /* 128 KB = (1<<15)*sizeof(int) */
|
||||
#endif
|
||||
|
||||
#define LOOP_REPEAT_DRAM 256
|
||||
#define MAX_REPEAT_DRAM 512
|
||||
static int loop_repeat_dram = LOOP_REPEAT_DRAM;
|
||||
static volatile int buf_dram[BUF_SIZE] MEM_ALIGN_ATTR;
|
||||
|
||||
#if defined(PLUGIN_USE_IRAM)
|
||||
#define LOOP_REPEAT_IRAM 256
|
||||
#define MAX_REPEAT_IRAM 512
|
||||
static int loop_repeat_iram = LOOP_REPEAT_DRAM;
|
||||
static volatile int buf_iram[BUF_SIZE] IBSS_ATTR MEM_ALIGN_ATTR;
|
||||
#endif
|
||||
|
@ -221,7 +227,7 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
ret |= test(buf_dram, BUF_SIZE, loop_repeat_dram, WRITE);
|
||||
ret |= test(buf_dram, BUF_SIZE, loop_repeat_dram, MEMSET);
|
||||
ret |= test(buf_dram, BUF_SIZE, loop_repeat_dram, MEMCPY);
|
||||
if (ret != 0) loop_repeat_dram *= 2;
|
||||
if (ret != 0 && loop_repeat_dram < MAX_REPEAT_DRAM) loop_repeat_dram *= 2;
|
||||
#if defined(PLUGIN_USE_IRAM)
|
||||
TEST_MEM_PRINTF("IRAM cnt: %d size: %d MB", loop_repeat_iram,
|
||||
(loop_repeat_iram*BUF_SIZE*sizeof(buf_iram[0]))>>20);
|
||||
|
@ -230,7 +236,7 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
ret |= test(buf_iram, BUF_SIZE, loop_repeat_iram, WRITE);
|
||||
ret |= test(buf_iram, BUF_SIZE, loop_repeat_iram, MEMSET);
|
||||
ret |= test(buf_iram, BUF_SIZE, loop_repeat_iram, MEMCPY);
|
||||
if (ret != 0) loop_repeat_iram *= 2;
|
||||
if (ret != 0 && loop_repeat_iram < MAX_REPEAT_IRAM) loop_repeat_iram *= 2;
|
||||
#endif
|
||||
|
||||
rb->screens[0]->update();
|
||||
|
|
Loading…
Reference in a new issue