Installing and building Gannet

PREREQUISITES:

Essential:

Compilers

Dynamic languages

Build tools

SystemC Libraries

  • systemc >= 2.2
  • systemc-tlm >= 2.0

Haskell Platform

Optional:

For the Gannet assembler:

  • YAML::Syck from CPAN

For the Scheme back-end Skua:

For the Perl6 back-end Puffin:

For cross-compilation to linux-ppc:

  • Crosstool with /gcc-3.4.4-glibc-2.3.3/powerpc-405-linux-gnu/bin

INSTALLATION:

# get the archive (GannetCode-0.1.tgz)
 wget www.gannetcode.org/downloads/GannetCode-0.1.tgz   
# create a directory Gannet:
 mkdir Gannet
# go there
 cd Gannet
# unpack the archive 
 tar -zxvf ../GannetCode-0.1.tgz

The environment variable GANNET_DIR must be set to the above directory. The file etc/gannetrc contains the environment settings for Gannet. Edit this file for your system;

$ vim etc/gannetrc

then source it:

$ . etc/gannetrc

That's it, you can start using Gannet -- although you'll most likely want to build the compiler, Virtual Machine and/or SystemC hardware model. But without building anything, you can write Gannet assembly, generate bytecode with the Gannet Assembler and run it on Garnet, the Ruby version of the Gannet machine.

BUILDING:

Assembler:

The Gannet assembler is written in Perl but you need to install YAML::Syck from CPAN:

$ cpan install YAML::Syck

Compiler:

Unless you're happy writing Gannet assembly, you'll need to build the Gannet compiler. First you need to build the HsSyck dependency (currently the compiler needs an older version of HsSyck, the Cabal version will not work).

$ cd third-party/HsSyck
$ cabal configure
$ cabal build
$ cabal install

(Or if you don't have the cabal command:

$ run-haskell Setup.hs configure --user
$ run-haskell Setup.hs build
$ run-haskell Setup.hs install

Then build the compiler:

$ cd Compiler
$ ./build.pl

Virtual Machine:

$ cd VirtualMachine/build
$ ./build.pl 

SystemC Hardware Model:

$ cd HardwareModels/SystemC/build
$ ./build.pl

Using Gannet

To use the Gannet framework, you first build your system as a set of Services. You can use all services in the Gannet ServiceCoreLibrary or create your own services. After you've built your custom Gannet system, you can use it to run tasks. To do so, you write a task in the Gannet language, compile it and run it on the Gannet machine, either the VM or the SystemC hardware model.

  1. Create your services

    The easiest way to create a custom service is to copy the source code of one of the Services in the ServiceCoreLibrary and use that as a starting point. For more details, read Creating Services.

  2. Create your system configuration

    The Gannet system configuration is a file in YAML format. There are several examples in the SystemConfigurations folder; if you want to know the details, read The Gannet System Configuration

  3. Build your system

    To build the system, run the build.pl script with the appropriate SystemConfiguration file. The build scripts are in the build folder, run ./build.pl -h to see the options. The build script will generate the C++ system configuration header file, optionally generate C++ sources from Ruby and build

  4. Create your task description

    In other words, write some Gannet code. For a comprehensive introduction, see Programming Gannet. By convention, Gannet task description programs have the extension .td. For some examples see examples and the test directory t.

    The Gannet compiler gannetc compiles the code into Gannet bytecode (.tdc) or the target languages for the various backends. A handy wrapper around gannetc is guillemot. This wrapper will scan the .td file for a comment line with the name of the SystemConfiguration YAML file to use, if none is found it defaults to the SBA.yml from the SystemConfigurations folder. It compiles the program to bytecode but can also output Gannet assembly language.

  5. Run your task

    This is the easy bit. The bin directory contains executables for the VM (gannetvm), the hardware model (gannetssoc), the Ruby reference (garnet) and the various other backends. Assuming you want to run the program fact.tdc on the VM, it's simply

    $ gannetvm fact.tdc

    and similar for gannetsoc. For the VM, you can specify the number of "cycles" it should run before exiting as the 2nd argument. For the SystemC model you can provide the number of microseconds the simulation should run. The executable for the Ruby model, garnet, is a script, i.e. it is not compiled separately. As a result you must pass the path to the SystemConfiguration YAML file on the command line. Also, by default Garnet models the hardware. The hardware does not support all control features available with the VM. To run Garnet in VM mode, specify the -V flag:

    $ garnet -Y ../SystemConfigurations/Control.SBA.yml -V fact.tdc

    If the SystemConfiguration file is not specified, Garnet will use the default SBA.yml.

Gannet Presentations

The following presentations give an overview of the Gannet project and its evolution.

Conference talks

Seminar talks

Gannet Publications

Here are some papers discussing various aspects of the Gannet system:

W. Vanderbauwhede, C. Thirunavukkarasu, P. Mckechnie. "The Gannet Service Manager: a Distributed Dataflow Controller for Heterogeneous Multi-core SoCs." In Third NASA/ESA Conference on Adaptive Hardware and Systems, AHS 2008., pages 301-308. IEEE Computer Society, 2008.

W. Vanderbauwhede. "A Formal Semantics for Control and Data Flow in the Gannet Service-based System-on-Chip Architecture." In The International Conference on Engineering of Reconfigurable Systems and Algorithms, ERSA 2008. CSREA Press, 2008.

W. Vanderbauwhede. "Separation of Data Flow and Control Flow in Reconfigurable Multi-core SoCs using the Gannet Service-based Architecture." In Adaptive Hardware and Systems, 2007. AHS 2007. Second NASA/ESA Conference on, pages 326-333. IEEE Computer Society, 2007.

W. Vanderbauwhede. "Gannet: a Scheme for Task-level Reconfiguration of Service-based Systems-on-Chip." In Proc. 8th ACM Workshop on Scheme and Functional Programming. Universite Laval, CA, 2007.

W. Vanderbauwhede. "Gannet: a Functional Task Description Language for a Service-based SoC Architecture." In Proc. 7th Symposium on Trends in Functional Programming (TFP06), pages 366-377. Nottingham University, UK, 2006.

W. Vanderbauwhede. "The Gannet service-based SoC: A Service-level Reconfigurable Architecture." In Proceedings of 1st NASA/ESA Conference on Adaptive Hardware and Systems (AHS-2006), pages 255-261. IEEE Computer Society Press, 2006.