Commit Graph

27 Commits

Author SHA1 Message Date
Marc Herbert 27e5f40b9a rebuild-testbench.sh: error when unknown arguments are passed
Silently discarding user input is really bad.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-19 16:54:45 +00:00
Seppo Ingalsuo ad655446fd Tools: Testbench: Remove -Wl,-EL to avoid build fail with xt-clang
The linker option to indicate little endian is unused and the
warning causes build fail:

clang-10clang-10: : errorerror: : -Wl,-EL: 'linker' input unused
[-Werror,-Wunused-command-line-argument]-Wl,-EL: 'linker' input unused
[-Werror,-Wunused-command-line-argument]

clang-10: error: -Wl,-EL: 'linker' input unused
[-Werror,-Wunused-command-line-argument]
clang-10: error: -Wl,-EL: 'linker' input unused
[-Werror,-Wunused-command-line-argument]
gmake[2]: *** [CMakeFiles/testbench.dir/build.make:76:
CMakeFiles/testbench.dir/testbench.c.o] Error 1

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-11-08 16:39:29 +00:00
Ranjani Sridharan 7266a73cbf tplg_parser: topology: Introduce new structures and update existing ones for IPC4
Update the struct tplg_comp_info to add some new fields needed for
parsing module information for IPC4. Also, introduce a couple of new
structures to save the pipeline info and fix the path to the peak_volum
header.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-09-29 14:46:34 +01:00
Liam Girdwood b5aaf6d068 testbench: strip out threading for pure xt-run usage.
Strip out all the threading and cache debug to become a pure xt-run
application. This removes a lot of code, including in the host LL
scheduler.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Seppo Ingalsuo e0d8078fa7 Tools: Testbench: Avoid need linux kernel headers in build
This patch adds simplified linux/types.h into testbench headers
to enable include of ALSA asoc.h to build without other difficult
kernel headers content.

The CMakeLists.txt files are updated to make a build time copy of
asoc.h to subdirectory include of the build directories. The new
directory is added to headers path.

This change avoids build fail with xcc toolchain that can't use the
gcc toolchain headers from the system where the ALSA headers are
located.

Suggested-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-20 19:33:55 +02:00
Seppo Ingalsuo da9344a6ad Tools: Testbench/tplg_parser: Check -Wimplicit-fallthrough support
The xt-xcc compiler RG-2017.8 does not support -Wimplicit-fallthrough
option. Add to CMakeLists.txt files check for the option and use it if
it is supported.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-17 11:08:58 +00:00
Liam Girdwood 1629a1f72c header: rtos: decouple headers into rtos specific directories.
No functional runtime change, but changes to rtos partitioning and the
layout of headers .

This patch creates RTOS specifc header paths and updates spinlock.h
and kernel.h to show the new usage. Other headers will incrementally follow.
It reuses the current zephyr topleve directory and creates a new
toplevel xtos directory for xtos specific files.

Due to the mixing of RTOS, driver and library headers at the top level include
directory it was necessary to create rtos specific header directories i.e.

src/include/rtos-xtos
src/include/rtos-zephyr

These RTOS include directories will eventually contain RTOS specific headers
whilst common logic and structures will be placed in non RTOS directories.

This will also mean

"#include <sof/spinlock.h>"

will become

"#include <rtos/spinlock.h>"

and will allow easier visualisation of where and why RTOS headers are being used.
This will help to eliminate cross usage of headers between RTOSes.

