-
Notifications
You must be signed in to change notification settings - Fork 173
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
Autosize tasks #476
Closed
Closed
Autosize tasks #476
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkeeter
added a commit
that referenced
this pull request
Jun 10, 2022
This PR implements task autosizing, at long last! It builds on the previous work with relocatable task builds (#584). After building the relocatable task ELF file, it runs a "dummy link" against a linker script with "infinite" memory (in practice, the entirety of memory available on the chip). It then parses the resulting (static) binary to extract sizes. After finding sizes for every task, it runs the same memory packer as before, then relinks each task with the resulting memory. Task sizes are based on the target microcontroller, with a new `alignment` parameter passed to `allocate_one`. There are extensive changes to `cargo xtask sizes` to make it more generically useful, decoupling the suggestions from the "find the size of a static ELF". WARNING: this changes the format of the exported JSON files! In addition, there are a bunch of new helper functions in `Config` to help with task and memory sizing / alignment. This fixes #474 and maybe #439, and deprecates #476
Closed in favor of #595 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes explicit task sizes (in
app.toml
) in favor of calculating sizes at build-timestaticlib
staticlib
is linked manually into a maximum-size address spaceThe build proceeds as usual from here.
To implement this system, I dramatically refactored
dist.rs
. In particular,package()
now builds astruct Packager
and calls functions on it. It's still awkwardly stateful: some functions require other functions to have run first, to populated data in thestruct
. Still, I think it's an improvement over the previous 650-LOC single function.This does not handle kernel autosizing, because