nasa / fpp

F Prime Prime: A modeling language for F Prime
https://fprime.jpl.nasa.gov
Apache License 2.0
49 stars 31 forks source link

Improve support for matching connections through a hub #249

Closed bocchino closed 1 week ago

bocchino commented 1 year ago

The matched port checker does not play well with the hub pattern. When it sees a pair (p1, p2) of matched ports, it expects each connection C with one end at p1 to have a unique instance I(C) at the other end, and it looks for a matching connection between p2 and I(C). This works fine for matched connections in a single physical deployment, but when matched connections cross a hub boundary everything is connected to a single hub instance, so the pattern doesn't work.

To fix this, we can allow explicitly unmatched connections, like this:

command connections instance cmdDisp

connections CmdReg {
  unmatched hub.genericSerialOut[0] -> cmdDisp.cmdRegIn[0]
  unmatched hub.genericSerialOut[1] -> cmdDisp.cmdRegIn[1]
  ...
}

That way the command registration commands going through the hub can be manually numbered and explicitly unmatched, and the graph pattern specifier and matched numbering will fill in the rest.

In the future we can auto-generate the hub instances and the unmatched connections from matched, hub-free connections that span subtopologies, on each side of the network.