-
Notifications
You must be signed in to change notification settings - Fork 61
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
Feature/use one core folder for all #26
Feature/use one core folder for all #26
Conversation
ed790e9
to
f9507ab
Compare
Hey Markus, This looks really great at the first glance! Thank you very much for your time contributing this. I think we can hardly assure that we don't break anything; even if the Core Validation tests are still working. But I guess this is the best we can do. Let us carefully review the changes and decide if we want to take the remaining risk in favour of the better maintainability. Thanks again, |
Just my 50ct regarding file naming. Any specific reason for going away from short And, as a proper detection of target architecture might be compiler specific, why not keep the "generic compiler headers" named like |
Hello @JonatanAntoni, |
Generating the pack failed during packchk validation. Could you please try to run the |
I will take a look, but I will need some more time for this. |
@JonatanAntoni It works on my machine now:
But I think there is an additional issue. In the moment there are two doxygen configuration. One for the core folder and another one for the core_A folder. I haven’t checked, if the second configuration can be removed or if further adaptions need to be done. |
I removed some doxygen warnings. The documentation seems to be okay as far as I can tell. |
ba9c5c3
to
d4a651b
Compare
Hello @Masmiseim36, At the first check I only have some minor complaints like:
|
Hello @GuentherMartin . Thanks for the feedback.
Regards |
I'd not mix different compilers. Yes, most of the clang-based compilers will have shared stuff. If we figure out that we can reuse major parts, I'd go for another |
d4a651b
to
da9c3cd
Compare
I have split tiarmclang into a generic and a cortex-m specific part. As expected, the file cmsis_armclang.h is almost identical to cmsis_tiarmclang.h. @JonatanAntoni , I saw that you are working on an implementation for clang on branch llvm. Do you want to use this code to abstract the generic parts of all clang variants? |
@Masmiseim36, yes, I am adding a |
That makes sense. |
Hi everyone, Thanks for raising this request @Masmiseim36. I really like the idea of tidying up the CMSIS repository so that it's more future-proof for newer cores and CMSIS v6 seems like a good opportunity to make such changes, if there's enough time/resources. I have no problem with having a single Core folder for:
I think that we need to be careful about file naming because there are some architectural features like the PMU that span different architectures. Another example is the MPU that can be used in both M-profile and R-profile systems. At the moment we have files liked pmu_v8.h for M-profile. I would like to see less code in the core_cmx.h headers and more files like pmu_v8.h in the future, i.e., creating more architectural header files, in particular for architectural features that are optional, but also to avoid duplicating code across processor core headers. We could rename such files to something more relevant, e.g., pmu_v8.h could become pmu_v8.1-m.h. However, I would imagine that doing this might potentially break documentation and might cause build failures in existing projects that upgrade to the newer version of CMSIS. Perhaps a better option would be to create three separate folders within the Core directory, for example:
Each of these folders we would store architecture specific files like mpu_v8.h, and so on. The M-profile folder name relates to the official names for the architecture profiles, e.g., https://developer.arm.com/Architectures/M-Profile%20Architecture. Therefore, it is clear to users that the top-level contains processor core files, and the sub-folders contain architectural information that the processor implementations inherit. Potentially these folders could be used for any compiler-specific headers for each architecture too. A top-level compiler file could perhaps still exist in the Core folder. Each processor core header would need to be updated to include the new folder path to the architectural headers. This is just one option and there are probably many different opinions on the exact structure and naming that should be used. I think that the main thing I want to get across here is that having some folders for architecture specific information means that we're not crossing the streams too much (apologies for Ghostbuster quote). Best regards, Ed P.S. In the longer term, probably after CMSIS v6 has been released, I would like to see less information in the processor core headers and just information that is implementation-specific to the Arm processor. A lot of the current code/information is architectural-specific and is duplicated across different core headers, e.g., NVIC registers and functions. Even the existing mpu_v7.h and mpu_v8.h headers do not include all of the MPU code. For instance, in theory we could move the MPU structs from the core headers into the relevant MPU headers too. The same goes for the PMU. Anyway, this is something we can raise via a separate pull request and do bit-by-bit. |
Hello @EdmundPlayer thanks for your detailed input. Appreciate that.
I do not quite understand how such a renaming (pmu_v8.h --> pmu_v8.1-m.h) should lead to a problem. In a CMSIS compliant usage, a <device>.h file specific to a controller is provided by the silicon vendor. The generic core_<cpu>.h file from the CMSIS library should be included in this file. See also: https://arm-software.github.io/CMSIS_5/Core/html/templates_pg.html
Where would a feature be stored that is used by several architectures? For example, the GIC (A and R) or MPU (M and R).
What would be the next steps for such a transformation? How can I provide support? Best Regards |
Hi Markus et al, I think it might be beneficial to have a online discussion about this topic rather than lengthen this thread. Would you be available for an online meeting throughout the the next couple of days? I should be able to host a session using Arm's Zoom infrastructure. If you let me know your availability via mail to jonatan.antoni@arm.com I'll send the invite. Cheers, |
That's a good idea Jonatan. Just to quickly answer some of your questions, Markus... The MPU in M-profile is not the same as the MPU in R-profile, so we'd need separate files for these profiles. Therefore, we might need to rename the mpu_v8.h header to something more specific, e.g., mpu_v8-m.h, or go with separate folders for different profiles, as I mentioned previously. You raise a good point about A-profile and R-profile as there is more commonality, e.g., the GIC. We could potentially create a shared folder for A-profile and R-profile for any common features, or create filenames that clearly show that the file is suitable for A-profile and R-profile. In terms of using the code, renaming the files might not be a problem, but we'd need to be 100% sure that this is the case. In terms of documentation though, some references to filenames might no longer be correct unless we update the documentation, e.g., the following document is just one example that refers to a specific file name (pmu_v8.h.) I think the Compiler folder idea is a possibility and something we could discuss. I am thinking as well that we need to consider what would make things easier for the customer/user and customers creating their own packs. |
Hi Markus and Jonatan, It was really useful to chat on the phone today about these improvements. Please find attached the sketch Jonatan drew during the meeting. Also, please find below a short summary of what we agreed on:
I hope this is accurate, but feel free to comment on anything I've missed or if anything needs amending. Also, perhaps the second-level files like cmsis_gcc.h could potentially be named cmsis_gcc_a.h, cmsis_gcc_r.h and cmsis_gcc_m.h instead, just so we don't have multiple files with the same name - this is just something another colleague thought of after our call, so I thought I should share their idea too. Best regards, Ed |
da9c3cd
to
7ac5f20
Compare
Hi Markus,
Thanks for your contribution. Your feedback from a real-world project is highly valuable to me.
When you restructure the pull-request, may I kindly ask you to break the contribution up into “baby steps”?
I.e., in a first PR we probably should only include the file renames to achieve the desired folder structure. I’d prefer no functional changes so that we have the chance to have the CoreValidation tests to continue running without changes, ideally.
That means, we move the compiler headers into the profile folders but keep the duplicated (shared) code. In a second PR we then move the common parts one folder level up.
Does this make sense to you?
|
Hello @JonatanAntoni , |
7ac5f20
to
f8dcdb2
Compare
…ssor core headers. * Separate folders for different architecture profiles (A-profile, R-profile and M-profile) * Top-level compiler headers will exist in the Core folder (no separate Compiler folder is needed). ** The cmsis_compiler.h header will continue to figure out which compiler toolchain is being used. ** The compiler toolchain specific headers in the Core folder will contain code common to all architecture profiles. ** Compiler headers specific to each architecture profiles can reside within the new architecture profile folders. ** The second-level files like cmsis_gcc.h are named cmsis_gcc_a.h, cmsis_gcc_r.h and cmsis_gcc_m.h to avoid having multiple files with the same name *For any features that are common to more than one architecture profile, e.g, the GIC is common to A-profile and R-profile, we can include the GIC header in each architectural folder, but only one of these files contains the code to avoid duplication. The file with the same name that doesn't include the code will simply include the code from the other folder- this should hopefully be clear to developers. * removed deprecated core_armv8xxx.h files. The files were added because no specific ARM v8-M device was available when Arm v-M support was added. * removed deprecated file cmsis_armcc_a.h. This compiler support is obsolete Add initial support for some Cortex-A and Cortex-R devices
f8dcdb2
to
9e9fad7
Compare
This PR looks stale, can it be closed? |
I had left it open for reference. I have submitted separate PullRequests for the next steps. You could possibly take a look at them. |
This pull request has come out of the discussion with @JonatanAntoni in #12.
This pull request is not yet fully perfected and is mainly intended to clarify and discuss the concept of a shared core folder.