Commit 8b49478b authored by Christophe Favergeon's avatar Christophe Favergeon
Browse files

Update to the Python wrapper

Corrected issue with RFFT APIs
Added some features to compute graph

Improved documentation related to RFFT
Changed how Python wrapper is built (to prepare fro future
evolution).
parent 0fe2214d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
DSP_Lib_TestSuite/build/
PythonWrapper/build/
PythonWrapper/cmsisdsp.cp36-win_amd64.pyd
PythonWrapper/internal.cp36-win_amd64.pyd
PythonWrapper/*.so
@@ -22,7 +21,6 @@ Output/
Documentation/html/
PACK.xsd
*.uvguix.*
build
Documentation/html/*
Doxygen/history.txt
Doxygen/dsp.dxy
@@ -30,3 +28,4 @@ __pycache__/
*.pyd
.DS_Store
.swiftpm/
build/
+12 −0
Original line number Diff line number Diff line
@@ -235,6 +235,8 @@ Another possibility would be to make the buffer static by redefining the macro `

Optional arguments to pass to the C API of the scheduler function

It can either use a `string` or a list of `string` where an element is an argument of the function (and should be valid `C`).

##### codeArray (default = True)

When true, the scheduling is defined as an array. Otherwise, a list of function calls is generated.
@@ -305,6 +307,8 @@ In case of dynamic / asynchronous scheduling, the FIFOs may need to be bigger th

For instance, a value of 10 means the FIFO will have their size updated from `oldSize` to `1.1 * oldSize` which is ` (1 + 10%)* oldSize`

If the value is a `float` instead of an `int` it will be used as is. For instance, `1.1` would increase the size by `1.1` and be equivalent to the setting `10` (for 10 percent).

##### asyncDefaultSkip (default True)

Behavior of a pure function (like CMSIS-DSP) in asynchronous mode. When `True`, the execution is skipped if the function can't be executed. If `False`, an error is raised.
@@ -353,6 +357,14 @@ The `fifoClass` argument allows to choose a specific FIFO class in the generated

Only the `FIFO` class is provided by default. Any new implementation must inherit from `FIFObase<T>`

There is also an option to set the scaling factor when used in asynchronous mode:

```python
g.connect(odd.o,debug.i,fifoScale=3.0)
```

When this option is set, it will be used (instead of the global setting). This must be a float.

## How to build the examples

In folder `ComputeGraph/example/build`, type the `cmake` command:
+0 −74
Original line number Diff line number Diff line
/* ----------------------------------------------------------------------
 * Project:      CMSIS DSP Library
 * Title:        RingPrivate.h
 * Description:  Implementation for RTX + Keil MDK
 *
 * $Date:        30 July 2021
 * $Revision:    V1.10.0
 *
 * Target Processor: Cortex-M and Cortex-A cores
 * -------------------------------------------------------------------- */
/*
 * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the License); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef _RINGPRIVATE_H_
#define _RINGPRIVATE_H_

/*

Implementation for RTX + Keil MDK Event logger

*/

#include <stddef.h>
#include "arm_vsi.h"
#ifdef _RTE_
#include "RTE_Components.h"
#endif
#include CMSIS_device_header

#include "cmsis_os2.h"

#include "SchedEvents.h"
/*

RTX dependent definition

*/
#define RING_BEGINCRITICALSECTION()  NVIC_DisableIRQ ((IRQn_Type)config->interruptID); 
#define RING_ENDCRITICALSECTION() NVIC_EnableIRQ ((IRQn_Type)config->interruptID);

#define RING_WAIT_BUFFER(TIMEOUT) osThreadFlagsWait(1,osFlagsWaitAny,(TIMEOUT))
#define RING_HASWAITERROR(F) (F < 0)

#define RING_RELEASE_BUFFER(THREADID) osThreadFlagsSet((osThreadId_t)(THREADID),1)

/* Debug trace using Event Recorder */
#define RING_DBG_USER_RESERVE_BUFFER(ID,CONF) EventRecord2 (Evt_UsrReserve, (ID), (uint32_t)(CONF))
#define RING_DBG_USER_RELEASE_BUFFER(ID,CONF) EventRecord2 (Evt_UsrRelease, (ID), (uint32_t)(CONF))
#define RING_DBG_USER_WAIT_BUFFER(ID,CONF) EventRecord2 (Evt_UsrWait, (ID), (uint32_t)(CONF))
#define RING_DBG_USER_BUFFER_RELEASED(ID,CONF) EventRecord2 (Evt_UsrFree, (ID), (uint32_t)(CONF))
#define RING_DBG_USER_STATUS(SA,SB,CONF) EventRecord4 (Evt_UsrStatus, config->SA,config->SB,(uint32_t)(CONF),0)

#define RING_DBG_INT_RESERVE_BUFFER(ID,CONF) EventRecord2 (Evt_IntReserve, (ID), (uint32_t)(CONF))
#define RING_DBG_INT_RELEASE_BUFFER(ID,CONF) EventRecord2 (Evt_IntRelease, (ID), (uint32_t)(CONF))
#define RING_DBG_INT_RELEASE_USER(CONF) EventRecord2 (Evt_IntReleaseUser, (uint32_t)(CONF), 0)
#define RING_DBG_INT_STATUS(SA,SB,CONF) EventRecord4 (Evt_IntStatus, config->SA,config->SB,(uint32_t)(CONF),0)

