Given the move for each thread to be allocated to a core rather than the loose e.g. :
Code: Select all
int main(void) {
chan c;
par {
thread1(c);
thread2(c);
}
}
Code: Select all
int main(void) {
chan c;
par {
on stdcore[0] : thread1(c);
on stdcore[0] : thread2(c);
}
}
It should thus become:
Code: Select all
int main(void) {
chan c;
on stdcore[0] : thread1(c);
on stdcore[0] : thread2(c);
}
Code: Select all
# include < platform .h >
port p [4] = {
on stdcore [0] : XS1_PORT_1A ,
on stdcore [1] : XS1_PORT_1A ,
on stdcore [2] : XS1_PORT_1A ,
on stdcore [3] : XS1_PORT_1A
};
void node ( chanend , chanend , port , int n );
int main ( void ) {
chan c [4];
par ( int i =0; i <4; i ++)
on stdcore [ i ] : node ( c [ i ] , c [( i +1)%4] , p [ i ] , i );
return 0;
}
Code: Select all
# include < platform .h >
port p [4] = {
on stdcore [0] : XS1_PORT_1A ,
on stdcore [1] : XS1_PORT_1A ,
on stdcore [2] : XS1_PORT_1A ,
on stdcore [3] : XS1_PORT_1A
};
void node ( chanend , chanend , port , int n );
int main ( void ) {
chan c [4];
for ( int i =0; i <4; i ++)
on stdcore [ i ] : node ( c [ i ] , c [( i +1)%4] , p [ i ] , i );
return 0;
}
regards
Al