The following tools are available for translating other languages into BIP :
More details about the theoretical aspects of these transformations can be found here.
MATLAB/Simulink to BIP
Simulink2BIP is a tool for the translation of Simulink models into the synchronous subset of BIP. The Simulink2BIP can translate part of the discrete-time fragment of Simulink. Simulations are performed using fixed-time step and on single rate mode. Through this page the developer can download the tool as well as documentation about installing, running and debugging the tool. Some examples are also provided.
Latest Version : 0.5, Jun. 7, 2010
To use the tool you will need to download it. Below you will find the latest distribution of the tool and the library of the components.
- The Simulink2BIP tool (download)
- The Simulink translated library (download)
- Installation and running instructions (download)
Disclaimer : Simulink2BIP is still in its early development stages. We apologize for any bugs and we cannot guarantee the correctness of the results. The source code is available from the author upon request.
Below we provide helpful documents about the tool :
- Restrictions about the Simulink models to be parsed (download)
- A report about the translation of Simulink into Synchronous BIP (download)
- A brief description for future developers of the tool (download)
The developer should be provided also with :
Here are some examples to download, run and compile :
C to BIP
The C to BIP language factory translates a given C code into a BIP program. It features :
- the parsing of the entire C code (including an optional pre-processor pass)
- the generation of one atomic component (i.e. an automaton) for every C functions chosen by the user
- handles special (user defined list) function calls as inter-component interactions
The factory has been developed so as to be able to use it in various C-related contexts. Currently, it is used :
- in the MIND project to translate a MIND component architecture into a BIP program
- in the DOL to BIP factory
The C parsing and manipulations are based on the codegen library, dedicated to this task.
DOL to BIP
dol2bip is a tool for the translation of application software described in the DOL (Distributed Operation Layer, ETHZ) framework into an application software model in BIP. The underlying semantic model of DOL is Kahn process networks. The description consists of two parts :
- the process network structure, described in XML
- the process behavior, described in C, one process per file
For each process, there are two particular functions that have to be provided, respectively init and fire. Moreover, processes use specific primitives to communicate (DOL_write/DOL_read to write/read data from the channels). This page provide the links to download the tool as well as documentation about installing and running the tool. Some examples and case studies are also provided.
- Download dol2bip for GNU/Linux - x86
The package is bundled with the standard BIP distribution and hence it also includes the BIP compiler and runtime
- Java 1.6.
Installing the Toolchain
Extract the archive on your system :
~ $ tar zxf BIP.linux.x86.tar.gz
Point the environment variable BIP2_HOME to this new directory.
~ $ setenv BIP2_HOME $PWD/BIP.linux.x86
~ $ export BIP2_HOME=$PWD/BIP.linux.x86
The dol2bip translator is invoked by running the $BIP2_HOME/bin/dol2bip executable.
Coding guidelines for process description in C
The C source description for a processes must obey the following :
- No C++ style variable declaration, e.g.,
for (int i = 0; i < ...) ...Instead, do
int i; for (i = 0; i < ...) ...
- The structure that defines the local variables (state) of a process must have the predefined name _local_states.
Running an example
Example source structure : Each example folder must contain the application process network description as an XML file, and a src/ folder containing the C files describing the processes (one C file per process).
Example 1 : Generator-Square-Consumer : This example is adapted from the DOL distribution. The figure below illustrates the process network.
The process network in describes in the file example1.xml.
To translate the DOL specifiation into BIP and execute the BIP model, do the following steps :
- Step1 : Generate BIP application software model
~ $ $BIP2_HOME/bin/dol2bip -f example1.xml
Creating tmp folder...
Parsing file : /tmp/DOL2BIP4507904712346052284tmp/libSW.bip
Generating model : libSW.timod
Generating model : libSW.model
Scanning process network ...
Process name: generator
Scanning source: generator.c
Process name: consumer
Scanning source: consumer.c
Process name: square
Scanning source: square.c
Finished generation of example1_SWModel.bip
Deleting tmp folder
The application software BIP model is generated in the file example1_SWModel.bip. This can be compiled and executed using the BIP compiler and runtime as follows :
- Step2 : Compile
~ $ $BIP2_HOME/bin/bipc -f example1_SWModel.bip --genC-execute
BIP Compiler. Version: frontend: trunk@3019, backend:trunk@3018
Parsing file : /local/basu/junk/example1/example1_SWModel.bip
Generating model : example1_SWModel.timod
Generating model : example1_SWModel.model
Parser exiting with no errors.
C code generated
- Step3 : Build
~ $ make -f example1_SWModel.bip.mk
- Step4 : Execute
~ $ ./example1_SWModel.bip.x --quiet
BIP mono-threaded engine. Version: Engines: trunk@1457