mimxrt: Optimize the runtime speed.

By moving code to ITCM, like vm, gc, parse, runtime.  The change affects
mostly the execution speed of MicroPython code.  The speed is increased by
up to a factor of 6, especially for MCU with small cache.
This commit is contained in:
robert-hh 2021-09-17 08:25:33 +02:00 committed by Damien George
parent 90b45efa6a
commit 4f89c38a6a
2 changed files with 6 additions and 3 deletions

View File

@ -96,7 +96,7 @@ SECTIONS
.text :
{
. = ALIGN(4);
*(EXCLUDE_FILE(*fsl_flexspi.o) .text*) /* .text* sections (code) */
*(EXCLUDE_FILE(*fsl_flexspi.o *gc*.o *vm.o *parse.o *runtime*.o *mpirq.o *map.o) .text*) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
*(.glue_7) /* glue arm to thumb code */
@ -200,8 +200,9 @@ SECTIONS
{
. = ALIGN(4);
__ram_function_start__ = .;
*fsl_flexspi.o(.text*)
*(.ram_functions*)
/* remaining .text and .rodata; i.e. stuff we exclude above because we want it in RAM */
*(.text*)
. = ALIGN(4);
__ram_function_end__ = .;
} > m_itcm

View File

@ -43,7 +43,9 @@ uint32_t trng_random_u32(void);
#define MICROPY_EMIT_THUMB (1)
#define MICROPY_EMIT_INLINE_THUMB (1)
// Compiler configuration
// Optimisations
#define MICROPY_OPT_LOAD_ATTR_FAST_PATH (1)
#define MICROPY_OPT_MAP_LOOKUP_CACHE (1)
// Python internal features
#define MICROPY_READER_VFS (1)