• Save
XMOS XS1 and XC
Upcoming SlideShare
Loading in...5
×
 

XMOS XS1 and XC

on

  • 1,523 views

 

Statistics

Views

Total Views
1,523
Views on SlideShare
1,436
Embed Views
87

Actions

Likes
2
Downloads
0
Comments
2

9 Embeds 87

http://xmos-vub.blogspot.com 72
http://www.slideshare.net 5
http://www.blogger.com 3
http://xmos-vub.blogspot.co.uk 2
http://www.techgig.com 1
http://xmos-vub.blogspot.ch 1
http://xmos-vub.blogspot.hk 1
http://xmos-vub.blogspot.jp 1
http://xmos-vub.blogspot.com.br 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Thanks.
    I already received my hardware from XMOS.
    Are you sure you want to
    Your message goes here
    Processing…
  • Great work! Have you checked out the XMOS University Program (xmos.com/uni)? Free hardware and great student competitions...
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

XMOS XS1 and XC XMOS XS1 and XC Presentation Transcript

  • XMOS XMOS XS1 Chip XC programming language Ruben Vandamme Christophe Scholliers Coen De Roover 1
  • Introduction ● XMOS XS1 chip ● multicore, multithreaded chip ● event-driven ● similar to Transputer ● XC ● allows use of special features of the chip ● based upon CSP ● C/C++ support 2
  • Multicore - multithreaded ● 4 XCores/CPUs ● Max 8 threads per XCore ● ↔ java threads ● message passing ● preemptive scheduling ● Every XCore has I/O ● JTAG for debugging 3 Source: XMOS View slide
  • Event driven ● Threads can subscribe to events ● a timer has past ● a button is pushed ● another thread wants to send data ● Supported in hardware ● no need for interrupts ● with extra event conditions 4 View slide
  • Concurrency support ● Par par ● runs functions in { on stdcore[0] : function1(); parallel/interleaved (fork) on stdcore[1] : function2(); } ... ● ends when all functions have returned (join) ● assign a thread to a core 5
  • Communication between threads void sender ( chanend output ) { ● Channels & chanends output<:1; } ● mapping by compiler void receiver ( chanend input ) { ● two way int i; input:>i; printf("%d",i); ● blocking } void main() ● Write to channel { chan channel; ● chanend <: value par { sender(channel); ● Read from channel receiver(channel); } return 0; ● chanend :> variable } ● Printf() ● shows data in IDE 6
  • Channels in hardware ● Communication ● in a single XCore ● to another XCore ● to another XS chip ● Transparant but increasing latency 7 Source: XMOS
  • Sum + Divide ● Pipeline 54321 ● sum f 5 : =3 divide 5 ● 321 f 3 : =2 3 init start sum calc divide end result 5 5+4..+1=15 15/5=3 3 8 Source: Parallel Processing (The Transputer and Occam), A. Carling
  • Sum + Divide (2) void init(chanend outi){ init outi <: 5; } outi void sum(chanend ins, chanend outs){ int max, sum = 0; ins:>max; ins for (int i = 0 ; i <= max ; i++) sum+=i; divide outs<:max; outs<:sum; } outs void divide(chanend divi, chanend divo){ int average, sum, max; divi divi:>max; divi:>sum; average = sum/max; sum divo<:average; } divo void result(chanend resi){ int result; resi resi:>result; printf("result: %d", result); } result 9
  • Sum + Divide (3) int main(void) ● Steps can concurrently { chan start, calc, par end; ● But communication is { on stdcore[0] : init(start); blocking on stdcore[1] : sum(start, calc); on stdcore[2] : average(calc, end); on stdcore[3] : result(end); } return 0; } 10
  • Select statement ● ≠ switch statement select ● all case predicates are evaluated { case a == 1 => input1 :> c: ... ● boolean guard => input resource break; case a == 2 => input2 :> c: ... ● Select an alternative if break; } ... ● Boolean guard evaluates to true ● Checks whether resource is ready, but does not block ● Selection is non-deterministic but fair 11
  • Bounded buffer data data buffer producer consumer more ● Asynchronous producer & consumer ● Bounded together with a buffer ● Used when producing rate ≠ consuming rate 12 Source: Communicating Sequential Processes, C.A.R Hoare
  • Bounded buffer (2) ● Timers void producerprocess(chanend buffer){ for(int i = 0 ; i<= 15 ; i++){ ● wait until a specified time buffer <: i; } printf("producing %dn", i); ● read the current time } void consumerprocess(chanend buffer){ timer tc; ● not reset int i, t = CONSUMER_DELAY; while(1){ ● can be used in select to tc when timerafter(t) :> void; t += CONSUMER_DELAY; create a timeout buffer <: 1; // more signal buffer :> i; printf("consuming %dn", i); ● supported in hardware } } 13
  • Bounded buffer (3) void boundedbuffer(chanend producer, chanend consumer){ int moreSignal; int buffer[12]; int inp = 0; int outp = 0; while(1){ select{ case inp < outp + 12 => producer :> buffer[inp % 12]: inp++; break; case outp < inp => consumer :> moreSignal: consumer <: buffer[outp % 12]; outp++; break; } } } 0 1 2 3 4 5 6 7 8 9 10 11 1 1 1 1 outp=3 inp=7 14
  • Bounded buffer (4) int main(void){ chan producer, consumer; par { on stdcore[0] : boundedbuffer( producer, consumer ); on stdcore[1] : consumerprocess( consumer); on stdcore[2] : producerprocess( producer ); } return 0; } 15
  • Purpose ● Architecture designed for ● DSP ● audio, video ● networking ● Port Scheme ● allow usage of XC features via Scheme ● XMOS challenge 16
  • Questions ? 17