Open lhstrh opened 3 years ago
Multiport implementation is required to implement some of the benchmarks from Savina suite (e.g., Online Facility Location and UCT(Unbalanced Cobwebbed Tree)) to support tree-like actor structure, sending and receiving messages to/from multiple children.
Banks are required to implement UCT as the number of children can be arbitrary, while the number of children in Online Facility Location is always four (Quadrant actor).
Here are rough ideas for implementing multiports in TypeScript.
First we need something similar to lfutil::bind_multiple_ports() in Cpp target. This function takes a vector of source ports and a vector of destination ports, and then calls bind_to() function for each individual connection.
Similarly, we can create a new function in reactor.ts, called _connectMultiplePorts(), which takes an Array of src ports and an Array of dst ports, and then calls _connect() function internally for the given Arrays of ports.
In TSPortGenerator.kt, generate multi ports as new Arrays.
In TSConnectionGenerator.kt, generate connection code using _connectMultiplePorts().
interleaved
must be taken care of when supporting banks together with multiports.
Relevant PRs: https://github.com/lf-lang/lingua-franca/pull/942 https://github.com/lf-lang/reactor-ts/pull/81