has anybody gotten 16 channel PDM microphones working?

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
ccrome
Active Member
Posts: 62
Joined: Wed Sep 23, 2015 1:15 am

has anybody gotten 16 channel PDM microphones working?

Post by ccrome »

Hi there,
I wonder if anybody has gotten 16 channels of PDM microphones on one tile to pass timing?

I would like to get 16-channels of PDM per tile, so I tried the following code:

main.xc

Code: Select all

/*
 * pdm_microphone.xc
 *
 *  Created on: Feb 28, 2017
 *      Author: caleb
 */
#include <platform.h>
#include <xs1.h>
#include <mic_array.h>

#define N_CHANNELS 16
#define N_DECIMATORS (N_CHANNELS / 4)
#define N_PDM_RX (N_CHANNELS / 8)

on tile[0]: clock               pdmclk     = XS1_CLKBLK_1;
on tile[0]: in port             p_mclk     = XS1_PORT_1E;
on tile[0]: out port            p_pdm_clk  = XS1_PORT_1F;

on tile[0]: in buffered port:32 p_pdm_mics_0 = XS1_PORT_8B;
on tile[0]: in buffered port:32 p_pdm_mics_1 = XS1_PORT_8A;


#if (N_CHANNELS & 0X7)
#error you must have a multiple of 8 PDM channels
#endif



int application(streaming chanend c_ds_output[N_DECIMATORS])
{
    return 0;
}
int main()
{
    streaming chan c_pdm_to_dec[N_DECIMATORS];
    streaming chan c_ds_output[N_DECIMATORS];

    configure_clock_src_divide(pdmclk, p_mclk, 1);
    configure_port_clock_output(p_pdm_clk, pdmclk);
    configure_in_port(p_pdm_mics_0, pdmclk);
#if N_PDM_RX > 1
    configure_in_port(p_pdm_mics_1, pdmclk);
#endif
    start_clock(pdmclk);

    par {
        mic_array_pdm_rx(p_pdm_mics_0, c_pdm_to_dec[0], c_pdm_to_dec[1]);
        mic_array_decimate_to_pcm_4ch(c_pdm_to_dec[0], c_ds_output[0], MIC_ARRAY_NO_INTERNAL_CHANS);
        mic_array_decimate_to_pcm_4ch(c_pdm_to_dec[1], c_ds_output[1], MIC_ARRAY_NO_INTERNAL_CHANS);
#if N_PDM_RX > 1
        mic_array_pdm_rx(p_pdm_mics_1, c_pdm_to_dec[2], c_pdm_to_dec[3]);
        mic_array_decimate_to_pcm_4ch(c_pdm_to_dec[2], c_ds_output[2], MIC_ARRAY_NO_INTERNAL_CHANS);
        mic_array_decimate_to_pcm_4ch(c_pdm_to_dec[3], c_ds_output[3], MIC_ARRAY_NO_INTERNAL_CHANS);
#endif
        application(c_ds_output);
    }
    return 0;
}

mic_array_conf.h

Code: Select all

#define MIC_ARRAY_NUM_MICS 16
#define MIC_ARRAY_MAX_FRAME_SIZE_LOG2 4
This code passes the timing checks with flying colors when compiled with
#define N_CHANNELS 8

Code: Select all

