-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add HOST support #32
Comments
@christophe0606, how does this integrate with CMSIS-DSP? |
After a quick glance over CMSIS-DSP I assume that care would have to be taken to not define functions like __QADD twice. |
@JonatanAntoni The reasons why CMSIS-DSP can be compiled without CMSIS is to support Cortex-R, Cortex-A and aarch64 and the Python wrapper and to be able to build on target like Windows on Arm ... In those cases, we either use pure C (Python wrapper) or Neon extensions. But I don't see the use cases for CMSIS on host ? We don't need CMSIS on Windows on Arm for instance. Now the only reason why I need a few C implementation for some intrinsics is legacy. CMSIS-DSP code targeting M0 is sometimes the same as the one targeting M4 and relies on macros for some intrinsics and a C version when targeting M0. I think it would be cleaner to have a pure C version for M0 part. But the amount of intrinsics needed due to this legacy code is very low. |
Same use case as for CMSIS-DSP. Being able to compile a file which includes "cmsis_compiler.h" on x86 would greatly benefit unit tests. Currently, the burden to mock such a dependency is 100% offloaded to the users and once it gets to them, it's also 10x harder to solve. Having such a thing as HOST support would mean simply setting a flag somewhere in your build environment. Not having it means
|
Hi @higaski, Would you be able to contribute (at least a starting point) of what you would need for your project(s)? Thanks, |
Sorry for the delay. I've been thinking about this for a while now. Having a separate "generic" folder would definitively help, specially preventing "accidental" header lookup. I think I will be able to provide something (at least for the M-profile) but it might take a while as I can only shave off a few hours here and there. Personally I'd only need the current "topmodel" (so an v8M) to be mocked and all older or less feature rich types just refer to this one. Would that be acceptable for you? |
Sure, let's start with what you need. We can always add additional stuff later. |
I've run into this too, recently trying to update ardupilot from just the DSP parts of CMSIS_5 to CMSIS_DSP. It seems cmsis_dsp.h mixes two tasks:
For example, most of cmsis_gcc.h is needed for an AMD64 build, just for things like Separately, I'll mention that all CMSIS macros defined with two leading underscores overlap with the language reserved space, but fixing that is probably not something for CMSIS6 to solve. |
@rsaxvc If you are targetting anything else than Cortex-M, you can disable the dependency to CMSIS Core. If your target supports Neon, you can enable its support in CMSIS-DSP with |
Thanks @christophe0606, that works great for my needs.
Just a note, I think ARM11, Cortex-R4, and Cortex-A without NEON may also want to use CMSIS Core, because otherwise CMSIS-DSP has to fallback to scalar implementations rather than the older SWAR DSP extensions available on those devices. At least for ARM11 Q15 formats the FFT is quite a bit faster that way. |
CMSIS should contain an ANSI C compatible core header (e.g.
cmsis_none.h
orcmsis_ansci.h
) which can be compiled on any major platform without anything vendor specific. In the spirit of the "HOST build" of CMSIS-DSP which uses the none.h header to compile the DSP library on e.g. x86 we should have the same option available for just CMSIS.The problem is that nowadays most "HAL libraries" of ARM silicon vendors rely on CMSIS headers as a lower layer and while one could easily stub (and or mock) some C functions which use memory mapped structs for peripherals and so on it's actually really hard to replace the underlying CMSIS headers.
My personal approach would be
/edit
Once such a header exists CMSIS-DSP could have a dependency to CMSIS and use this header, instead of defining things like __QADD itself.
The text was updated successfully, but these errors were encountered: