Does XC support ports with replicators? Topic is solved

If you have a simple question and just want an answer.
User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Does XC support ports with replicators?

Post by sethu_jangala »



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

Post by sethu_jangala »

XC does allow port arrays (and structures containing ports). It does not support using replicators to build initialisers. For example:
#include <platform.h>
port p[] = {
  on stdcore[0]: XS1_PORT_1A,
  on stdcore[1]: XS1_PORT_1A,
};
void f(port p) { }
int main() {
  par {
    on stdcore[0]: f(p[0]);
    on stdcore[1]: f(p[1]);
  }
}