Hello,
I did a memcpy benchmark on MIMXRT1170-EVKB to compare speed between DTCM, cached OCRAM and non-cached OCRAM but the result is confusing.
I expect cached region will perform like DTCM but it looks like the cache doesn't provide benefit.
Each test is done multiple times to ensure cache filling.
memcpy benchmark
DTCM - DTCM
Loop:0 Cycle:3258
Loop:1 Cycle:432
Loop:2 Cycle:431
Loop:3 Cycle:431
Loop:4 Cycle:431
Loop:5 Cycle:431
Loop:6 Cycle:431
Loop:7 Cycle:431
DTCM - NonCache
Loop:0 Cycle:534
Loop:1 Cycle:528
Loop:2 Cycle:528
Loop:3 Cycle:528
Loop:4 Cycle:528
Loop:5 Cycle:527
Loop:6 Cycle:528
Loop:7 Cycle:528
DTCM - Cache
Loop:0 Cycle:538
Loop:1 Cycle:532
Loop:2 Cycle:533
Loop:3 Cycle:532
Loop:4 Cycle:532
Loop:5 Cycle:532
Loop:6 Cycle:532
Loop:7 Cycle:532
DTCM - Cache+Flush
Loop:0 Cycle:863
Loop:1 Cycle:857
Loop:2 Cycle:865
Loop:3 Cycle:857
Loop:4 Cycle:865
Loop:5 Cycle:856
Loop:6 Cycle:865
Loop:7 Cycle:857
The attached example can be placed into SDKROOT\boards\evkbmimxrt1170.
I've modified linker script to ensure non-cached region is correctly set by BOARD_ConfigMPU since by default __NCACHE_REGION_SIZE is 0.
Only main.c, MIMXRT1176xxxxx_cm7_flexspi_nor.icf, MIMXRT1176xxxxx_cm7_ram.icf are modified, all other files are using kSDK default.
Linker output seems also correct:
buffer1 0x2000'0020 0x400 Data Gb main.o [5]
buffer2 0x2000'0420 0x400 Data Gb main.o [5]
buffer_cached 0x202c'0000 0x400 Data Gb main.o [5]
buffer_ncache 0x2032'0000 0x400 Data Gb main.o [5]