CMSIS-DSP: Correcting issue #1182

pull/19/head
Christophe Favergeon 5 years ago
parent 8a5de0715b
commit acaa70a62a

@ -182,6 +182,11 @@ option(DCT4_Q15_512 "dct4 q15 512" OFF)
option(DCT4_Q15_2048 "dct4 q15 2048" OFF)
option(DCT4_Q15_8192 "dct4 q15 8192" OFF)
option(ARM_CFFT_RADIX2_Q15 "deprecated q15 radix2 cfft" OFF)
option(ARM_CFFT_RADIX4_Q15 "deprecated q15 radix4 cfft" OFF)
option(ARM_CFFT_RADIX2_Q31 "deprecated q31 radix2 cfft" OFF)
option(ARM_CFFT_RADIX4_Q31 "deprecated q31 radix4 cfft" OFF)
###########################
#

@ -160,11 +160,25 @@ target_sources(CMSISDSPTransform PRIVATE arm_cfft_init_q31.c)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_q31.c)
endif()
if (WRAPPER OR ARM_CFFT_RADIX2_Q15)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_q15.c)
endif()
if (NOT CONFIGTABLE OR ALLFFT OR ARM_CFFT_RADIX4_Q15)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_q15.c)
endif()
if (WRAPPER OR ARM_CFFT_RADIX2_Q31)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_q31.c)
endif()
if (NOT CONFIGTABLE OR ALLFFT OR ARM_CFFT_RADIX4_Q31)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_q31.c)
endif()
# For scipy or wrappers or benchmarks
if (WRAPPER)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_f32.c)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_q31.c)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_q15.c)
if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_f16.c)
endif()

