Skip to content.

TUD TU Dresden

The SHAP Bytecode Processor
TU Dresden » Faculty of Computer Science » Institute for Computer Engineering » Chair for VLSI – EDA » SHAP

User Manual

SHAP User Manual

Martin Zabel, Thomas B. Preußer

Technische Universität Dresden
Faculty of Computer Science
Institute for Computer Engineering
Chair for VLSI-Design, Diagnostics and Architecture



All trademarks are the property of their respective owners.


1 Executing a pre-linked Java program
1.1 Linux
1.2 Windows
2 Compiling and Pre-Linking a Java Application

1 Executing a pre-linked Java program

To start off fast, we provide, together with .bit-files for some FPGA Boards, a set of pre-linked Java applications in terms of .shap-files. This section describes how to execute the applications using Test.shap as an example. Sec. 2 covers on how to compile and link your own application.

At first, program your board with one of the provided .bit-files with your favorite programming tool. The hardware is reset automatically after programming as well as after the last Java Thread finishes (called “soft reset”). The hardware can also be reset manually by:

Spartan-3 Starter KitBTN3
Spartan-3E Starter KitBTN SOUTH

If uploading of the .shap-file hangs, stop transmitting first and press the reset button repeatedly to clear the output buffers of the operating system.

The .shap-file as well as the default input ( and default output (System.out and System.err) are transmitted via the serial line. The procedure depends on the operating system in use and is described in the following subsections.

1.1 Linux

  1. Configure your serial line:
          stty -F /dev/ttyS0 115200 raw -cstopb -parenb \
          -crtscts -echo ixon -ixoff

    You may have to choose a different device than /dev/ttyS0!

    This enables software flow control for transmitting the .shap-file (or any other file) from the PC to the board. After resetting the board, an XON is sent automatically to place the serial line into the transmit state.

  2. For the output, start in one terminal:
          cat /dev/ttyS0
  3. Upload the .shap-file from a second terminal:
          cat Test.shap > /dev/ttyS0
  4. Inputs (for can be sent using:
          echo "xyz" > /dev/ttyS0

1.2 Windows

For windows, a terminal program supporting software flow control as well as uploading of binaries is required. TeraTerm is an appropriate tool, which supports both.

  1. Start TeraTerm
  2. Select COM1 or another serial port as appropriate.
  3. Select the menu “Setup, Serial Port” and set this configuration:
    • Baud rate: 115200
    • Data: 8 bit
    • Parity: none
    • Stop: 1 bit
    • Flow control: Xon/Xoff
  4. Open the menu “File, Send File”. Select the .shap-file and flag the option “binary” — press OK.

    Output and further input is done via the TeraTerm window.

2 Compiling and Pre-Linking a Java Application

Compile your Java application with your favorite Java compiler and specify shap-rt.jar as the boot-classpath like this:

  javac -bootclasspath shap-rt.jar *.java

Then, pre-link the application using this command, or similar:

  java -jar ShapLinker.jar -b shap-rt.jar -o Test.shap Test


  • Test denotes the main class,
  • -b shap-rt.jar defines the runtime (boot classes),
  • -o Test.shap names the output file.

If the class files of your application are stored in another than the current directory, then the option -cp <path> defines the classpath as usual.

You can specify more than one main class, which will then be executed in parallel. Specifying one class multiple times has no effect.


New version (2008-06-04) of SHAP as well as the new game SkyRoads are now available for download.


Prof. Rainer G. Spallek

Thomas B. Preußer

Martin Zabel

+49 (0)351 463 38324
Street Address
Nöthnitzer Straße 46, Room 1095
01187 Dresden
Mail Address
Chair for VLSI – EDA
Fakultät Informatik
Technische Universität Dresden
D-01062 Dresden