Pinapa Documentation

Pinapa: An open-source SystemC front-end.

Pinapa Version

The version of Pinapa documented by this manual is shown on page Pinapa Version.

SystemC

SystemC is a C++ library (although often refered to as a language) widely used for System-on-a-Chip system level modeling.

Static information of a SystemC front-end.

Strictly speaking, a SystemC front-end should be not more than a C++ front-end, since the language itself is C++.

However, the case of SystemC is particular. The language defines classes (mainly SystemC modules), but the instances of those classes are actually static: They are built during an elaboration phase, and can not change during simulation. In Pinapa, we consider the instanciation of the modules and the way they are bound together as part of the static information to be extracted by a front-end.

Principles of Pinapa

The idea behind Pinapa is to reuse a traditional C++ front-end to parse the program (we use GCC as a C++ front-end), and to execute the elaboration phase of the model using the SystemC library itself. The main job of Pinapa is to make the link between the output of GCC's front-end and SystemC's data-structures built during elaboration.

More details are available in the paper Pinapa: The Extraction Tool for SystemC descriptions of Systems-on-a-Chip, to be published in proceedings of EMSOFT'05.

Pinapa is a library that only makes sense associated to a back-end. If you're interested in Pinapa, I suppose you want to write a back-end for it.

Getting Help, Asking for Information

Please, use Pinapa's mailing list to ask for info. It's a low trafic mailing list, so, you're strongly encourraged to subscribe to it if you want to use or contribute to Pinapa. However, the list is opened to non-subscribers, you can send your messages to the address greensocs-pinapa at lists.sourceforge.net.

The mailing list has online archives. Before asking, check if the answer to your question isn't already in those archives. Questions and anwsers using personal email benefit only to one person, while information exchange on the mailing list benefit to all the subscribers, and potentially to anyone in the future browsing the archives. Therefore, I will not answer any technical question sent to me personnaly!

Getting Started

Using Pinapa

System Requirements

Pinapa has only been tested on Linux (Debian sarge, etch, and Ubuntu). It will not run unmodified on Windows, but might work with Cygwin or SFU. Some patches have been applied to support Solaris, but unfortunately, Pinapa is not tested regularly on Solaris, and may or may not work there. You will anyway need a decent version of GNU Make, a posix shell, symbolic links support. It is also strongly recommanded to have a recent version of the autotools (I use GNU Autoconf 2.59, GNU automake 1.9 and GNU libtool 1.5.8). They are not strictly necessary if you use the tarball distribution, since the generated files are contained in the archive, but the build.sh script will need them.

You'll need 900Mb of disk space and probably more than one hour of CPU time to compile it (Yes, GCC is deadly long to compile ...).

Getting Pinapa

See the Pinapa download page here:

http://greensocs.sourceforge.net/pinapa/download/

Compiling the Example

Pinapa being a front-end, it only makes sense associated to a back-end. We currently do not distribute any real-life back-end for Pinapa, but a trivial back-end is provided to serve as an example to understand how Pinapa works, and how to write a back-end. It is both an example of back-end (C++ code using Pinapa as a library) and an example of platform (SystemC code, independant from Pinapa, but analyzed by Pinapa).

First of all, get the example from Pinapa download page:

  bzr branch http://greensocs.sourceforge.net/pinapa/download/bzr/pinapa-expl-sc-2.1.v1/
  