@ -92,7 +92,7 @@ arm_status arm_cfft_radix2_init_q15(
/* Initialise the Flag for calculation Bit reversal or not */
S->bitReverseFlag = bitReverseFlag;
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096)
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024)
/* Initializations of structure parameters depending on the FFT length */
switch (S->fftLen)
@ -105,7 +105,7 @@ arm_status arm_cfft_radix2_init_q15(
/* Initialise the bit reversal table modifier */
S->bitRevFactor = 1U;
/* Initialise the bit reversal table pointer */
S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096;
S->pBitRevTable = (uint16_t *) armBitRevTable;
break;
@ -117,7 +117,7 @@ arm_status arm_cfft_radix2_init_q15(
/* Initialise the bit reversal table modifier */
S->bitRevFactor = 2U;
/* Initialise the bit reversal table pointer */
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[1];
S->pBitRevTable = (uint16_t *) & armBitRevTable[1];
break;
@ -125,7 +125,7 @@ arm_status arm_cfft_radix2_init_q15(
/* Initializations of structure parameters for 1024 point FFT */
S->twidCoefModifier = 4U;
S->bitRevFactor = 4U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3];
S->pBitRevTable = (uint16_t *) & armBitRevTable[3];
break;
@ -133,7 +133,7 @@ arm_status arm_cfft_radix2_init_q15(
/* Initializations of structure parameters for 512 point FFT */
S->twidCoefModifier = 8U;
S->bitRevFactor = 8U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[7];
S->pBitRevTable = (uint16_t *) & armBitRevTable[7];
break;
@ -141,7 +141,7 @@ arm_status arm_cfft_radix2_init_q15(
/* Initializations of structure parameters for 256 point FFT */
S->twidCoefModifier = 16U;
S->bitRevFactor = 16U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15];
S->pBitRevTable = (uint16_t *) & armBitRevTable[15];
break;
@ -149,7 +149,7 @@ arm_status arm_cfft_radix2_init_q15(
/* Initializations of structure parameters for 128 point FFT */
S->twidCoefModifier = 32U;
S->bitRevFactor = 32U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[31];
S->pBitRevTable = (uint16_t *) & armBitRevTable[31];
break;
@ -157,7 +157,7 @@ arm_status arm_cfft_radix2_init_q15(
/* Initializations of structure parameters for 64 point FFT */
S->twidCoefModifier = 64U;
S->bitRevFactor = 64U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63];
S->pBitRevTable = (uint16_t *) & armBitRevTable[63];
break;
@ -165,7 +165,7 @@ arm_status arm_cfft_radix2_init_q15(
/* Initializations of structure parameters for 32 point FFT */
S->twidCoefModifier = 128U;
S->bitRevFactor = 128U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[127];
S->pBitRevTable = (uint16_t *) & armBitRevTable[127];
break;
@ -173,7 +173,7 @@ arm_status arm_cfft_radix2_init_q15(
/* Initializations of structure parameters for 16 point FFT */
S->twidCoefModifier = 256U;
S->bitRevFactor = 256U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255];
S->pBitRevTable = (uint16_t *) & armBitRevTable[255];
break;

@ -93,7 +93,7 @@ arm_status arm_cfft_radix2_init_q31(
/* Initialise the Flag for calculation Bit reversal or not */
S->bitReverseFlag = bitReverseFlag;
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096)
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024)
/* Initializations of Instance structure depending on the FFT length */
switch (S->fftLen)
@ -105,7 +105,7 @@ arm_status arm_cfft_radix2_init_q31(
/* Initialise the bit reversal table modifier */
S->bitRevFactor = 1U;
/* Initialise the bit reversal table pointer */
S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096;
S->pBitRevTable = (uint16_t *) armBitRevTable;
break;
/* Initializations of structure parameters for 2048 point FFT */
@ -115,7 +115,7 @@ arm_status arm_cfft_radix2_init_q31(
/* Initialise the bit reversal table modifier */
S->bitRevFactor = 2U;
/* Initialise the bit reversal table pointer */
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[1];
S->pBitRevTable = (uint16_t *) & armBitRevTable[1];
break;
/* Initializations of structure parameters for 1024 point FFT */
@ -125,7 +125,7 @@ arm_status arm_cfft_radix2_init_q31(
/* Initialise the bit reversal table modifier */
S->bitRevFactor = 4U;
/* Initialise the bit reversal table pointer */
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3];
S->pBitRevTable = (uint16_t *) & armBitRevTable[3];
break;
/* Initializations of structure parameters for 512 point FFT */
@ -135,42 +135,42 @@ arm_status arm_cfft_radix2_init_q31(
/* Initialise the bit reversal table modifier */
S->bitRevFactor = 8U;
/* Initialise the bit reversal table pointer */
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[7];
S->pBitRevTable = (uint16_t *) & armBitRevTable[7];
break;
case 256U:
/* Initializations of structure parameters for 256 point FFT */
S->twidCoefModifier = 16U;
S->bitRevFactor = 16U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15];
S->pBitRevTable = (uint16_t *) & armBitRevTable[15];
break;
case 128U:
/* Initializations of structure parameters for 128 point FFT */
S->twidCoefModifier = 32U;
S->bitRevFactor = 32U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[31];
S->pBitRevTable = (uint16_t *) & armBitRevTable[31];
break;
case 64U:
/* Initializations of structure parameters for 64 point FFT */
S->twidCoefModifier = 64U;
S->bitRevFactor = 64U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63];
S->pBitRevTable = (uint16_t *) & armBitRevTable[63];
break;
case 32U:
/* Initializations of structure parameters for 32 point FFT */
S->twidCoefModifier = 128U;
S->bitRevFactor = 128U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[127];
S->pBitRevTable = (uint16_t *) & armBitRevTable[127];
break;
case 16U:
/* Initializations of structure parameters for 16 point FFT */
S->twidCoefModifier = 256U;
S->bitRevFactor = 256U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255];
S->pBitRevTable = (uint16_t *) & armBitRevTable[255];
break;

@ -91,7 +91,7 @@ arm_status arm_cfft_radix4_init_q15(
/* Initialise the Flag for calculation Bit reversal or not */
S->bitReverseFlag = bitReverseFlag;
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096)
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024)
/* Initializations of structure parameters depending on the FFT length */
switch (S->fftLen)
@ -104,7 +104,7 @@ arm_status arm_cfft_radix4_init_q15(
/* Initialise the bit reversal table modifier */
S->bitRevFactor = 1U;
/* Initialise the bit reversal table pointer */
S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096;
S->pBitRevTable = (uint16_t *) armBitRevTable;
break;
@ -112,7 +112,7 @@ arm_status arm_cfft_radix4_init_q15(
/* Initializations of structure parameters for 1024 point FFT */
S->twidCoefModifier = 4U;
S->bitRevFactor = 4U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3];
S->pBitRevTable = (uint16_t *) & armBitRevTable[3];
break;
@ -120,7 +120,7 @@ arm_status arm_cfft_radix4_init_q15(
/* Initializations of structure parameters for 256 point FFT */
S->twidCoefModifier = 16U;
S->bitRevFactor = 16U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15];
S->pBitRevTable = (uint16_t *) & armBitRevTable[15];
break;
@ -128,7 +128,7 @@ arm_status arm_cfft_radix4_init_q15(
/* Initializations of structure parameters for 64 point FFT */
S->twidCoefModifier = 64U;
S->bitRevFactor = 64U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63];
S->pBitRevTable = (uint16_t *) & armBitRevTable[63];
break;
@ -136,7 +136,7 @@ arm_status arm_cfft_radix4_init_q15(
/* Initializations of structure parameters for 16 point FFT */
S->twidCoefModifier = 256U;
S->bitRevFactor = 256U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255];
S->pBitRevTable = (uint16_t *) & armBitRevTable[255];
break;

@ -78,7 +78,7 @@ arm_status arm_cfft_radix4_init_q31(
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES)
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_4096)
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_4096)
/* Initialise the default arm status */
status = ARM_MATH_SUCCESS;
@ -91,7 +91,7 @@ arm_status arm_cfft_radix4_init_q31(
/* Initialise the Flag for calculation Bit reversal or not */
S->bitReverseFlag = bitReverseFlag;
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096)
#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024)
/* Initializations of Instance structure depending on the FFT length */
switch (S->fftLen)
@ -103,7 +103,7 @@ arm_status arm_cfft_radix4_init_q31(
/* Initialise the bit reversal table modifier */
S->bitRevFactor = 1U;
/* Initialise the bit reversal table pointer */
S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096;
S->pBitRevTable = (uint16_t *) armBitRevTable;
break;
/* Initializations of structure parameters for 1024 point FFT */
@ -113,28 +113,28 @@ arm_status arm_cfft_radix4_init_q31(
/* Initialise the bit reversal table modifier */
S->bitRevFactor = 4U;
/* Initialise the bit reversal table pointer */
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3];
S->pBitRevTable = (uint16_t *) & armBitRevTable[3];
break;
case 256U:
/* Initializations of structure parameters for 256 point FFT */
S->twidCoefModifier = 16U;
S->bitRevFactor = 16U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15];
S->pBitRevTable = (uint16_t *) & armBitRevTable[15];
break;
case 64U:
/* Initializations of structure parameters for 64 point FFT */
S->twidCoefModifier = 64U;
S->bitRevFactor = 64U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63];
S->pBitRevTable = (uint16_t *) & armBitRevTable[63];
break;
case 16U:
/* Initializations of structure parameters for 16 point FFT */
S->twidCoefModifier = 256U;
S->bitRevFactor = 256U;
S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255];
S->pBitRevTable = (uint16_t *) & armBitRevTable[255];
break;
default:

