Not so simple usage example !

Teaser

This page provides an example of use of a set of the tools developed by the SLS Team. As there are quite a few tools with some tricky inter-correlation that even us have hard time to track, we provide here a working example that give an overview of what is achievable.

This example is valid on October 4th, 2013, and shall be updated soon as some git branch merging are on their way inside several projects, and thus it shall be update in the coming weeks.

The goal of the example is to decode a Motion-JPEG video stream (such as the one that are produced by some digital camcorders or cameras, before the advent of more complex algorithms) on a multiprocessor arm based platform that includes a block device from which the video stream is read, and a frame buffer to output the images.

We assume that all our tools sources obtained through the git repositories, are placed in the $HOME/Development directory.

Steps

First, it is necessary to have a working install of the Apes framework, so please follow the install steps that are described here. As Apes uses Ruby and a few gems, having the right combination of those can be painful, but it is known to work with Ruby 1.9.3p448 and nokogiri-1.6.0.
The Apes git branch shall be master. Make also sure that the arm cross-compiler has been compiled correctly.

Second,it is necessary to have a working install of the Rabbits simulation environment. The full install page should drive you there. Note that you do not need to build the cross-compiler as described in this page since we will not be using Linux to run our example but Apes, in which case the Apes patched cross-compiler produced during the Apres install will do!

Third, clone the parallel motion JPEG application. To do so, cut and paste the following code:

As can be seen, a ls in the directory is quite empty. This is due to the fact that this application can run on different hardware platforms on top of different operating systems, therefore we have to select the correct branch here, which is done using:

This is fine for our ARM based platform in Rabbits, and Apes.

Up to now, we where playing games installing stuff, now we enter the flesh.

First of all, we need to compile the application for arm, so and edit the install.sh file if the APES_ASSEMBLER, APES_COMPILER, and APES_LINKER variables are not set correctly for the system.
Then, we need to source Apes environment setting file, after the proper setting of the APES_ROOT variable. Here is how to do this on a zsh shell:

Most probably, the cross-compiler binaries should be in the path to make things easier, i.e.

To compile an Apes compliant application, we do not use a Makefile but rely on a description of the dependencies given in the interface.xmi file (you don’t want to know about yet, so just trust us for now), and the programs that make use of it are prefixed with apes-. So, to compile our application at hand, we just launch

This for sure assumes that $HOME/Developpement/Apes/Tools/Shell/bin is in your path.
If there is not error, the directory shall now contain an executable called MJPEG, which is a nice name for a motion-JPEG decoder, let us admit it. Then let us check that the file was cross-compiled as it should have:

File should output something along these lines.
A very important file here is the ldscript that gather all sections of the executable code and put them at the right place.
This file also determines infomation for the DNA-OS kernel, and the peripheral that are used on the actual virtual platform, so don’t (yet) mess around with it.

As Rabbits platforms cannot (yet) read elf file (it is in the pipe and should soon go out), we produce some raw binary using objcopy (that remove all elf related information and build a flat profile file), so that our lovely machine can understand it well:

This being done, we move into the Rabbits/platforms/thumper directory, and run make, that should produce an executable of the simulator for the thumper platform called, guess what, run.x. Then, we just have to launch it:

You should then see Scart playing with its nuts, and get some laught at how easy it was to arrive here!