Improved SDF documentation and updated for new cmake files.

New repository of CMSIS-DSP is now referring to the outside CMSIS Core
include folder. SDF examples had to be modified to support this.
pull/19/head
Christophe Favergeon 4 years ago
parent 0dc58a2e89
commit a248b071b3

@ -1,5 +1,8 @@
# CMSIS-DSP
[![Version](https://img.shields.io/github/v/release/arm-software/CMSIS-DSP)](https://github.com/ARM-software/CMSIS-DSP/releases/latest) [![License](https://img.shields.io/github/license/ARM-software/CMSIS-DSP)](https://github.com/ARM-software/CMSIS-DSP)
## About
CMSIS-DSP is an optimized compute library for embedded systems (DSP is in the name for legacy reasons).
@ -8,6 +11,8 @@ It provides optimized compute kernels for Cortex-M and for Cortex-A.
On Cortex-M, different variants are available according to the core and most of the functions are using a vectorized version when the Helium extension is available.
[Documentation](https://arm-software.github.io/CMSIS_5/DSP/html/index.html) is available as part of [CMSIS](https://github.com/ARM-software/CMSIS_5) repository.
### Kernels
Kernels provided by CMSIS-DSP (list not exhaustive):
@ -32,7 +37,7 @@ The goal is to make it easier to move from a design to a final implementation in
### Synchronous Data Flow
CMSIS-DSP is also providing an experimental synchronous data flow scheduler:
CMSIS-DSP is also providing an experimental [synchronous data flow scheduler](SDFTools/README.md):
* You define your compute graph in Python
* A static schedule (computed by the Python script is generated)
@ -120,7 +125,7 @@ include(configLib)
configLib(CMSISDSP)
```
A typical `cmake` command may be:
A typical `cmake` command (when using CMSIS-DSP test framework) may be:
```
cmake -DCMAKE_PREFIX_PATH="path to compiler" \

@ -22,7 +22,7 @@ In blue, the amount of samples generated or consumed by a node each time it is c
When the processing is applied to a stream of samples then the problem to solve is :
**how the blocks must be scheduled and the FIFOs connecting the block dimensioned**
> **how the blocks must be scheduled and the FIFOs connecting the block dimensioned**
The general problem can be very difficult. But, if some constraints are applied to the graph then some algorithms can compute a static schedule.
@ -87,7 +87,7 @@ The schedule is (the size of the FIFOs after the execution of the node displayed
At the end, both FIFOs are empty so the schedule can be run again : it is periodic !
## How to build the examples
## How to use the Synchronous Data Flow (SDF)
First, you must install the `CMSIS-DSP` PythonWrapper:
@ -95,16 +95,42 @@ First, you must install the `CMSIS-DSP` PythonWrapper:
pip install cmsisdsp
```
The script inside the cmsisdsp wrapper can be used to describe and generate the schedule.
You can create a `graph.py` and include :
```python
from cmsisdsp.sdf.scheduler import *
```
Then you can describe the blocks that you need in the compute graph if they are not provided by the SDF.
Finally, you can execute `graph.py` to generate the C++ files.
Those files need to include the `sdf/src/GenericNodes.h` and the nodes used in the graph and which can be found in `sdf/nodes/cpp`.
If you have declared new nodes in `graph.py` then you'll need to provide an implementation.
More details and explanations can be found in the documentation for the examples:
* [Example 1](documentation/example1.md)
* [Example 2](documentation/example2.md)
* [Example 3](documentation/example3.md)
* [Example 4](documentation/example4.md)
### How to build the examples
In folder `SDFTools/example/build`, type the `cmake` command:
```bash
cmake -DHOST=YES -DDOT="path to dot tool" -DCMSIS="path to cmsis" -G "Unix Makefiles" ..
cmake -DHOST=YES \
-DDOT="path to dot.EXE" \
-DCMSISCORE="path to cmsis core include directory" \
-G "Unix Makefiles" ..
```
The Graphviz dot tool is requiring a recent version supporting the HTML-like labels.
The path to cmsis must be the root folder containing CMSIS and Device folders.
If cmake is successful, you can type `make` to build the examples. It will also build CMSIS-DSP for the host.
If you don't have graphviz, the option -DDOT can be removed.
@ -126,7 +152,7 @@ To build the C examples:
* the .cpp file contained in the example must be built
* the include folder `sdf/src` must be added
For `example3` which is using an input file, cmake should have copied the input test pattern `input_example3.txt` inside the build folder. The output file will also be generated in the build folder.
For `example3` which is using an input file, `cmake` should have copied the input test pattern `input_example3.txt` inside the build folder. The output file will also be generated in the build folder.
`example4` is like `example3` but in pure Python and using the CMSIS-DSP Python wrapper (which must already be installed before trying the example). `example4` is not built by the cmake. You'll need to go to the `example4` folder and type:

@ -28,16 +28,17 @@ endfunction()
set(SDFDIR ${CMAKE_CURRENT_SOURCE_DIR}/../sdf)
set(DSP ${CMAKE_CURRENT_SOURCE_DIR}/../..)
function(add_sdf_dir TARGET)
target_include_directories(${TARGET} PRIVATE ${SDFDIR}/src)
target_include_directories(${TARGET} PRIVATE ${SDFDIR}/nodes/cpp)
target_include_directories(${TARGET} PRIVATE ${ROOT}/CMSIS/Core)
target_include_directories(${TARGET} PRIVATE ${ROOT}/CMSIS/DSP/Include)
target_include_directories(${TARGET} PRIVATE ${CMSISCORE})
target_include_directories(${TARGET} PRIVATE ${DSP}/Include)
endfunction()
project(Examples)
set(DSP ${ROOT}/CMSIS/DSP)
# Add DSP folder to module path
list(APPEND CMAKE_MODULE_PATH ${DSP})

@ -1,4 +1,4 @@
cmake -DHOST=YES ^
-DDOT="path to dot.EXE" ^
-DROOT="path to cmsis" ^
-DCMSISCORE="path to cmsis core" ^
-G "Unix Makefiles" ..

@ -1,4 +1,4 @@
cmake -DHOST=YES \
-DDOT="path to dot.EXE" \
-DCMSIS="path to cmsis" \
-DCMSISCORE="path to cmsis core" \
-G "Unix Makefiles" ..
Loading…
Cancel
Save