@ -841,6 +841,19 @@ if (CONFIGTABLE AND DCT4_Q15_8192)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_Q15_4096)
endif()
#######################################
#
# Deprecated radix2 and radix4 cfft
#
if (CONFIGTABLE AND (ARM_CFFT_RADIX2_Q15 OR ARM_CFFT_RADIX4_Q15))
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_Q15_4096)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
endif()
if (CONFIGTABLE AND (ARM_CFFT_RADIX2_Q31 OR ARM_CFFT_RADIX4_Q31))
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_Q31_4096)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
endif()
endfunction()

@ -4,7 +4,7 @@
# pip install streamlit
#
# How to use
# streamlit run cmsisconfig.py
# streamlit run cmsisdspconfig.py
#
import streamlit as st
import textwrap
@ -20,6 +20,7 @@ HELIUM=False
config={}
# Used in UI
config["allTables"] = True
config["allFFTs"] = True
config["allInterpolations"] = True
@ -44,6 +45,11 @@ config["LMS_NORM_Q15"]=False
config["CMPLX_MAG_Q31"]=False
config["CMPLX_MAG_Q15"]=False
config["CFFT_RADIX2_Q15"]=False
config["CFFT_RADIX4_Q15"]=False
config["CFFT_RADIX2_Q31"]=False
config["CFFT_RADIX4_Q31"]=False
config["BASICMATH"]=True
config["COMPLEXMATH"]=True
config["CONTROLLER"]=True
@ -64,6 +70,8 @@ config["ROUNDING"]=False
config["MATRIXCHECK"]=False
config["AUTOVECTORIZE"] = False
# Used as options in command line
# in case the UI option is worded differently
realname={}
realname["COS_F32"]="ARM_COS_F32"
realname["COS_Q31"]="ARM_COS_Q31"
@ -77,6 +85,10 @@ realname["LMS_NORM_Q31"]="ARM_LMS_NORM_Q31"
realname["LMS_NORM_Q15"]="ARM_LMS_NORM_Q15"
realname["CMPLX_MAG_Q31"]="ARM_CMPLX_MAG_Q31"
realname["CMPLX_MAG_Q15"]="ARM_CMPLX_MAG_Q15"
realname["CFFT_RADIX2_Q15"]="ARM_CFFT_RADIX2_Q15"
realname["CFFT_RADIX4_Q15"]="ARM_CFFT_RADIX4_Q15"
realname["CFFT_RADIX2_Q31"]="ARM_CFFT_RADIX2_Q31"
realname["CFFT_RADIX4_Q31"]="ARM_CFFT_RADIX4_Q31"
defaulton={}
defaulton["LOOPUNROLL"]=True
@ -375,6 +387,14 @@ def interpretCmakeOptions(cmake):
if test(cmake,"NEON") or test(cmake,"NEONEXPERIMENTAL"):
r.append("-IComputeLibrary/Include")
if test(cmake,"ARM_CFFT_RADIX2_Q15") or test(cmake,"ARM_CFFT_RADIX4_Q15"):
r.append("-DARM_TABLE_TWIDDLECOEF_Q15_4096")
r.append("-DARM_TABLE_BITREV_1024")
if test(cmake,"ARM_CFFT_RADIX2_Q31") or test(cmake,"ARM_CFFT_RADIX4_Q31"):
r.append("-DARM_TABLE_TWIDDLECOEF_Q31_4096")
r.append("-DARM_TABLE_BITREV_1024")
return (removeDuplicates(r))
def genMakeOptions(config):
@ -451,6 +471,11 @@ def configMake(config):
genui(config,"DCT4",DCTSIZE,DCTDATATYPE)
st.sidebar.markdown("#### RFFT")
genui(config,"RFFT",RFFTSIZE,RFFTDATATYPE)
st.sidebar.markdown("#### Radix2 and Radix4 CFFT")
st.sidebar.info("Those functions are deprecated")
multiselect(config,"Radix",["CFFT_RADIX2_Q15","CFFT_RADIX4_Q15","CFFT_RADIX2_Q31","CFFT_RADIX4_Q31"])

Loading…
Cancel
Save