#define RING_DBG_ERROR(ERROR,CONF) EventRecord2 (Evt_Error, (ERROR), (uint32_t)(CONF))

#endif
 No newline at end of file
+0 −69
Original line number Diff line number Diff line
/* ----------------------------------------------------------------------
 * Project:      CMSIS DSP Library
 * Title:        SchedEvents.h
 * Description:  Definition of the events for the Keil MDK Event logger
 *
 * $Date:        30 July 2021
 * $Revision:    V1.10.0
 *
 * Target Processor: Cortex-M and Cortex-A cores
 * -------------------------------------------------------------------- */
/*
 * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the License); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef _SCHEDEVT_H
#define _SCHEDEVT_H

/*

Definition of Event IDs for Keil MDK EventRecorder

*/
#include "EventRecorder.h"

#define EvtNodes 0x00   
#define EvtRing_User 0x01     
#define EvtRing_Int 0x02 
#define EvtRing_All 0x03 

/* Node events */

#define Evt_Sink         EventID (EventLevelAPI,   EvtNodes, 0x00)
#define Evt_SinkVal      EventID (EventLevelOp,   EvtNodes, 0x01)
#define Evt_Source       EventID (EventLevelAPI,   EvtNodes, 0x02)

/* User Ring Events */
#define Evt_UsrReserve      EventID (EventLevelOp,   EvtRing_User, 0x00)
#define Evt_UsrRelease      EventID (EventLevelOp,   EvtRing_User, 0x01)
#define Evt_UsrWait      EventID (EventLevelOp,   EvtRing_User, 0x02)
#define Evt_UsrFree      EventID (EventLevelOp,   EvtRing_User, 0x03)
#define Evt_UsrStatus      EventID (EventLevelDetail,   EvtRing_User, 0x04)


/* Interrupt Ring Events */
#define Evt_IntReserve      EventID (EventLevelOp,   EvtRing_Int, 0x00)
#define Evt_IntRelease      EventID (EventLevelOp,   EvtRing_Int, 0x01)
#define Evt_IntReleaseUser      EventID (EventLevelOp,   EvtRing_Int, 0x02)
#define Evt_IntStatus      EventID (EventLevelDetail,   EvtRing_Int, 0x03)


/* Other Ring Events */
#define Evt_Error      EventID (EventLevelError,   EvtRing_All, 0x00)



#endif
 No newline at end of file
+0 −69
Original line number Diff line number Diff line
#ifndef _AUDIOCONFIG_H_
#define _AUDIOCONFIG_H_ 

// <<< Use Configuration Wizard in Context Menu >>>

// <e>Audio Configuration for RX
#ifndef AUDIO_DRV_RX_ENABLED
#define AUDIO_DRV_RX_ENABLED 1
#endif
// <o>Sampling Frequency <8000=>   8000 kHz  <16000=>   16000 kHz
//                     <44100=>   44100 kHz  <48000=>   48000 kHz
#ifndef AUDIO_DRV_SAMPLINGFREQUENCY_RX
#define AUDIO_DRV_SAMPLINGFREQUENCY_RX 16000
#endif

// <o>Number of samples <256=> 256 <512=> 512 <1024=> 1024 <2048=> 2048  
// <i> Must be consistent with the settings of the Audio source
#ifndef AUDIO_DRV_NBSAMPLES_RX
#define AUDIO_DRV_NBSAMPLES_RX 2048
#endif

// <o>Number of channels <1=>   Mono <2=>   Stereo
#ifndef AUDIO_DRV_NBCHANNELS_RX
#define AUDIO_DRV_NBCHANNELS_RX 1U
#endif

// <o>Channel encoding <2=>   16 Bits
#ifndef AUDIO_DRV_CHANNEL_ENCODING_RX
#define AUDIO_DRV_CHANNEL_ENCODING_RX 2U
#endif

// </e>

// <e>Audio Configuration for TX
#ifndef AUDIO_DRV_TX_ENABLED
#define AUDIO_DRV_TX_ENABLED 1
#endif
// <o>Sampling Frequency <8000=>   8000 kHz  <16000=>   16000 kHz
//                     <44100=>   44100 kHz  <48000=>   48000 kHz
#ifndef AUDIO_DRV_SAMPLINGFREQUENCY_TX
#define AUDIO_DRV_SAMPLINGFREQUENCY_TX 16000
#endif

// <o>Number of samples <256=> 256 <512=> 512 <1024=> 1024 <2048=> 2048  
// <i> Must be consistent with the settings of the Audio source
#ifndef AUDIO_DRV_NBSAMPLES_TX
#define AUDIO_DRV_NBSAMPLES_TX 2048
#endif

// <o>Number of channels <1=>   Mono <2=>   Stereo
#ifndef AUDIO_DRV_NBCHANNELS_TX
#define AUDIO_DRV_NBCHANNELS_TX 1U
#endif

// <o>Channel encoding <2=>   16 Bits
#ifndef AUDIO_DRV_CHANNEL_ENCODING_TX
#define AUDIO_DRV_CHANNEL_ENCODING_TX 2U
#endif

// </e>

// <q> CGSTATIC_VHT_TX_RX_ORDERING: Force TX RX ordering
#define CGSTATIC_VHT_TX_RX_ORDERING 0

// <<< end of configuration section >>>

#define CGSTATIC_AUDIO_CONFIG 

#endif
Loading