Subsequqnt patches will move more headers and rtos specific wrppaer
source files into rtos specific locations.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-31 12:01:07 +01:00
Liam Girdwood 2865cc2bb2 testbench: cmake: parser does not use CONFIG_LIBRARY cmake variable
Not used by parser cmakefile so delete.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-29 14:11:29 +01:00
Liam Girdwood 4af91f2c04 library: testbench: Add LL scheduler emulation
Add LL scheduler emulation for testbench pipelines. Each core is
implemented as a thread.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Curtis Malainey a0acad3414 CMake: require version 3.13
Without CMP0079 we cannot conditionally include libraries against SOF in
sub directories without seriously restructuring the project. This is
because the old policy requires the link target must be created in the
same folder. This does not work well from a configuration standpoint for
3P audio libraries trying to keep their config in src/audio/*. Rather
than enable the policy, lets simply upgrade since 3.13 is widely
available.

With this upgrade we can also remove the two version dependent checks at
the top of our scripts.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-10 17:19:29 +01:00
Marc Herbert 288e228c67 cmake: generate the complete .config at configuration time.
Add cmake -DINIT_CONFIG= option that can point at any initial file.

"make clean" does not delete .config any more.

Note reconfiguration does NOT causes recompilation because -imacros
hides the generated .h from CMake's dependency scan. This is not a
regression, that problems exists since -imacros was introduced. At least
it's now possible to "make clean" and rebuild without losing the .config
file.

Fix for #3617

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-03 22:33:53 +00:00
Marc Herbert 9dc763f782 testbench/cmake: don't hardcode the BUILD_COMMAND
ExternalProject() preserves the existing BUILD_COMMAND

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-18 16:11:46 +00:00
Curtis Malainey c5a0cf0d27 host: move edf_schedule to platform
move to allow other programs to use the scheduler

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00
Curtis Malainey f601906d83 host: move drivers and libs out of testbench
In order to support more linux based testing apps lets move the drivers
for the library build into the rest of the source tree so it is easy to
develop additional apps.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-06 11:04:38 +01:00
Curtis Malainey fd398c9d5e cmake: allow testbench to build with clang
We need clang support for the testbench therefore the following changes
are needed

remove -ftree-vectorizer-verbose since its deprecated in gcc and not
supported in clang

remove =3 from -Wimplicit-fallthrough=3 since 3 is the default level
anyways

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-09-28 10:37:26 +01:00
Marc Herbert a3a9eb3a2b cmake: no space after -imacros to avoid de-duplication
This is not needed yet as we use only one -imacros at a time but could
save someone a lot of time in the future; including the author of this
patch who will have forgotten about it in a few weeks.

For more details see
https://github.com/zephyrproject-rtos/zephyr/commit/e53c0d0ec7640b
and links from there.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-24 11:29:27 +01:00
Marc Herbert 1002899b95 Use '-imacros config.h' instead of explicit #include <config.h>
Using -imacros on the compiler command line instead of explicitly
including config.h is not just less tedious in the future:
- it also makes sure configuration always comes first and is never
  accidentally missed by an earlier #include
- it makes sure all translation units get the (same) configuration
- it lets parent projects like Zephyr override the config.h name

To test this I ran ./scripts/xtensa-build-all.sh -a -r, compared
binaries before and after this change and found no output difference.

Full disclosure: this required a few unrelated tricks not submitted here
like a .tarball-version file, commenting out __DATE__ and __TIME__ in a
few places, running strip-determinism on the .a files because our
crosstool-ng reference is not cutting-edge, etc.

As Tigerlake is not built by default it required a couple more hacks to
compile.

Blank lines are left instead of the former #include lines so even debug
objects are the same.

Only defconfigs were tested. On the other hand, this commit was _not_
performed by a script but by changing the name of the generated file and
clicking on and fixing every build failure. This proves that every
removed #include was actually required by one or more tested defconfigs
and that the added -imacros flag does affect the compilation of all the
modified files.

There is no #include config.h left: they were all in use in at least
one _defconfig.

I think comparing all binaries produced by ./scripts/xtensa-build-all.sh
-r -a provides extensive enough coverage but note this was tested only
with the crosstool-ng toolchain described in the SOF documentation.

The obsolete[*] xt-xcc front-end is gcc-based and the newer xt-clang
front-end is (surprise) clang-based. clang (copies many gcc options and)
does support -imacros so I don't expect any issue with either xt-xcc or
xt-clang. In the worst case, I do not expect any compiler front end to
_silently_ discard any unknown command line flag nor to ignore a missing
or misnamed config.h file.

[*] https://github.com/zephyrproject-rtos/zephyr/issues/3165

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-22 13:01:26 +01:00
Adrian Bonislawski 8f0e4d858b cmake: testbench compile options fix
This will provide CONFIG_LIBRARY variable for testbench build

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-18 13:25:28 +01:00
Adrian Bonislawski 863eb0a072 cmake: merge BUILD_LIBRARY and CONFIG_LIBRARY
There is only one valid CONFIG_LIBRARY which can be
configured via kconfig

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-18 13:25:28 +01:00
Tomasz Lauda 2baeeadeda schedule: separate task init functions for schedulers
Separates task init functions for all currently supported schedulers.
Some of the parameters are not common, so there is no need to
artificially extend function signatures.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-12-19 20:29:59 +00:00
Janusz Jankowski 1d92e8e175 sof: use RELATIVE_FILE instead of __FILE__
Use RELATIVE_FILE because __FILE__ makes binary output
dependent on project location.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-11 12:50:30 +00:00
Tomasz Lauda 8c61213c37 schedule: support dynamic scheduler creation
Refactors schedule code in order to allow dynamic scheduler
creation. We don't want to add every new scheduler to the static
array of scheduler_ops and also we don't want to have every
scheduler created on every platform. Maybe some of the platforms
won't need some of the future scheduler types.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-11 16:24:00 +02:00
Ranjani Sridharan c8b39dc9d6 testbench: Support reuse of topology parser
The topology parser in testbench can be re-used for
the other applications like the fuzzer. In order to
accomplish this, this commit does the following:
1. Separate the topology parser into a separate project
(tplg_parser) which implements the callbacks for parsing
all the components in topology.
2. Add support for parsing new components such as host
pcm, dai and mixer
3. Include the topology parser as an external project
in the testbench.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2019-08-07 08:47:58 +02:00
Tomasz Lauda 4de76bf578 timer: change id values
Refactors timer a little bit, to make better usage
of timer id values. Right now every timer has also irq
field, which is used to identify which interrupt line
to enable/disable. We don't longer need timer id to represent
also timer irq, so let's set custom ids and simplify
things.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 18:59:27 +01:00
Janusz Jankowski c6064624f6 cmake: add spdx license identifier
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski 2693daf503 cmake: rename BUILD_HOST to BUILD_LIBRARY
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-07 08:49:48 +02:00
Janusz Jankowski 91578f1a22 host: move testbench to tools
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-07 08:49:48 +02:00