Conversation
lgirdwood
reviewed
Dec 11, 2024
| executable = [] | ||
| writable = [] | ||
| readonly = [] | ||
| readonly_dram = [] |
Member
There was a problem hiding this comment.
I assume this will all be dumped when we build the target i.e. xkB hybrid RODATA in DRAM ?
Collaborator
Author
There was a problem hiding this comment.
@lgirdwood this isn't implemented yet, should be doable incrementally, yes
With this data can be assigned to a separate read-only section, which then will be kept in DRAM without copying it to SRAM on module instantiation. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
fca47c0 to
2d03968
Compare
Collaborator
Author
|
taking over #9765 |
singalsu
approved these changes
Jan 27, 2025
| #include <stdint.h> | ||
|
|
||
| static const int32_t src_int32_10_21_2500_5000_fir[480] = { | ||
| __cold_rodata static const int32_t src_int32_10_21_2500_5000_fir[480] = { |
Collaborator
There was a problem hiding this comment.
Need to make this change to SRC coefficients generator too (I can do it later).
Collaborator
Author
|
CI:
|
kv2019i
reviewed
Jan 28, 2025
Collaborator
kv2019i
left a comment
There was a problem hiding this comment.
No real showstoppers, a couple of comments inline.
zephyr/lib/fast-get.c
Outdated
|
|
||
| if (!data->num_entries) { | ||
| data->entries = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, | ||
| 32 * sizeof(*entries)); |
Collaborator
There was a problem hiding this comment.
32? Put a magic somewhere?
src coefficients take a lot of space, keep them in DRAM to only copy used sets in SRAM. Also move src_init() and src_free() to DRAM since they aren't performance-critical. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Implement fast_get() and fast_put() functions. The purpose of these functions is to maintain shared SRAM copies of data stored in DRAM. fast_get() First checks if there is already an SRAM copy of the same DRAM chunk. If there isn't reserve an SRAM chunk of the same size and copy the contents there, store the both pointers, size and reference count to in an internal data structure, and return the SRAM pointer. If there is, return the pointer to the existing SRAM copy and increase the reference count. fast_put() Look up the internal data record based on the SRAM address and decrement reference count. Free the SRAM chunk and the data record if reference count reaches zero, Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Enable fast_get() and fast_put() on supporting ACE platforms. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
And simple module tests for fast_get and fast_put() implemented in src/lib/fast-get/fast-get.c. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
The SRC coefficients are loaded to DRAM and commit copies the coefficients to SRAM when they are needed. The copying is done using fast_get() and the copy is released with fast_put() when its not needed anymore. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2d03968 to
7402277
Compare
Collaborator
Author
kv2019i
approved these changes
Jan 29, 2025
Collaborator
kv2019i
left a comment
There was a problem hiding this comment.
Thanks, looks good now.
This file contains hidden or 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
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 is an illustration of how data can be assigned to be kept in DRAM. This specific change should be done by adjusting scripts, creating those headers, not by patching headers directly. Besides additional code is needed to copy selected coefficient sets to SRAM for fast access during operation