14:40:00 **** Incremental Build of configuration Default for project pdm_microphone ****
xmake CONFIG=Default all 
Checking build modules
Using build modules: lib_mic_array(3.0.1) lib_xassert(3.0.0) lib_logging(2.1.0) lib_dsp(3.0.0)
Analyzing pdm_microphone.xc
Propagating analysis
Creating dependencies for pdm_microphone.xc
Compiling pdm_microphone.xc
Creating pdm_microphone.xe
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:22: warning: route(0)     Pass with 4 unknowns, Num Paths: 1, Slack: 654.0 ns, Required: 2.6 us, Worst: 2.0 us, Min Core Frequency: 299 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:24: warning: route(1)     Pass with 4 unknowns, Num Paths: 1, Slack: 716.5 ns, Required: 2.6 us, Worst: 1.9 us, Min Core Frequency: 289 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:26: warning: route(2)     Pass with 18 unknowns, Num Paths: 167, Slack: 729.0 ns, Required: 2.6 us, Worst: 1.9 us, Min Core Frequency: 288 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:28: warning: route(3)     Pass with 4 unknowns, Num Paths: 5, Slack: 704.0 ns, Required: 2.6 us, Worst: 1.9 us, Min Core Frequency: 291 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:30: warning: route(4)     Pass with 4 unknowns, Num Paths: 1, Slack: 591.5 ns, Required: 2.6 us, Worst: 2.0 us, Min Core Frequency: 309 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:32: warning: route(5)     Pass with 4 unknowns, Num Paths: 1, Slack: 654.0 ns, Required: 2.6 us, Worst: 2.0 us, Min Core Frequency: 299 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:34: warning: route(6)     Pass with 18 unknowns, Num Paths: 167, Slack: 666.5 ns, Required: 2.6 us, Worst: 1.9 us, Min Core Frequency: 297 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:36: warning: route(7)     Pass with 4 unknowns, Num Paths: 5, Slack: 641.5 ns, Required: 2.6 us, Worst: 2.0 us, Min Core Frequency: 301 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:38: warning: route(8)     Pass with 4 unknowns, Num Paths: 1, Slack: 591.5 ns, Required: 2.6 us, Worst: 2.0 us, Min Core Frequency: 309 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:40: warning: route(9)     Pass with 4 unknowns, Num Paths: 1, Slack: 654.0 ns, Required: 2.6 us, Worst: 2.0 us, Min Core Frequency: 299 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:42: warning: route(10)     Pass with 18 unknowns, Num Paths: 167, Slack: 666.5 ns, Required: 2.6 us, Worst: 1.9 us, Min Core Frequency: 297 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:44: warning: route(11)     Pass with 4 unknowns, Num Paths: 5, Slack: 641.5 ns, Required: 2.6 us, Worst: 2.0 us, Min Core Frequency: 301 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:46: warning: route(12)     Pass with 4 unknowns, Num Paths: 1, Slack: 591.5 ns, Required: 2.6 us, Worst: 2.0 us, Min Core Frequency: 309 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:48: warning: route(13)     Pass with 4 unknowns, Num Paths: 1, Slack: 654.0 ns, Required: 2.6 us, Worst: 2.0 us, Min Core Frequency: 299 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:50: warning: route(14)     Pass with 18 unknowns, Num Paths: 167, Slack: 666.5 ns, Required: 2.6 us, Worst: 1.9 us, Min Core Frequency: 297 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:52: warning: route(15)     Pass with 4 unknowns, Num Paths: 5, Slack: 616.5 ns, Required: 2.6 us, Worst: 2.0 us, Min Core Frequency: 305 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/pdm_rx.S:6: warning: route(16)     Pass with 6 unknowns, Num Paths: 1, Slack: 1.5 us, Required: 2.6 us, Worst: 1.1 us, Min Core Frequency: 167 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/pdm_rx.S:8: warning: route(17)     Pass with 10 unknowns, Num Paths: 1, Slack: 679.0 ns, Required: 2.6 us, Worst: 1.9 us, Min Core Frequency: 295 MHz
Build Complete

14:40:03 Build Finished (took 3s.137ms)

but fails timing checks miserably with
#define N_CHANNELS 16

Code: Select all

