So how does the multicore part work?

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
Post Reply
User avatar
asid61
Active Member
Posts: 36
Joined: Sat May 31, 2014 6:39 am
Contact:

So how does the multicore part work?

Post by asid61 »

So I know that an XMOS chip has multiple tiles, which operate independently of each other.
But what I don't understand is how the 8 cores per tile work.
How can using what is essentially a switch/ case statement run things concurrently, versus just running "normal" tasks concurrently? Do the cores just check the select statements faster?

EDIT: Example code would be nice to see. I've read the manuals on it, but I still don't get it.


User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm
Contact:

Post by Bianco »

Each tile can run multiple threads (the cores on a tile are really just threads), up to eight threads.
Each processor clock cycle will finish the instruction of a distinct thread. So if you have 4 threads, it will execute one instruction from thread 1, then from thread 2, then from 3, then from thread 4, thread 1, 2, 3... and so forth. The pipeline has four stages and only one instruction of a particular thread can be in the pipeline at any time. This means that to utilize the full processing power of a tile you need at least 4 threads. When there are more than 4 threads active, the threads are scheduled using a round robin scheduler.

About events and the select statement: the select statement is used to wait on multiple events.
It does this by setting up the event handlers of the resources and waiting on an event using a special instruction that will block the thread until there is a new event. When an event is incoming the execution resumes at the event handler of the resource that generated the event. If the select statement has been put in an infinite loop, the event handler of the resource will finish with the special instruction to wait for the next event. A practical example here: http://www.xcore.com/forum/viewtopic.php?p=15635#p15635
User avatar
asid61
Active Member
Posts: 36
Joined: Sat May 31, 2014 6:39 am
Contact:

Post by asid61 »

Bianco wrote:Each tile can run multiple threads (the cores on a tile are really just threads), up to eight threads.
Each processor clock cycle will finish the instruction of a distinct thread. So if you have 4 threads, it will execute one instruction from thread 1, then from thread 2, then from 3, then from thread 4, thread 1, 2, 3... and so forth. The pipeline has four stages and only one instruction of a particular thread can be in the pipeline at any time. This means that to utilize the full processing power of a tile you need at least 4 threads. When there are more than 4 threads active, the threads are scheduled using a round robin scheduler.

About events and the select statement: the select statement is used to wait on multiple events.
It does this by setting up the event handlers of the resources and waiting on an event using a special instruction that will block the thread until there is a new event. When an event is incoming the execution resumes at the event handler of the resource that generated the event. If the select statement has been put in an infinite loop, the event handler of the resource will finish with the special instruction to wait for the next event. A practical example here: http://www.xcore.com/forum/viewtopic.php?p=15635#p15635
Ah, thank you! That cleared it up very well.
Post Reply