This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit ef7712081984f541f5dccdcc6171b0bdf527f6af
Author: zhangyu117 <[email protected]>
AuthorDate: Wed Jul 1 10:47:35 2026 +0800

    arch/tricore: make Tasking tradeoff level configurable
    
    Add ARCH_TASKING_TRADEOFF and use it in both CMake and Make builds to 
select the balance between execution speed and code size.
    
    Signed-off-by: zhangyu117 <[email protected]>
---
 arch/tricore/Kconfig                          | 13 +++++++++++++
 arch/tricore/src/cmake/tasking.cmake          |  2 +-
 arch/tricore/src/common/ToolchainTasking.defs |  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/tricore/Kconfig b/arch/tricore/Kconfig
index b382b90bf36..ada4fc45490 100644
--- a/arch/tricore/Kconfig
+++ b/arch/tricore/Kconfig
@@ -43,6 +43,19 @@ config TRICORE_TOOLCHAIN_GNU
 
 endchoice # Tricore Toolchain Selection
 
+config ARCH_TASKING_TRADEOFF
+       int "Tasking compiler tradeoff level"
+       default 2
+       range 0 4
+       ---help---
+               Selects the Tasking compiler --tradeoff=<n> option, which 
controls
+               the balance between execution speed and code size:
+                 0 - maximum speed (largest code)
+                 1
+                 2 - balanced (default)
+                 3
+                 4 - minimum size (slowest code)
+
 config ARCH_TC1V6
        bool
        select ARCH_HAVE_DEBUG
diff --git a/arch/tricore/src/cmake/tasking.cmake 
b/arch/tricore/src/cmake/tasking.cmake
index 1cfab8c32d2..5b61181a7e9 100644
--- a/arch/tricore/src/cmake/tasking.cmake
+++ b/arch/tricore/src/cmake/tasking.cmake
@@ -178,7 +178,7 @@ add_compile_options(--integer-enumeration)
 
 # tradeoff between speed (-t0) and size (-t4) (default: 4)
 
-add_compile_options(--tradeoff=2)
+add_compile_options(--tradeoff=${CONFIG_ARCH_TASKING_TRADEOFF})
 
 # mergering of sections
 
diff --git a/arch/tricore/src/common/ToolchainTasking.defs 
b/arch/tricore/src/common/ToolchainTasking.defs
index 0337ae4620c..57b0c830657 100644
--- a/arch/tricore/src/common/ToolchainTasking.defs
+++ b/arch/tricore/src/common/ToolchainTasking.defs
@@ -93,7 +93,7 @@ ARCHOPTIMIZATION += --integer-enumeration
 
 # tradeoff between speed (-t0) and size (-t4) (default: 4)
 
-ARCHOPTIMIZATION += --tradeoff=2
+ARCHOPTIMIZATION += --tradeoff=$(CONFIG_ARCH_TASKING_TRADEOFF)
 
 # enable symbolic debug information
 

Reply via email to