-
Notifications
You must be signed in to change notification settings - Fork 3k
Correct the floating options for Cortex-M7 and Cortex-M4 #9477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0bd2e1b
9a78756
7292acf
659f083
afb559b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
from os.path import join, splitext, exists | ||
from distutils.version import LooseVersion | ||
|
||
from tools.targets import CORE_ARCH | ||
from tools.toolchains import mbedToolchain, TOOLCHAIN_PATHS | ||
from tools.hooks import hook_tool | ||
from tools.utils import run_cmd, NotSupportedException | ||
|
@@ -45,12 +46,18 @@ def __init__(self, target, notify=None, macros=None, build_profile=None, | |
build_dir=None): | ||
mbedToolchain.__init__(self, target, notify, macros, build_dir=build_dir, | ||
build_profile=build_profile) | ||
if target.core == "Cortex-M7F" or target.core == "Cortex-M7FD": | ||
cpuchoice = "Cortex-M7" | ||
elif target.core.startswith("Cortex-M23"): | ||
cpuchoice = "8-M.baseline" | ||
if target.core == "Cortex-M7FD": | ||
cpuchoice = "Cortex-M7.fp.dp" | ||
elif target.core == "Cortex-M7F": | ||
cpuchoice = "Cortex-M7.fp.sp" | ||
elif target.core.startswith("Cortex-M33FD"): | ||
cpuchoice = "Cortex-M33.fp" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wonder why this is not fp.dp (double-prec) as in M7? Is this correct, please double-check? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. D in case of Cortex-M33 is DSP and not double floating point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which is a very bad idea, as I believe I've previously commented. Why are we making up non-standard inconsistent naming? If you really want to have a single-letter name, "M33FE" would make more sense, as "E" is the letter historically used by ARM to represent the DSP Extensions. (Although that makes me think of the ARM7500FE where it meant EDO RAM, so maybe reverse to M33EF - putting the DSP extensions closer to the core than the FP unit is also logical). But I would really rather go with what all the tools are consistently doing - using the "no_fp" and "no_dsp" suffixes. We're in the odd situation where all 3 toolchains agree on that, and Mbed OS is being different. (Okay, they don't totally agree on polarity of the FP flag) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While performing some changes recently, I see why Mbed OS used its own letters, as we do not have consistency among all toolchaina and even between assembler and compilers. Flags are +nodsp / .no_dsp / .dsp / +dsp There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes can change this now to some other letter for DSP, as no target is added. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make the core names consistent with the ARM historical single letter abbreviations; use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @theotherjimmy @kjbracey-arm - One more Query, for DSP and FPU. Should it be |
||
elif target.core.startswith("Cortex-M33F"): | ||
cpuchoice = "Cortex-M33.fp.no_dsp" | ||
elif target.core.startswith("Cortex-M33"): | ||
cpuchoice = "8-M.mainline" | ||
cpuchoice = "Cortex-M33.no_dsp" | ||
elif target.core.startswith("Cortex-M23"): | ||
cpuchoice = "Cortex-M23" | ||
else: | ||
cpuchoice = target.core | ||
|
||
|
@@ -68,18 +75,11 @@ def __init__(self, target, notify=None, macros=None, build_profile=None, | |
cxx_flags_cmd = [ | ||
"--c++", "--no_rtti", "--no_exceptions" | ||
] | ||
if target.core == "Cortex-M7FD": | ||
asm_flags_cmd += ["--fpu", "VFPv5"] | ||
c_flags_cmd.append("--fpu=VFPv5") | ||
elif target.core == "Cortex-M7F": | ||
asm_flags_cmd += ["--fpu", "VFPv5_sp"] | ||
c_flags_cmd.append("--fpu=VFPv5_sp") | ||
elif target.core == "Cortex-M23" or target.core == "Cortex-M33" or target.core == "Cortex-M33F": | ||
self.flags["asm"] += ["--cmse"] | ||
self.flags["common"] += ["--cmse"] | ||
|
||
# Create Secure library | ||
if target.core == "Cortex-M23" or self.target.core == "Cortex-M33" or self.target.core == "Cortex-M33F": | ||
if CORE_ARCH[target.core] == 8 and not target.core.endswith("-NS"): | ||
self.flags["asm"] += ["--cmse"] | ||
self.flags["common"] += ["--cmse"] | ||
secure_file = join(build_dir, "cmse_lib.o") | ||
self.flags["ld"] += ["--import_cmse_lib_out=%s" % secure_file] | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they are dummy defines in code, may be old trial code
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, but it happens to be in target code which we are modifying/removing, hope its ok with Nuvoton.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actual PR for this change is #9431
Please note: Commit for this PR is afb559b
Dependent on : #9431