Files @ 36cc1fe490f7
Branch filter:

Location: CSY/reowolf/examples/eg_protocols.pdl

MH
Merge branch 'feat-api-cmds-and-branching'

Implements the programmer-facing API to allow programmatic
specification of a synchronous round. The way in which these put/get
interactions are performed is in an initial shape. Perhaps this will
change in the future.

The second main set of changes is the addion of a 'fork' statement,
which allows explicit forking, and allowing multiple puts/gets over the
same transport link within a single sync round.
primitive pres_2(in i, out o) {
  sync {
    put(o, get(i));
  }
}
primitive together(in ia, in ib, out oa, out ob){
  while(true) sync {
    if(fires(ia)) {
      put(oa, get(ia));
      put(ob, get(ib));
    }
  }	
}

primitive alt_round_merger(in a, in b, out c){
  while(true) {
    sync { put(c, get(a)); }
    sync { put(c, get(b)); }
  }	
}