summaryrefslogtreecommitdiff
path: root/tools/mpy-tool.py
diff options
context:
space:
mode:
authorAlessandro Gatti <a.gatti@frob.it>2024-09-29 17:40:17 +0200
committerDamien George <damien@micropython.org>2025-09-19 11:11:31 +1000
commit1b92bda5b8e5e2db8e57c4b7134930e52bc5207a (patch)
tree0a28322827d73d186dddb5672fdeb7d6f17267c9 /tools/mpy-tool.py
parentec1bfcfbb7944bb7bbf5048de0152867cf71817b (diff)
mpy-cross: Add RISC-V RV64IMC support in MPY files.
MPY files can now hold data to be run on RV64IMC. This can be accomplished by passing the `-march=rv64imc` flag to mpy-cross. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'tools/mpy-tool.py')
-rwxr-xr-xtools/mpy-tool.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py
index c87c656ff..df918e153 100755
--- a/tools/mpy-tool.py
+++ b/tools/mpy-tool.py
@@ -94,6 +94,7 @@ MP_NATIVE_ARCH_ARMV7EMDP = 8
MP_NATIVE_ARCH_XTENSA = 9
MP_NATIVE_ARCH_XTENSAWIN = 10
MP_NATIVE_ARCH_RV32IMC = 11
+MP_NATIVE_ARCH_RV64IMC = 12
MP_PERSISTENT_OBJ_FUN_TABLE = 0
MP_PERSISTENT_OBJ_NONE = 1
@@ -1061,6 +1062,7 @@ class RawCodeNative(RawCode):
MP_NATIVE_ARCH_XTENSA,
MP_NATIVE_ARCH_XTENSAWIN,
MP_NATIVE_ARCH_RV32IMC,
+ MP_NATIVE_ARCH_RV64IMC,
):
self.fun_data_attributes = '__attribute__((section(".text,\\"ax\\",@progbits # ")))'
else:
@@ -1078,8 +1080,8 @@ class RawCodeNative(RawCode):
self.fun_data_attributes += " __attribute__ ((aligned (4)))"
elif (
MP_NATIVE_ARCH_ARMV6M <= config.native_arch <= MP_NATIVE_ARCH_ARMV7EMDP
- ) or config.native_arch == MP_NATIVE_ARCH_RV32IMC:
- # ARMVxxM or RV32IMC -- two byte align.
+ ) or MP_NATIVE_ARCH_RV32IMC <= config.native_arch <= MP_NATIVE_ARCH_RV64IMC:
+ # ARMVxxM or RV{32,64}IMC -- two byte align.
self.fun_data_attributes += " __attribute__ ((aligned (2)))"
def disassemble(self):