8000 Multicore support for echo server by Courtney3141 · Pull Request #255 · au-ts/sddf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Multicore support for echo server #255

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Multicore support for echo server #255

wants to merge 2 commits into from

Conversation

Courtney3141
Copy link
Contributor
@Courtney3141 Courtney3141 commented Sep 23, 2024

This PR adds multicore support to the echo server example.

To build for SMP, first a core configuration file must be created associating a core value to each PD in the system. There are three example core configuration files added by this PR in the core_config directory: single_core.json, two_core.json and four_core.json. single_core.json sets each PD's core to 0, but will use the SMP microkit board.

Once the core configuration json has been created, it must be passed to make by setting the SMP_CONFIG flag to its path. If this flag is set, make will automatically add the _4_cores suffix to MICROKIT_BOARD where required. The flag is optional, and if it is not set the non-SMP microkit board will be used.

Changes introduced by this PR:

  • benchmark.c has been restructured so that it is aware of which core it is running on for better benchmark result output.
  • Each benchmark PD signals the benchmark on the next core to propagate the start and stop signals.
  • utilization_socket.c is now aware of how many cores are being utilised, and tracks the cycle counts for each active core. Thus it now has a variable number of cycle counter memory regions mapped in.
  • Restructure of benchmark configuration structs to enable variable behaviour depending on the number of active cores.
  • Restructure of meta.py to enable additional benchmark and idle PDs to be created depending on the number of active cores. This also requires that a variable number of .elf and .data files be created, thus these files are now created and formatted by meta.py rather than echo.mk.

These changes enable the build system to automatically restructure the system file and outputted elfs based on the core configuration file passed, so that no additional code changes are required.

Other changes required for this to be merged:

  • The non-SMP microkit SDKs must allow setting the cpu flag to 0 to avoid having to generate different system file formats for SMP and non-SMP.
  • SMP versions of boards must be supported by microkit.

Note that the struct serialisation performed by meta.py assumes the target architecture is 8 byte aligned.

@Courtney3141 Courtney3141 force-pushed the multicore branch 2 times, most recently from 34f6aaf to 5ecd421 Compare September 23, 2024 15:24
@Courtney3141 Courtney3141 changed the base branch from main to update_eth_HW_rings January 17, 2025 03:21
@Courtney3141 Courtney3141 marked this pull request as draft January 17, 2025 06:50
Base automatically changed from update_eth_HW_rings to main January 24, 2025 02:14
@Courtney3141 Courtney3141 force-pushed the multicore branch 6 times, most recently from 8ea0ff8 to 9caea02 Compare March 1, 2025 08:44
@Courtney3141 Courtney3141 changed the title Multicore Multicore support for echo server Mar 1, 2025
@Courtney3141 Courtney3141 marked this pull request as ready for review March 1, 2025 09:26
@Courtney3141 Courtney3141 force-pushed the multicore branch 2 times, most recently from f8ab8e9 to a982ab9 Compare March 6, 2025 10:16
@Courtney3141 Courtney3141 mentioned this pull request Mar 6, 2025
@Courtney3141 Courtney3141 added the enhancement New feature or request label Mar 6, 2025
@Courtney3141 Courtney3141 changed the base branch from main to clean_up_sel4bench March 6, 2025 10:31
Base automatically changed from clean_up_sel4bench to main March 6, 2025 11:45

#define BENCHMARK_MAX_CHILDREN 64 // TODO: Can we have a higher upper bound on this?
#define BENCHMARK_MAX_CORES 64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should know that CONFIG_MAX_NUM_NODES from seL4 generated configuration, why do we need a max of 64?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right, we do know this, the problem is that this number is used to define the size of arrays in the benchmark configuration structs, which are eventually serialised by the python meta program. To serialise correctly (leave the correct amount of empty array entries), the meta program must know the size of the C array, or CONFIG_MAX_NUM_NODES. I'm sure there is a way to give the python meta program access to this macro, but I'm not familiar with how to do it gracefully which is why it it's easier to hardcode a large number. If you can think of a graceful way to expose this macro in the meta program, feel free to change it.

Copy link
Contributor
@midnightveil midnightveil Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a gen_config.json file in the board directory somewhere which can be imported in python.

It's possible this makes sense to expose from the microkit end of sdfgen.

It's probably a better idea to make this a future issue for sdfgen rather than forcing you to add this.

But a comment would be nice just explaining why.

This would also solve the other review comment too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can add a comment.

Signed-off-by: Courtney Darville <courtneydarville94@outlook.com>
Signed-off-by: Courtney Darville <courtneydarville94@outlook.com>
midnightveil
midnightveil previously approved these changes May 5, 2025
@Courtney3141
Copy link
Contributor Author

Not sure if we need to include the license prefix for the .json files. Seems like we don't use it for the driver config files?

@alwin-joshy
Copy link
Contributor
alwin-joshy commented May 6, 2025

Not sure if we need to include the license prefix for the .json files. Seems like we don't use it for the driver config files?

You just need to add the files to here to get the CI to pass.

@Ivan-Velickovic
Copy link
Collaborator

The JSON files are really annoying for the license check since you can't have comments in JSON so you can't put the license headers there. I'll have more of a look into the license checker to see if there's anything smarter we can do to about this, it's really annoying having to add an entry into that file every time we add a new driver. The reason I don't pattern match on all .json files is that there could be some in the future that are not UNSW copy-righted? Maybe there's a way around that? I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0