or alternatively (if you don't have bzr installed):

  wget http://greensocs.sourceforge.net/pinapa/download/files/pinapa-expl-sc-2.1.v1-snapshot.tar.gz
  tar xzvf pinapa-expl-sc-2.1.v1-snapshot.tar.gz
  

This example uses SystemC 2.1.v1. If you want to use SystemC 2.0.1, replace pinapa-expl-sc-2.1.v1 by pinapa-expl in the previous commands.

Then, all you should have to do is to run

  cd pinapa-expl-sc-2.1.v1
  ./build.sh
  

Another little bit more complete example of use for Pinapa: SPinapa. It's a prototype (understand this as "half finished" if you wish) of SPIRIT backend for Pinapa. Currently, it just reads a platform with one module, and generate the SPIRIT description for the module and its registers, if the module complies with some coding standards.

The tool can hardly be usefull by itself, but it's an example of usage of Pinapa, it can be interesting for you. You can get it via

  bzr branch http://greensocs.sourceforge.net/pinapa/download/bzr/spinapa/
  
or download the tarball (spinapa-snapshot.tar.gz).

If build.sh doesn't work for you, then you can either

My advice clearly goes for the second one (and please, send your modified version to the mailing list afterwards).

  ./build.sh --help
  
can help you, too.

The build.sh script will end telling you to run make run in the build directory. Then, read the source. There's only one file for the example, it is the best starting point to learn how to use Pinapa.

Compiling Pinapa Itself.

The build.sh script of the example runs the build.sh script of Pinapa, so, if you followed the previous steps, you probably compiled Pinapa already.

You're encourraged to read the script build.sh (there is one in the example, and one in Pinapa itself) to understand the build process.

The build.sh script mainly does:

The build system have been designed for two use-cases: Library as a developer version, and library as an installed version. Both use autoconf, automake, and libtool (Have a look at the autobook if you haven't done so already).

Library as a Developer Version
This is the recommanded way to use Pinapa.

Use this scenario if you think you may have to modify and recompile Pinapa while you write your back-end. Pinapa will be a subdirectory of your project, the configure script and the Makefiles of your project will call the one of Pinapa recursively.

This is the mode used by the example if you installed it with the build.sh script.

Library as an Installed Version
Use this scenario if you have to share Pinapa between several projects.

In this scenario, Pinapa is compiled and installed once and for all. You will use it as any other system library. To use this scenario, use the build.sh script of Pinapa, with the options --config-args --prefix /path/to/pinapa/inst, then, run

  make install
  
in the build directory (pinapa/build.tmp by default).

The example can then be built with

  cd /path/to/example
  mkdir build.tmp
  cd build.tmp
  ../configure --with-pinapa=install --with-pinapa-inst=/path/to/pinapa/inst
  make run
  
Using Pinapa with BASIC and TAC protocols
The BASIC and TAC versions used in Pinapa for SystemC 2.0.1 are not released to public (there is now an open-source version of TAC). For people having access to it, you can run

  baz register-archive Matthieu.Moy@imag.fr--arch https://moy@www-verimag.imag.fr/webdav/moy/arch
  # You'll need a password for that.
  ./scripts/install-tlmobjs.sh
  ./build.sh --config-args --prefix=/path/to/pinapa --enable-tlm-basic --enable-tlm-tac
  cd build.tmp
  make install
  

In the version currently used, a bug in the makefile prevents tlmobjs directory to be installed. You have to copy it manually. Get back in pinapa-src directory:

  cd ..
  cp -R tlmobjs /path/to/pinapa
  

It is possible to gain some disk space by removing unnecessary gcc/systemc objects files:

  find /path/to/pinapa -name "*.o" -exec rm {} \;
  
Building the example back-end in install mode
Get the example parser:

  tla get Matthieu.Moy@imag.fr--pinapa/pinapa-expl--main--0 pinapa-example
  

Generate configure:

  cd pinapa-example
  ./autogen.sh
  

Then, configure:

  mkdir build.tmp
  cd build.tmp
  ../configure --with-pinapa=install --with-pinapa-inst=/path/to/pinapa
  

Then you can make:

  make
  

Then, launch the example backend:

  make run
  

Understanding the Output of Pinapa

The output of Pinapa is documented in Output of Pinapa.

Contributing

First of all...

To understand the compilation of the model, please, read the sections Makefile and File tree. If you wish to read or participate in the source code, please read carefully Coding Style before.

More Informations

See Overview of Pinapa's Implementation.
Generated by
Matthieu Moy <Matthieu.Moy@st.com>
Back to Pinapa Home Page