14:38:45 **** Incremental Build of configuration Default for project pdm_microphone ****
xmake CONFIG=Default all 
Checking build modules
Using build modules: lib_mic_array(3.0.1) lib_xassert(3.0.0) lib_logging(2.1.0) lib_dsp(3.0.0)
Analyzing pdm_microphone.xc
Creating dependencies for pdm_microphone.xc
Compiling pdm_microphone.xc
Creating pdm_microphone.xe
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:22: warning: route(0)     Fail (timing violation) with 4 unknowns, Num Paths: 1, Violation: 143.5 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:24: warning: route(1)     Fail (timing violation) with 4 unknowns, Num Paths: 1, Violation: 73.5 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 411 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:26: warning: route(2)     Fail (timing violation) with 18 unknowns, Num Paths: 167, Violation: 21.0 ns, Required: 2.6 us, Worst: 2.6 us, Min Core Frequency: 403 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:28: warning: route(3)     Fail (timing violation) with 4 unknowns, Num Paths: 5, Violation: 73.5 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 411 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:30: warning: route(4)     Fail (timing violation) with 4 unknowns, Num Paths: 1, Violation: 231.0 ns, Required: 2.6 us, Worst: 2.8 us, Min Core Frequency: 435 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:32: warning: route(5)     Fail (timing violation) with 4 unknowns, Num Paths: 1, Violation: 143.5 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:34: warning: route(6)     Fail (timing violation) with 18 unknowns, Num Paths: 167, Violation: 91.0 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 413 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:36: warning: route(7)     Fail (timing violation) with 4 unknowns, Num Paths: 5, Violation: 143.5 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:38: warning: route(8)     Fail (timing violation) with 4 unknowns, Num Paths: 1, Violation: 231.0 ns, Required: 2.6 us, Worst: 2.8 us, Min Core Frequency: 435 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:40: warning: route(9)     Fail (timing violation) with 4 unknowns, Num Paths: 1, Violation: 143.5 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:42: warning: route(10)     Fail (timing violation) with 18 unknowns, Num Paths: 167, Violation: 91.0 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 413 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:44: warning: route(11)     Fail (timing violation) with 4 unknowns, Num Paths: 5, Violation: 143.5 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:46: warning: route(12)     Fail (timing violation) with 4 unknowns, Num Paths: 1, Violation: 231.0 ns, Required: 2.6 us, Worst: 2.8 us, Min Core Frequency: 435 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:48: warning: route(13)     Fail (timing violation) with 4 unknowns, Num Paths: 1, Violation: 143.5 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:50: warning: route(14)     Fail (timing violation) with 18 unknowns, Num Paths: 167, Violation: 91.0 ns, Required: 2.6 us, Worst: 2.7 us, Min Core Frequency: 413 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:52: warning: route(15)     Fail (timing violation) with 4 unknowns, Num Paths: 5, Violation: 178.5 ns, Required: 2.6 us, Worst: 2.8 us, Min Core Frequency: 427 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/pdm_rx.S:6: warning: route(16)     Pass with 6 unknowns, Num Paths: 1, Slack: 1.1 us, Required: 2.6 us, Worst: 1.5 us, Min Core Frequency: 231 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/pdm_rx.S:8: warning: route(17)     Fail (timing violation) with 10 unknowns, Num Paths: 1, Violation: 38.5 ns, Required: 2.6 us, Worst: 2.6 us, Min Core Frequency: 405 MHz
Build Complete
Interestingly, my clock speed is set to 500MHz in the .xn file, and all of the failing Min Core Frequencies are less than 500 MHz.

Another question: Can I tell the system that I'm using less than a 3.072 MHz pdm clock frequency and have the timing checks automatically adjusted accordingly?

Thanks,
-Caleb


User avatar
ccrome
Active Member
Posts: 62
Joined: Wed Sep 23, 2015 1:15 am

Post by ccrome »

Okay,
so I played around with the .xn file, and it appears that seems to be the problem. When I used the default XE216 XL216-256-TQ128-C20.xn that's auto-generated, the Node was:

Code: Select all

<Node Id="0" InPackageId="0" Type="XS2-L16A-256" SystemFrequency="500MHz">
which fails all tests as shown in OP.

However, by changing that to

Code: Select all

<Node Id="0" InPackageId="0" Type="XS2-L16A-256" Oscillator="25MHz" SystemFrequency="500MHz" referencefrequency="100MHz">
it passes with the following

Code: Select all

xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:22: warning: route(0)     Pass with 4 unknowns, Num Paths: 1, Slack: 406.0 ns, Required: 2.6 us, Worst: 2.2 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:24: warning: route(1)     Pass with 4 unknowns, Num Paths: 1, Slack: 462.0 ns, Required: 2.6 us, Worst: 2.1 us, Min Core Frequency: 411 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:26: warning: route(2)     Pass with 18 unknowns, Num Paths: 167, Slack: 504.0 ns, Required: 2.6 us, Worst: 2.1 us, Min Core Frequency: 403 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:28: warning: route(3)     Pass with 4 unknowns, Num Paths: 5, Slack: 462.0 ns, Required: 2.6 us, Worst: 2.1 us, Min Core Frequency: 411 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:30: warning: route(4)     Pass with 4 unknowns, Num Paths: 1, Slack: 336.0 ns, Required: 2.6 us, Worst: 2.3 us, Min Core Frequency: 435 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:32: warning: route(5)     Pass with 4 unknowns, Num Paths: 1, Slack: 406.0 ns, Required: 2.6 us, Worst: 2.2 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:34: warning: route(6)     Pass with 18 unknowns, Num Paths: 167, Slack: 448.0 ns, Required: 2.6 us, Worst: 2.2 us, Min Core Frequency: 413 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:36: warning: route(7)     Pass with 4 unknowns, Num Paths: 5, Slack: 406.0 ns, Required: 2.6 us, Worst: 2.2 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:38: warning: route(8)     Pass with 4 unknowns, Num Paths: 1, Slack: 336.0 ns, Required: 2.6 us, Worst: 2.3 us, Min Core Frequency: 435 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:40: warning: route(9)     Pass with 4 unknowns, Num Paths: 1, Slack: 406.0 ns, Required: 2.6 us, Worst: 2.2 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:42: warning: route(10)     Pass with 18 unknowns, Num Paths: 167, Slack: 448.0 ns, Required: 2.6 us, Worst: 2.2 us, Min Core Frequency: 413 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:44: warning: route(11)     Pass with 4 unknowns, Num Paths: 5, Slack: 406.0 ns, Required: 2.6 us, Worst: 2.2 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:46: warning: route(12)     Pass with 4 unknowns, Num Paths: 1, Slack: 336.0 ns, Required: 2.6 us, Worst: 2.3 us, Min Core Frequency: 435 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:48: warning: route(13)     Pass with 4 unknowns, Num Paths: 1, Slack: 406.0 ns, Required: 2.6 us, Worst: 2.2 us, Min Core Frequency: 422 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:50: warning: route(14)     Pass with 18 unknowns, Num Paths: 167, Slack: 448.0 ns, Required: 2.6 us, Worst: 2.2 us, Min Core Frequency: 413 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/decimate_to_pcm_4ch.S:52: warning: route(15)     Pass with 4 unknowns, Num Paths: 5, Slack: 378.0 ns, Required: 2.6 us, Worst: 2.2 us, Min Core Frequency: 427 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/pdm_rx.S:6: warning: route(16)     Pass with 6 unknowns, Num Paths: 1, Slack: 1.4 us, Required: 2.6 us, Worst: 1.2 us, Min Core Frequency: 231 MHz
xta: C:/cygwin64/home/caleb/xmos/pdm_microphones/lib_mic_array/src/pdm_rx.S:8: warning: route(17)     Pass with 10 unknowns, Num Paths: 1, Slack: 490.0 ns, Required: 2.6 us, Worst: 2.1 us, Min Core Frequency: 405 MHz
Does that make sense?

Thanks,
-C
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

Code: Select all

Does that make sense?
Yes - that makes sense. If you use the generic device xn file, then the compiler knows less about your platform and misses details such as used flash, where the link for xscope may be connected and clock frequency. The compiler generates a whole bunch of startup code automatically, including the PLL setup (and multi-tile boot if used)
.
The PLL setup code needs to know the clock frequency to set the multiplier and dividers appropriately, to derive the actual core and reference clocks.

More info (for the keen) here: http://www.xmos.com/download/private/XN ... 3944B).pdf
qiusongxiao
Member++
Posts: 16
Joined: Thu Apr 10, 2014 4:42 pm

Post by qiusongxiao »

Hi ,We had deal with this before ,16 PDM microphones on one tile.Now it has already works. So you can do it ,just be patient to check out.

Image
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

16 PDM microphones on one tile.Now it has already works.
Nice!! When can we find out more?