XUF224 channel comms

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
cl-b
Member++
Posts: 27
Joined: Fri Sep 15, 2017 2:58 pm

Re: XUF224 channel comms

Postby cl-b » Mon Feb 19, 2018 1:48 pm

We really need these information to understand where is the blocking issue and how to re-write the code to hope to get around this problem without adding too much latency.
User avatar
johned
XCore Addict
Posts: 158
Joined: Tue Mar 26, 2013 12:10 pm
Contact:

Postby johned » Mon Feb 19, 2018 6:56 pm

Hello Mike and Claire,

Does this help : https://www.xmos.com/published/how-use- ... r-channels

Best regards,
John
MyKeys
Member++
Posts: 24
Joined: Mon Jul 03, 2017 9:41 am

Postby MyKeys » Tue Feb 20, 2018 12:37 pm

Hi John & Claire,

I think my explanation previously is fairly comprehensive.
I only posted to help others in the future.

It's too easy to to go from a 2 tile device to a 4 tile device without fully comprehending the implications of the xlink switch fabric and it's bandwidth limitations.

Claire, the rate the buffer "drains" at is the rate at which you receive from the channel and this is limited by the bandwidth of the xlinks and hence can block/stall the sending end of the channel.

Kind regards,
Mike.
User avatar
johned
XCore Addict
Posts: 158
Joined: Tue Mar 26, 2013 12:10 pm
Contact:

Postby johned » Wed Feb 21, 2018 12:04 pm

Here's some code that might help understand the latency and throughput questions.
It prints out the start times and the time taken for the transfers, in both the Tx and Rx ends.


Code: Select all

// Tests the latency and throughput of xCONNECT
// xcc chanComms.xc XCORE-200-EXPLORER.xn -o chanComms.xe

#include <platform.h>
#include <stdio.h>
#include <xs1.h>

#define PACKET_SIZE        1024


void foo(streaming chanend c)
{
    unsigned count = 0;
    unsigned rxd = 0;
    timer t;
    int start_time, end_time, overhead_time;

    t :> start_time; t :> end_time; overhead_time = end_time - start_time;


    t :> start_time;
#pragma loop unroll
    for (unsigned i = 0; i < PACKET_SIZE; i++) {
        c <: count;
        count++;
    }
    t :> end_time;
    printf ("foo Tx : start = %d, period = %d cycles\n", start_time, end_time - start_time - overhead_time);

    t :> start_time;
#pragma loop unroll
    for (unsigned i = 0; i < PACKET_SIZE; i++) {
        c :> rxd;
    }
    t :> end_time;
    printf ("foo Rx : start = %d, period = %d cycles\n", start_time, end_time - start_time - overhead_time);
}

void bar(streaming chanend c)
{
    unsigned count = 0;
    unsigned rxd = 0;
    timer t;
    int start_time, end_time, overhead_time;

    t :> start_time; t :> end_time; overhead_time = end_time - start_time;


    t :> start_time;
#pragma loop unroll
    for (unsigned i = 0; i < PACKET_SIZE; i++) {
        c :> rxd;
    }
    t :> end_time;
    printf ("bar Rx : start = %d, period = %d cycles\n", start_time, end_time - start_time - overhead_time);

    t :> start_time;
#pragma loop unroll
    for (unsigned i = 0; i < PACKET_SIZE; i++) {
        c <: count;
        count++;
    }
    t :> end_time;
    printf ("bar Tx : start = %d, period = %d cycles\n", start_time, end_time - start_time - overhead_time);
}

int main(){
    streaming chan c;
    par{
        on tile[0]:foo(c);
        on tile[1]:bar(c);
//        on tile[0]:bar(c);
    }
    return 0;
}

Who is online

Users browsing this forum: No registered users and 66 guests