Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/app_par_decimator/src/decimator_subtask.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ void decimator_subtask(
static inline
void shift_buffer(uint32_t* buff)
{
#if defined(__xcore__)
uint32_t* src = &buff[-1];
asm volatile("vldd %0[0]; vstd %1[0];" :: "r"(src), "r"(buff) : "memory" );
#endif // __xcore__
}
4 changes: 2 additions & 2 deletions lib_mic_array/api/mic_array/cpp/Decimator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ void mic_array::TwoStageDecimator<MIC_COUNT>
static inline
void mic_array::shift_buffer(uint32_t* buff)
{
#if defined(__xcore__)
uint32_t* src = &buff[-1];
asm volatile("vldd %0[0]; vstd %1[0];" :: "r"(src), "r"(buff) : "memory" );
#endif // __xcore__
}


2 changes: 2 additions & 0 deletions lib_mic_array/api/mic_array/cpp/PdmRx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ extern "C" {
void enable_pdm_rx_isr(
const port_t p_pdm_mics)
{
#if defined(__xcore__)
asm volatile(
"setc res[%0], %1 \n"
"ldap r11, pdm_rx_isr \n"
Expand All @@ -163,6 +164,7 @@ extern "C" {
:
: "r"(p_pdm_mics), "r"(XS1_SETC_IE_MODE_INTERRUPT)
: "r11" );
#endif // __xcore__
}

}
Expand Down
6 changes: 5 additions & 1 deletion lib_mic_array/src/deinterleave16.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2023-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#if defined(__XS3A__)

#define NSTACKWORDS 6

.text
Expand Down Expand Up @@ -138,4 +140,6 @@ deinterleave16:
.cc_bottom deinterleave16.func


.size deinterleave16, .L_end - deinterleave16
.size deinterleave16, .L_end - deinterleave16

#endif // __XS3A__
6 changes: 5 additions & 1 deletion lib_mic_array/src/deinterleave2.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2022-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#if defined(__XS3A__)

#define NSTACKWORDS 0

.text
Expand Down Expand Up @@ -36,4 +38,6 @@ deinterleave2:
.cc_bottom deinterleave2.func


.size deinterleave2, .L_end - deinterleave2
.size deinterleave2, .L_end - deinterleave2

#endif // __XS3A__
6 changes: 5 additions & 1 deletion lib_mic_array/src/deinterleave4.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2022-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#if defined(__XS3A__)

#define NSTACKWORDS 2

.text
Expand Down Expand Up @@ -80,4 +82,6 @@ deinterleave4:
.cc_bottom deinterleave4.func


.size deinterleave4, .L_end - deinterleave4
.size deinterleave4, .L_end - deinterleave4

#endif // __XS3A__
6 changes: 5 additions & 1 deletion lib_mic_array/src/deinterleave8.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2022-2026 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.

#if defined(__XS3A__)

#define NSTACKWORDS 6

.text
Expand Down Expand Up @@ -110,4 +112,6 @@ deinterleave8:
.cc_bottom deinterleave8.func


.size deinterleave8, .L_end - deinterleave8
.size deinterleave8, .L_end - deinterleave8

#endif // __XS3A__
2 changes: 1 addition & 1 deletion lib_mic_array/src/fir_1x16_bit.S
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ macc_coeffs:
.short 0x7fff, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100, 0x0080, 0x0040, 0x0020, 0x0010, 0x0008, 0x0004, 0x0002, 0x0001
.cc_bottom fir_1x16_bit.func

#endif
#endif // __XS3A__
2 changes: 2 additions & 0 deletions lib_mic_array/src/mic_array_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ void mic_array_resources_configure(
static inline
void mic_array_inpw8(const port_t p_pdm_mics)
{
#if defined(__xcore__)
uint32_t tmp;
asm volatile("inpw %0, res[%1], 8" : "=r"(tmp)
: "r" (p_pdm_mics));
#endif // __xcore__
}

void mic_array_pdm_clock_start(
Expand Down
4 changes: 4 additions & 0 deletions lib_mic_array/src/mic_array_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ void default_ma_task_start_decimator_3stg(TMicArray_3stg_decimator& mics, chanen
mics.ThreadEntry();
}

#if defined(__xcore__)
#define CLRSR(c) asm volatile("clrsr %0" : : "n"(c));
#else
#define CLRSR(c) ((void)0)
#endif
#define CLEAR_KEDI() CLRSR(XS1_SR_KEDI_MASK)

template <typename TMics>
Expand Down