-
Notifications
You must be signed in to change notification settings - Fork 349
Add new CONFIG_DCBLOCK_HIFI and move generic XCHAL_HAVE logic to common.h #8720
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
Conversation
…on.h 1. The `if XCHAL_HAVE_HIFI4` macro logic is duplicated across many source files. Starting with dcblock.h, make it generic and move it to common.h 2. Add the ability to override the max available HIFI level using Kconfig Signed-off-by: Marc Herbert <marc.herbert@intel.com>
|
|
||
| config DCBLOCK_HIFI | ||
| int "DC Blocking Filter HIFI level (-1 = max)" | ||
| default -1 |
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.
can we depend on ARCH_XTENSA and make this a Kconfig choice (where each choice would depend on ARCH_XTENSA_HIFI_n set by top level PLATFORM Kconfig) ?
Btw, I think Peter Mitsis (@peter-mitsis) will have the HiFi flavour landing in Zephyr soon as part of the HiFi context save/restore work. i.e. we can reuse RTOS supplied Kconfig data.
Whatever methodology we use, it should also scale to x86 and ARM SIMD.
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.
where is ARCH_XTENSA and ARCH_XTENSA_HIFI_n definition? is it already exist or added later?
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.
also, there is no HIFI option for this module, no HIFI3 and HIFI4 option.
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.
also, there is no HIFI option for this module, no HIFI3 and HIFI4 option.
In this prototype you enter '3' or '4' or any version you like. @lgirdwood already requested a Kconfig choice
Please spend more time reading and make sure you understand better before commenting.
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.
Just to confirm, I am indeed working on adding HiFi DSP support in Zephyr so that its registers will be saved/restored on relevant context switches.
EDIT: now at:
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.
@peter-mitsis , do you mean you will adding HIFI related config into zephyr, then SOF can directly leverage it?
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.
All - @peter-mitsis will need to define a SOC level Kconfig to indicate the HIFI level on xtensa. i.e. this will say hifi3, hifi4, hifi5 etc as the different hifi ISA add additional register that must be saved/restored.
This same Kconfig can be reused here to indicate the highest HIFI SIMD level for each platform/SOC i.e. some menuconfig options will depend on this Zephyr SOC Kconfig.
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.
All - @peter-mitsis will need to define a SOC level Kconfig to indicate the HIFI level on xtensa.
My attempt to do this:
Just prototype and draft but a functional one so please review.
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.
Thank you all, then this open will be resolved soon.
let's wait for Peter's PR to zephyr and got merged.
@peter-mitsis , could you share PR link here once you submit here? or add me into review list for the zephyr PR?
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.
#8787 is similar to this but with a Kconfig choice instead.
| #define IS_ENABLED_STEP_3(ignore, value, ...) (!!(value)) | ||
| #endif | ||
|
|
||
| #define SOF_AUTO_HIFI -1 |
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.
Will need to namespace these as SOF_ARCH_XTENSA_feature
|
|
||
| config DCBLOCK_HIFI | ||
| int "DC Blocking Filter HIFI level (-1 = max)" | ||
| default -1 |
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.
where is ARCH_XTENSA and ARCH_XTENSA_HIFI_n definition? is it already exist or added later?
| # define SOF_MAX_XCHAL_HIFI SOF_NO_HIFI | ||
| #else | ||
| # include <xtensa/config/core-isa.h> | ||
| // Maybe we could make this fully generic (and less readable!) using |
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 am not sure this is best way to go, with this, module HIFI config still depend on core-isa, this is centuralized.
The logic is more complex and with more dependency, like XCC, more complex SOF_USE_HIFI macro definition, if expand this to other dsp platform(non-xtensa and X86), this part will need change again and hard to make changes.
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.
module HIFI config still depend on core-isa, this is centuralized
You haven't summarized why these are bad.
We can duplicate core-isa.h in various places and I'm looking at options but core-isa.h will always remain the origin, true reference for HIFI facts.
with more dependency, like
__XCC__
__XCC__ is the only reliable way to detect Cadence toolchains and it's what Zephyr uses.
#8682 (comment)
Which other dependency?
The logic is more complex [...] and hard to make changes.
If you find this logic complex then I'm afraid nothing can be done for you.
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 mean maintain and expand complex, this logic is for xtensa, how about if a new architecture add? for example, ARM?
I did this in a separate PR because the code is totally different: no macros and everything in Kconfig: It's not as tedious and verbose as I was afraid it would be BUT:
|
|
Alternative #8787 has been merged. |
The
if XCHAL_HAVE_HIFI4macro logic is duplicated across many source files. Starting with dcblock.h, make it generic and move it to common.hAdd the ability to override the max available HIFI level using Kconfig