cubesatlab / cubedos

A flight software framework in SPARK/Ada

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement a tool to check that an application's module => mailbox mapping is bijective

pchapin opened this issue · comments

CubedOS's architecture relies on the fact that there is a one-to-one mapping between modules and mailboxes (a bijection). It should be possible to check this with a tool that verifies that a) every module has a unique module ID, b) a module only ever tries to Receive from its mailbox, and c) there are no unused mailboxes.

Note that the problem of sending a message to the wrong mailbox is another issue and would be, in general more complicated to check.

After #43 on startup all modules must manually register with the message system. This allows the message system to check for carnality on each module id, ensuring the relationship is one-to-one.

The message system doesn't allow messages to be sent or received until all modules have been registered, this makes the relationship onto.

And just like that I've actually used that Discrete Math course and can tell your the relationship is bijective 😂.