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:
parent
90b45efa6a
commit
4f89c38a6a
|
@ -96,7 +96,7 @@ SECTIONS
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = 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.) */
|
||||||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||||
*(.glue_7) /* glue arm to thumb code */
|
*(.glue_7) /* glue arm to thumb code */
|
||||||
|
@ -200,8 +200,9 @@ SECTIONS
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__ram_function_start__ = .;
|
__ram_function_start__ = .;
|
||||||
*fsl_flexspi.o(.text*)
|
|
||||||
*(.ram_functions*)
|
*(.ram_functions*)
|
||||||
|
/* remaining .text and .rodata; i.e. stuff we exclude above because we want it in RAM */
|
||||||
|
*(.text*)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__ram_function_end__ = .;
|
__ram_function_end__ = .;
|
||||||
} > m_itcm
|
} > m_itcm
|
||||||
|
|
|
@ -43,7 +43,9 @@ uint32_t trng_random_u32(void);
|
||||||
#define MICROPY_EMIT_THUMB (1)
|
#define MICROPY_EMIT_THUMB (1)
|
||||||
#define MICROPY_EMIT_INLINE_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
|
// Python internal features
|
||||||
#define MICROPY_READER_VFS (1)
|
#define MICROPY_READER_VFS (1)
|
||||||
|
|
Loading…
Reference in New Issue