-
Notifications
You must be signed in to change notification settings - Fork 170
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
Xlnx cmake machine name change #302
Xlnx cmake machine name change #302
Conversation
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.
should zynqmp_amp_demo
become amp_demo
?
@arnopo yes that makes sense. The patch of more interest from my perspective is the 1/2 patch. |
2ad15da
to
0bba9ed
Compare
@arnopo updated. |
lib/system/generic/CMakeLists.txt
Outdated
if ("${PROJECT_MACHINE}" STREQUAL "xlnx_a53" OR | ||
"${PROJECT_MACHINE}" STREQUAL "xlnx_a72" OR | ||
"${PROJECT_MACHINE}" STREQUAL "xlnx_a78" OR | ||
"${PROJECT_MACHINE}" STREQUAL "xlnx_r5" OR |
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.
These machine names need to be chosen carefully.
So, Mulit-core platforms like zynqmp, has different configuration in same core. I can imagine three machine names in zynqmp: R5-lockstep-core, R5-split-core0 and R5-split-core1.
If we go that route, we might end up, with long list of MACHINE names, as future plaforms might have more such cores and configurations.
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.
Or, we can introduce other cmake variables such as:
PROJECT_MACHINE=zynqmp, PROJECT_CORE_TYPE=a53/R5, PROJECT_CORE_CONF=lockstep/split, PROJECT_CORE_NUMBER="0, 1 etc... ?
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.
Hi @tnmysh from Xilinx-amd side, the core number and SOC for latest workflows (SDT) is inferred via header files.
That is 'zynqmp' / 'versal' etc and core 0/ core1 are symbols in the BSP. That being said we can update BSP to output those two. lockstep/split is not always visible from tooling in Xilinx-amd so in many cases lockstep==rpu0 for the defaults.
if it is custom tooling then we can add separate handling for lockstep but again, rpu0 defaults should already be ok for lockstep unless you mean for lockstep it should be using all the available TCM banks for that cluster. please clarify what is needed for the lockstep case in default demos.
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.
though separately we would like to see if it is possible to remove the demos (can open separate PR / discussion for that)
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.
That is 'zynqmp' / 'versal' etc and core 0/ core1 are symbols in the BSP.
In such case, I believe we shouldn't need xlnx_a53, xlnx_a72 both.
As zynqmp -> a53, versal -> a72. So, can we just have "xlnx" Instead?
How do we distinguish between cortex-a and cortex-r ? Headers also provide such defines?
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.
Exactly, that is why I was suggesting to have more config variables, and those should be used across various software stacks i.e. apps, open-amp and libmetal.
My suggestion was for more generic case that can handle not xlnx platforms, but any multi-core platform.
May be we end up addressing it in different PR, but I am looking for suggestion that is scalable to other platforms too, not only xlnx platform.
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.
@tnmysh adding adding machine name for SOC/Core combo is fair since we see that combination across multiple vendor/SOC's for remoteproc as well as in open source libs.
what that means is 'versal_a72' is a common-sense convention. it has the drawback of being redundant with headers but scales for other SOC's and is sufficient for many cases. Core or vendor specific configurations (lockstep for rpu) can be captured in header symbols.
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.
PROJECT_MACHINE is not a generic variable and seems only used by AMD.
The objective here is to include xlnx
subdirectory, right ?
What about a directory hierarchy vendor/platform/core
or vendor/core
?
a PROJECT_VENDOR
( or another variable) could define the vendor sub-directory and then in vendor directory the core can be differentiated, if needed, by PROJECT_MACHINE
or PROJECT_TARGET
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.
Hi @arnopo thanks for the comment here.
so if I understand your suggestion then the libmetal usage would be as follows:
- add new cmake var PROJECT_VENDOR
- in libmetal lib ports we can just keep the vendor (each vendor can then organize that as needed, xilinx-amd would just keep the xlnx subdir)
in cmake lib simply validate PROJECT_VENDOR and then in the vendor-specific CMake there can be additional validation of the PROJECT_MACHINE/PROJECT_TARGET as needed
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.
This triggers a discussion on how to harmonize the folders in the different repositories to add more platform support. Let's add this to the agenda for the next RP call.
0bba9ed
to
29f1504
Compare
lib/system/freertos/CMakeLists.txt
Outdated
@@ -17,14 +17,8 @@ collect (PROJECT_LIB_SOURCES irq.c) | |||
collect (PROJECT_LIB_SOURCES shmem.c) | |||
collect (PROJECT_LIB_SOURCES time.c) | |||
|
|||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_MACHINE}) | |||
if ("${PROJECT_VENDOR}" STREQUAL "xlnx") |
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 was expecting something that looks like the PROJECT_MACHINE stuff below this.
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_VENDOR})
add_subdirectory(${PROJECT_VENDOR})
but you may need to do something if PROJECT_VENDOR is not set as the ${CMAKE_CURRENT_SOURCE_DIR}/ dir will exist. You can add another test or define a default value of PROJECT_VENDOR as "none" in the top level.
Can you get that done?
29f1504
to
bbb6ea3
Compare
@wmamills updated first commit per your review. |
the way it is now is keeping the pre-exissting CMake Machine logic check (template machine exists) please advise. |
@bentheredonethat how are you calling cmake for your builds? If it were me I would add xlnx-freertos.cmake and xlnx-generic.cmake and either delete the others or make them symlinks for back compatibility. Don't add symlinks for a72/a73 as the don't exist today. In the xlnx-* templates you should define the PROJECT_VENDOR. For handling the non-vendor case I would add a default of "none" for PROJECT_VENDOR in cmake/options.cmake. You can look at the handling of MACHINE in that file. I would expect something like: (untested) Since the lib/freertos/none will never exist, this will prevent your current logic from including lib/freertos twice. It will also allow the PROJECT_MACHINE test to run and right now I don't think it can. |
bbb6ea3
to
39671f3
Compare
@wmamills the PROJECT_VENDOR part i can add and test. for the cmake/platforms part -- im taking a look at that and not sure if I understand how that would work. I took a look and the thing is we still want the PROJECT_MACHINE for the microblaze case and for demos. additionally the CMAKE_C_FLAGS, CMAKE_SYSTEM_PROCESSOR, and CROSS_PREFIX are all different. having multiple differences per machine means it makes sense to keep them as is and (to me at least) just add the PROJECT_VENDOR to each of these. i have proceeded with the above in latest commits. |
@bentheredonethat yes you are right about the templates. I looked at the new commit and the template files look OK. We still need a default value for PROJECT_VENDOR as I outlined above as the base case fails with out it. I will try what I suggested here to make sure it works. You can run the generic build yourself, just look at the build_generic function in: |
…JECT_VENDOR Simplify logic that coordinates when to pull in Xilinx-AMD BSP and setup code basedd on new CMake variable 'PROJECT_VENDOR'. Add PROJECT_VENDOR check in cmake/options.cmake for case where PROJECT_VENDOR is not defined. Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
Add PROJECT_VENDOR to Xilinx-AMD .cmake platform files. Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
Match examples to lib CMake machine name change Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
39671f3
to
2078aa0
Compare
tested and built as suggested above. Thanks @wmamills ! newest commits add the null-case (no project_vendor) |
I tested as well and the generic-build works OK on my desk and in CI. CI is getting an error on the Zephyr step but that looks like an upstream change not something in the PR. |
Background on Zephyr error: |
With Zephyr locked to v3.6.0 the CI passes. diff --git a/.github/actions/build_ci/entrypoint.sh b/.github/actions/build_ci/entrypoint.sh FREERTOS_ZIP_URL=https://sourceforge.net/projects/freertos/files/FreeRTOS/V10.0.1/FreeRTOSv10.0.1.zip @@ -82,7 +83,7 @@ build_zephyr(){
|
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.
New version looks good now.
Hi @bentheredonethat |
@arnopo thanks for the comment. in that case would it be: |
The LInux example does not run on the R5 but on the A53, right? |
Should this not be:
this way w are keeping the 'xlnx' / vendor name right? so that would be: |
Reading your PR again , I think that my advice is not accurate. What I would like here for the folder hierachy to be coherent for the whole project. So |
@arnopo I am good with that. will send patch as suggested above. thanks |
Note that the second commit is just for consistency and can be removed -- It is known that the apps are moving to separate repo.
The intent here is to make the xlnx section of libmetal lib to be SOC agnostic.
CC @tnmysh @arnopo @wmamills