I realized this project with my colleague Clément Nussbaumer in the Rigorous Systems Design (RiSD) laboratory at EPFL. One of the frameworks used there was the BIP component framework developped by the Verimag research center in Grenoble. BIP, which stands for Behavior-Interaction-Priority, is a component-based framework that allows the construction of complex embedded applications.
BIP define a system in terms of its internal components as well as how those components connect and interact with each other. Due to the nature of the framework, BIP applications have a strong structure that can be easily represented using systems diagrams. However, the possibility of generating visual representations from the designed system as well as the ability to edit the visual artifact rather than the code itself was not part of the BIP framework.
Because visual representations are extremely valuable when it comes to designing complex systems, our task was to find a way of bringing the following features to the BIP framework:
- Generation of a visual representation based on its BIP model
- Generate back the BIP model from its visual representation
We used the SysML profile for UML in order to represent BIP systems since it is one of the industry standards for system modelling.
How it works
Both BIP and SysML use what is called a meta-model to structure the concepts they respectively use. Models describing actual systems can be instantiated from the unique meta-model corresponding to the language, just like classes instances can be created from a class declaration in object-oriented programming languages.
The idea for transforming a BIP model into a SysML model is to load the BIP meta-model instance (or simply put, the BIP model) in memory and change its structure so that it matches the structure given by the SysML meta-model. Once this transformation is done, the SysML model can be opened and edited with any tool supporting SysML. The inverse transformation, namely from SysML to BIP is realised in a similar fashion.
The transformation process itself is implemented in Java.
The following BIP snippet shows an example of a simple system. It has two components: s, a component sending a signal, and rcvs, a component receiving that signal. These two components are connected by a connector called brd. Rcvs actually encompasses three receivers components but this is not of crucial importance at the moment.
compound type HelloCompound()
component HelloSender s(0)
component RecvsCompound rcvrs()
connector OneToOne brd(s.p, rcvrs.p)
This system is shown on the following diagram, which has been taken from the Verimag tutorial page for BIP. This diagram has no direct relation with the code. This means that any change made to the system through code modification must be manually mirrored on the diagram. Note the 3 receivers inside the rcvs component.
The image below illustrates the result obtained after opening the transformed BIP model in a SysML modelling tool called MagicDraw. The result is very close to what the author originally designed in his diagram and this time, the visual model is tied to the code: no need to manually change the diagram upon modifications mades on the code.
The transformation tool we developped handles structural changes, that is, every modification impacting the way the system looks remains consistent between the BIP and SysML model but some more advanced features such as how the components behave are lost when going from SysML to BIP. This is however due to time constraints and not technical difficulties.
The code for this project is not available for download. However, you will find all the details regarding this project in our report available at this link.