Skip to content

Commit

Permalink
measure_mips -> XCCM
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-xmos committed Sep 20, 2024
1 parent b101652 commit 48814ea
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 48 deletions.
80 changes: 37 additions & 43 deletions examples/measure_mips/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
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()
3 changes: 3 additions & 0 deletions examples/measure_mips/src/config.xscope
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<xSCOPEconfig enabled="true" ioMode="basic">
</xSCOPEconfig>
5 changes: 0 additions & 5 deletions examples/measure_mips/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();

Expand Down

0 comments on commit 48814ea

Please sign in to comment.