New Combinable and Distributable task features

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

New Combinable and Distributable task features

Post by Folknology »

I really like some of the new XC2 features but find some of the annotations used to mark/define them somewhat cumbersome.

For example Combinable and Distributable require the use of [[combinable]] and [[distributable
]] attribute annotations

Couldn't the same sort of thing be achieved using combinable/distributable function definitions similar to select functions? In fact they could be considered special cases of select functions:

Code: Select all

select regular_select_func()
{
 case ....
    ...
    break;
 case...
    ...
    return;
 }

combined regular_select_func()
{
 case ....
    ...
    break;
 case...
    ...
    return;
 }

distributed regular_select_func()
{
 case ....
    ...
    break;
 case...
    ...
    return;
 }
These could then be used (or even assembled, but not mixed) inside relevant tasks, this would avoid the extra annotations and continue with the great select and select function abstractions Xmos have already provided which we are now familiar with.

*Update actually select::combined or select::distributed would be a more accurate function type

**Update you might also add select::ordered whilst your at it which would allow you to remove the messy ordered pragma

Just a suggestion/idea?

regards
Al
richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Post by richard »

The [[foo]] syntax is intended to be a standardized syntax for adding language extensions without changing the grammar. [[distributable]] and [[combinable]] are the first things to use this syntax, but we intend to use it for other things in future. For example overlays (coming in the second beta) will use attributes to mark functions that should be loaded from external memory at runtime.

The reason we made combinable / distributable attributes instead of keywords is because they have no semantic meaning - from a program semantics point of view they can just be ignored and so attributes seemed a good fit.

We explored a few different syntaxes for attributes. Initially we were going to use @attr but this conflicted with the use of @ for timed / timestamped port I/O. The [[attr]] syntax is already in use in a C-derived language (C++11), it doesn't result in any ambiguities and it is reasonably concise.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

Thanks for the feedback and explanation Richard, overlays sound like a fascinating addition to XC, looking forward to seeing those. I will have a play around with the new features and see how I get on with them.

regards
Al
jarnot
Member++
Posts: 27
Joined: Thu Apr 15, 2010 4:52 pm

Post by jarnot »

This may sound like a silly question, but where can I find documentation on the XC2 compiler? Also, when I just tried to download the command line tools for linux, I could not find them. Do I have to download xTIMEcomposer studio and find where the command line tools are hidden in the download?