From 48814ea26319416860de218cb58b40c7951d5205 Mon Sep 17 00:00:00 2001 From: Ed Date: Fri, 20 Sep 2024 14:50:29 +0100 Subject: [PATCH] measure_mips -> XCCM --- examples/measure_mips/CMakeLists.txt | 80 ++++++++++++------------- examples/measure_mips/src/config.xscope | 3 + examples/measure_mips/src/main.xc | 5 -- 3 files changed, 40 insertions(+), 48 deletions(-) create mode 100644 examples/measure_mips/src/config.xscope diff --git a/examples/measure_mips/CMakeLists.txt b/examples/measure_mips/CMakeLists.txt index fcb15d1e..1cd3f692 100644 --- a/examples/measure_mips/CMakeLists.txt +++ b/examples/measure_mips/CMakeLists.txt @@ -1,43 +1,37 @@ - -set(APP_NAME measure_mips) - -set( TARGET_XN XVF3610_Q60A.xn ) - - -#********************** -# includes -#********************** - -set( APP_INCLUDES "src" ) -list( APPEND APP_INCLUDES ${DEMO_COMMON_INCLUDES} ) - -#********************** -# sources -#********************** - -file( GLOB_RECURSE APP_SOURCES "src/*.c" "src/*.xc" "src/*.cpp" "src/*.S" ) -list( APPEND APP_SOURCES ${DEMO_COMMON_SOURCES} ) - -#********************** -# create targets -#********************** - -set( NAME_MAP thread;isr ) - -foreach( N_MICS 1 2 ) - foreach( USE_ISR 1 0 ) - - list( GET NAME_MAP ${USE_ISR} tmp ) - set( TARG_NAME "${APP_NAME}_${N_MICS}mic_${tmp}" ) - - unset(TARG_FLAGS) - list( APPEND TARG_FLAGS - "-DN_MICS=${N_MICS}" - "-DAPP_USE_PDM_RX_ISR=${USE_ISR}" ) - - make_demo_app_target( ${TARG_NAME} "${APP_SOURCES}" "${APP_INCLUDES}" "${TARG_FLAGS}" ) - - add_dependencies( demos ${TARG_NAME} ) - - endforeach() -endforeach() \ No newline at end of file +cmake_minimum_required(VERSION 3.21) +include($ENV{XMOS_CMAKE_PATH}/xcommon.cmake) +project(measure_mips) + +set(XMOS_SANDBOX_DIR ${CMAKE_CURRENT_LIST_DIR}/../../..) + +include(${CMAKE_CURRENT_LIST_DIR}/../deps.cmake) +set(APP_HW_TARGET XVF3610_Q60A.xn) + +set(NAME_MAP thread;isr) +foreach(N_MICS 1 2) + foreach(USE_ISR 1 0) + list(GET NAME_MAP ${USE_ISR} tmp) + set(CONFIG "${N_MICS}mic_${tmp}") + + set(APP_COMPILER_FLAGS_${CONFIG} -Os + -g + -report + -mcmodel=large + -DAPP_NAME="DEMO_${CONFIG}" + -DAPP_USE_PDM_RX_ISR=${USE_ISR} + -DMIC_ARRAY_CONFIG_MCLK_FREQ=24576000 + -DMIC_ARRAY_CONFIG_PDM_FREQ=3072000 + -DMIC_ARRAY_CONFIG_MIC_COUNT=${N_MICS} + -DN_MICS=${N_MICS}) + endforeach() +endforeach() + +# Manually set sources as we take from the common directory too +file(GLOB_RECURSE APP_C_SRCS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "src/*.c" "../common/src/*.c") +file(GLOB_RECURSE APP_XC_SRCS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "src/*.xc" "../common/src/*.xc") +file(GLOB_RECURSE APP_CXX_SRCS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "src/*.cpp") +file(GLOB_RECURSE APP_ASM_SRCS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "../common/src/*.S") + +set(APP_INCLUDES src ../common/src ../common/util) + +XMOS_REGISTER_APP() diff --git a/examples/measure_mips/src/config.xscope b/examples/measure_mips/src/config.xscope new file mode 100644 index 00000000..72069113 --- /dev/null +++ b/examples/measure_mips/src/config.xscope @@ -0,0 +1,3 @@ + + + diff --git a/examples/measure_mips/src/main.xc b/examples/measure_mips/src/main.xc index 2816409e..59139cfd 100644 --- a/examples/measure_mips/src/main.xc +++ b/examples/measure_mips/src/main.xc @@ -30,7 +30,6 @@ int main() { par { on tile[0]: { - xscope_config_io(XSCOPE_IO_BASIC); printf("Running " APP_NAME "..\n"); eat_audio_frames_task((chanend_t) c_audio_frames, @@ -39,10 +38,6 @@ int main() { on tile[1]: { - - // Force it to use xscope, never mind any config.xscope files - xscope_config_io(XSCOPE_IO_BASIC); - // Set up the media clocks device_pll_init();