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.
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.
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.
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