XSCOPE stdout redirect on tile1 of slicekit

Technical questions regarding the XTC tools and programming with XMOS.
johnswenson1
Member++
Posts: 16
Joined: Sun Jul 14, 2013 5:14 am

XSCOPE stdout redirect on tile1 of slicekit

Post by johnswenson1 »

I have an original L16 slicekit and am trying to use XSCOPE stdout redirection to help debug the project. I have this working fine for tile0, I can put a printf in any function running on tile0, but but any printf on tile1 does not display in the console. This is getting to be a bit of a problem because the problem left with the code is the communication between tiles.

I cannot find any information on how this is supposed to be setup. The slicekit .xn file has one link set for XSCOPE, do I need two? Or maybe add a second NodeId to the one already there? Or something else altogether?

The only reference I could find was that the specification in the .xn file needed to point to the link that was actually connected to the the XTAG2 (which I presume is what is in the .xn files) and that other tiles will be automatically connected. I assumed this meant that tile1 was automatically routed through tile0 to the specified link. This doesn't seem to be the case.

At this point I don't know whether this is something I have to do in the .xn file or the program, such as maybe something to xscope_register statement, or something else.

Any pointers would be appreciated.

John S.


User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

I wrote the following simple code and able to see all the print statements on the console.

Code :

Code: Select all

#include <xs1.h>
#include <print.h>
#include <xscope.h>
#include <platform.h>

void app1()
{
    while(1)
    {
        printstrln("Tile I ");
    }
}

void app0()
{
    while(1)
    {
        printstrln("Tile 0 ");
    }
}

int main()
{
    par
    {
        on tile[0]: app0();
        on tile[1]: app1();
    }
    return 0;
}
Output :
Tile 0 Tile I

Tile 0 Tile I

Tile 0 Tile I

Tile 0 Tile I

Tile 0 Tile I

Tile 0 Tile I

Tile 0 Tile I

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

Post by infiniteimprobability »

One reason xscope from tile 0 might not work is if all 4 paths through the switches are blocked - for example if you had 4 streaming channels across the tiles simultaneously.
This would prevent xscope prints/probes from sending data from tile 1 to tile 0 (where it gets forwarded over the link to the XTAG adapter..)
johnswenson1
Member++
Posts: 16
Joined: Sun Jul 14, 2013 5:14 am

Post by johnswenson1 »

I have two streaming channels between tile0 and tile1.

Looking carefully at it I see that it is probably actually a different problem. I have 4 tasks on tile0 and 3 tasks on tile1, but the resource chart at the end of compilation only shows one logical core being used on tile1, even though there are three in the par statement.

This was done a bit unusually, I have one function that gets put on each tile in main, these functions don't have a loop, they just create channels used within the specific tile and a par for the tasks that run on that tile.

The one for tile0 has a par with 4 tasks, and there are 4 cores in the resource report. But the function for the tile0 has 3 tasks and only 1 core in the resource report. I think this might actually be the problem, the task I put the print in might be one of the tasks that isn't running.

I don't see any compilation errors for any of the three tasks or main, nothing that says anything about the task not being run. All 3 tasks have some initialization then a standard while(1) loop, doing a select on channels and ports etc. At this point I don't even know which task it decided to put on a logical core, and what happened to the other two.

I don't know where to look to try and track this down, does anyone have any clue how to debug this?

Thanks,

John S.
User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

Johnswenson1 wrote:I don't see any compilation errors for any of the three tasks or main, nothing that says anything about the task not being run. All 3 tasks have some initialization then a standard while(1) loop, doing a select on channels and ports etc. At this point I don't even know which task it decided to put on a logical core, and what happened to the other two.

I don't know where to look to try and track this down, does anyone have any clue how to debug this?
Can you attach your workspace to see whats causing issue in your case?