-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Avoid duplicated code by placing general code for all three Core-Types in a generic folder. #1599
base: develop
Are you sure you want to change the base?
Avoid duplicated code by placing general code for all three Core-Types in a generic folder. #1599
Conversation
Hello all, |
Hi @Masmiseim36, We repeatedly think about refactoring the layout but typically we end up that this is not worth the effort. The benefit seems to be small but there is a high risk of breaking existing applications. Your proposal looks basically fine. Removing the prefixes in the generic folder sounds problematic, though. We might easily create name clashes when using too generic names like Please take special note that the Regarding CI/CD: You should be able to run the CoreValidation tests on your machine as long as you have the required toolchains installed. Today, this are Arm Compiler 6 and GCC. You need CMSIS-Toolbox and probably want to use the Python Your changes break the current tests because you didn't update the pack description, see ARM.CMSIS.pdsc. As you changed the required include paths you need to update the references here. Cheers, |
92751bd
to
a8b2f56
Compare
Hello @JonatanAntoni, Thank you for your feedback. I see your point about the risk. The code duplication should also be solvable with keeping the current folder structure. We could introduce a new folder ‘Core_Generic’:
If you agree I can implement it accordingly. The CICD Issues should also be solved with this change. |
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.
We can rename Core
to Core_M
in order to be aligned with Core_A
and Core_R
. We just need to be careful how to name the generic part. It could be Core
but the individual header files should to have cmsis_
prefix in their names.
a8b2f56
to
9e47d03
Compare
Hello @JonatanAntoni |
753ffe5
to
a4b8c27
Compare
Hello JonatanAntoni,
|
@Masmiseim36, the problem is right in the first line. It's not a Python issue even if the thrown exception is not properly handled.
You do not have Cheers, |
a4b8c27
to
5754493
Compare
…s in a generic folder. The Core-Folder contains the generic code only. The specific code is placed in the folder Core_A/R/M and includes the generic code. CoreValidation: Adapt path changes for Cortex-M core
5754493
to
9f9482a
Compare
As already discussed in the pull request #1587 there are a lot of code duplication between Cortex-A and Cortex-M implementations. This applies in particular to the compiler specific files (cmsis_compiler.h, cmsis_gcc.h, ...). The compiler specific abstractions seem to have been copied from the Core_M implementation to the Core_A implementation sometime in the past and developed apart.
Therefor I like to make a suggestion to have a generic part which is compatible with Cortex A/R/M and a specific part for the respective cores. The folder structure could look like this:
All generic code files are placed here, the prefix is extended to ‘cmsis_generic’ to distinguish with the core specific files.
The folder structure is slightly different. The Core-Folder which contains the Cortex-M specific files is renamed to Core_M. This creates a consistent naming scheme with the other architectures and allows to use the Core folder for generic code.
This is a small incompatibility for Cortex-M devices as the path is changed. But this path is usually configured by the development environment and not in the user-project. As the development environment usually also contains the CMSIS library, the include folder can easily adapted when the library is updated by the compiler vendor. The change will therefor be invisible by the user of the library.
The Generic files are also better comparable now. As the structure and order of the functions is aligned to each other. Especially the IAR specific file had to be reordered for this. In the IAR file the comments were also added.
As it touches many files, it got quite big. Sorry for that.