Sancus is free software. The latest source code of the Sancus project is being actively maintained on GitHub. Please redirect all your bug reports, issues, and pull requests to the corresponding GitHub repository.

This page provides installation instructions, source code and binary packages for the official Sancus 2.0 release: simulator, compiler and runtime support libraries. All provided binary packages have been tested on Ubuntu 16.04 but should work on any Debian-based GNU/Linux distribution.

In the following, every section starts with a table listing the prerequisites needed to build or run the current software. Prerequisites that are marked are only needed when building from source. Note that by default, the install prefix is /usr/local. If you would like to use a different prefix, add -DCMAKE_INSTALL_PREFIX=/your/prefix to the cmake command. The top-level directory of the unpacked source archive will be referred to as $SOURCE_ROOT and we assume a Bash shell is used.

Tip: If you have AptURL installed, you can install the prerequisites by clicking the package name. You can also click the button below to install all prerequisites at once.

Prerequisites
Name Ubuntu package Version
Python python3 ≥3.3
Icarus Verilog iverilog ≥0.9
Tcl/Tk tk ≥8.5
CMake cmake ≥3.4.3

To install the Sancus simulator and tools:

cd $SOURCE_ROOT
mkdir build
cd build
cmake ..
make install

This will install sancus-sim, sancus-loader, sancus-gdbproxy and sancus-minidebug.

Prerequisites
Name Ubuntu package Version
XILINX ISE WebPACK N/A ≥2012.4

An ISE project for synthesizing Sancus for a XuLA2-LX25 FPGA on a StickIt!-MB board can be found in $SOURCE_ROOT/fpga/xula2-stickit. We also provide a pre-compiled BIT file as well as an MCS file for loading into the SPI/Flash. By default, Sancus is synthesized with the following features:

  • Support for 8 concurrent protected modules.
  • 64-bit keys
  • 48KB of program memory.
  • 10KB of data memory.
  • Debug interface.
  • UART interface.

Prerequisites
Name Ubuntu package Version
LLVM prerequisites N/A N/A
CMake cmake ≥3.4.3

While building our compiler, we have found a bug in Clang that needs to be patched before being able to use our compiler. The easiest way to do this is to install the provided binary package. This package is called clang-sancus and will be installed in /usr/local/. If you want to patch and build LLVM/Clang manually, you can use the following instructions:

wget http://releases.llvm.org/4.0.0/llvm-4.0.0.src.tar.xz
tar xf llvm-4.0.0.src.tar.xz
cd llvm-4.0.0.src/tools/
wget http://releases.llvm.org/4.0.0/cfe-4.0.0.src.tar.xz
tar xf cfe-4.0.0.src.tar.xz
mv cfe-4.0.0.src clang
cd clang
wget https://distrinet.cs.kuleuven.be/software/sancus/downloads/clang.patch
patch -p1 < clang.patch
cd ../..
mkdir build
cd build
cmake ..
make
make install

If you do not want to install every LLVM backend but only the necessary one, add -DLLVM_TARGETS_TO_BUILD=MSP430 to the cmake command.

Prerequisites
Name Ubuntu package Version
Python python3 ≥3.3
pyelftools N/A1 ≥0.24
MSPGCC Binutils binutils-msp430 ≥20120406
MSPGCC GCC gcc-msp430 ≥20120406
MSPGCC libc msp430-libc ≥20120242
MSPGCC MCU msp430mcu ≥20120406
Patched LLVM/Clang N/A N/A
GNU C++ Compiler g++ ≥4.8
CMake cmake ≥3.4.3

1Can be installed using pip3 install pyelftools

To install the Sancus compiler:

cd $SOURCE_ROOT
mkdir build
cd build
cmake ..
make
make install

This will install sancus-cc, sancus-ld and sancus-crypto.