-
Notifications
You must be signed in to change notification settings - Fork 322
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
DRAM data #9721
DRAM data #9721
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.
Looks simple.
@@ -76,6 +76,7 @@ def main(): | |||
executable = [] | |||
writable = [] | |||
readonly = [] | |||
readonly_dram = [] |
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 assume this will all be dumped when we build the target i.e. xkB hybrid RODATA in DRAM ?
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.
@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 <[email protected]>
fca47c0
to
2d03968
Compare
taking over #9765 |
@@ -8,7 +8,7 @@ | |||
|
|||
#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] = { |
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.
Need to make this change to SRC coefficients generator too (I can do it later).
CI:
|
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.
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)); |
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.
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 <[email protected]>
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 <[email protected]>
Enable fast_get() and fast_put() on supporting ACE platforms. Signed-off-by: Guennadi Liakhovetski <[email protected]>
And simple module tests for fast_get and fast_put() implemented in src/lib/fast-get/fast-get.c. Signed-off-by: Jyri Sarha <[email protected]>
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 <[email protected]>
2d03968
to
7402277
Compare
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.
LGTM
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.
Thanks, looks good now.
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