Overview
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.
Distribution
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.
Documentation
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 :
Examples
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.
Distribution
- 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
System Requirements
- Linux
- Java 1.6.
Installing the Toolchain
Extract the archive on your system :
~ $ tar zxf BIP.linux.x86.tar.gzPoint the environment variable BIP2_HOME to this new directory.
for c-shell
~ $ setenv BIP2_HOME $PWD/BIP.linux.x86for bash
~ $ export BIP2_HOME=$PWD/BIP.linux.x86The 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, doint 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.
The behavior of processes generator, consumer and square are described respectively in the files generator.c, consumer.c and square.c. The complete source is here.
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 folderThe 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 consumer: 0.000000 consumer: 1.000000 consumer: 4.000000 consumer: 9.000000 consumer: 16.000000 consumer: 25.000000 consumer: 36.000000 consumer: 49.000000 consumer: 64.000000 consumer: 81.000000 consumer: 100.000000 consumer: 121.000000 consumer: 144.000000 consumer: 169.000000 consumer: 196.000000 consumer: 225.000000 consumer: 256.000000 consumer: 289.000000 consumer: 324.000000 consumer: 361.000000