Timing analysis

Technical discussions around xCORE processors (e.g. General Purpose (L/G), xCORE-USB, xCORE-Analog, xCORE-XA).
dimitris
Active Member
Posts: 37
Joined: Tue Feb 19, 2013 5:07 pm

Timing analysis

Postby dimitris » Thu Oct 23, 2014 12:39 pm

I would like to time some different simle scenarios on my slicekit-L16.
single consumer - single producer exchanging different size of data over a channel.
single consumer - multiple producers exchangind different size of data over a channel.

I've tried the single consumer single producer scenario and measured it by toggling an IO pin plugged to an oscilloscope however i expect that to be an awful method for the second scenario since it cannot capture the small timing differences between let's say 4 and 5 producers.

I decided to work with the Time Analyser but with not much luck.

After adding the -fno-xta-info flag, I saw that even refactoring simple code had an effect on the available endpoints and I do not understand why. For example, when I tried to exchange a struct of one char between two threads I got some nice endpoint. When this char was changed to an array of cars the endpoints where gone.

Now I am trying the following extremely simple code with no luck since no endpoints are available on the Analyser perspective nor listed on its command line

Code: Select all

void consumer_0(chanend c_data_0){
    char data;
    while(1){
        c_data_0 :> data;
    }
}

void producer_0(chanend c_data_0){
    char data;
    while(1){
        c_data_0 <: data;
    }
}

void main(){
    chand c_data_0;
    par{
        on tile[0]: consumer_0(c_data_0);
        on tile[1]: consumer_0(c_data_0);
    }
}
Obviously there is something that I am missing. Any suggestions on this or on other testing scenarios willb e highly appreciated.

Greetings
User avatar
kris
Experienced Member
Posts: 84
Joined: Mon Jan 18, 2010 2:52 pm

Postby kris » Fri Oct 24, 2014 8:40 am

Hi,

I just had a quick go with the 13.2.0 tools, and I do seem to see endpoints on the channel i/o instructions. I changed your code slightly, so as producer_0 was being called from tile[1] (instead of calling consumer_0 from both tiles). Compiling and running on the xta from the command line gave me the following:

> xcc -target=SLICEKIT-L16 test.xc -o test.xe
> xta
xta 1>load test.xe
xta 2>list allendpoints
tile[0], pc: 0x100d4, compilation dir: /scratch/kris/Test/XCoreXtaIssue, filename: test.xc, line number: 6
tile[1], pc: 0x100da, compilation dir: /scratch/kris/Test/XCoreXtaIssue, filename: test.xc, line number: 13
xta 3>

For me, the endpoints also show up in the xTIMEcomposer. Do you have any ideas what could be different in your case? Note: I don't think you'll want the -fno-xta-info flag, as this will cause the compiler to not include the potential endpoint information in the binary, thus the xta will not have access to this. Also, from the gui, it's worth making sure that each time you change the source, you rerun the xta via the 'time configuration' as simply switching to the timing perspective will not reload the new binary.

Hope this helps,
cheers,
Kris,
dimitris
Active Member
Posts: 37
Joined: Tue Feb 19, 2013 5:07 pm

Postby dimitris » Fri Oct 24, 2014 10:04 am

I will give it a try and reply. What I really want to measure is the time the producer will be blocked when the number of producers is increased and the size of data too.
I wonder is this will do or if I am planning this the wrong way.
Greetings.
User avatar
kris
Experienced Member
Posts: 84
Joined: Mon Jan 18, 2010 2:52 pm

Postby kris » Fri Oct 24, 2014 10:35 am

Currently the xta only really helps you with the timing of code between 2 points within a logical core, i.e. it wont tell you how long an i/o instruction will block due to what happening on another core. Therefore, in this case, you'll need to time the producer and consumer loops separately, and by looking at the difference between them you can reason about which one of them will block (and for how long).

Who is online

Users browsing this forum: No registered users and 5 guests