Compiling a lightweight AEMB toolchain

From Milkymist Wiki

Jump to: navigation, search

NB! This page applies to old SoC designs that were using AEMB. Current designs use Mico32 and need a different toolchain.

To compile the BIOS and the demonstration firmware which come with the SoC core distribution, you do not need all the features of the complete Microblaze toolchain. This section explains how to compile a toolchain without the spurious features.

For Microblaze support, a modified version of the GNU toolchain should be used. It is available from the Petalogix website at http://www.petalogix.com/resources/downloads/mb-gcc. To install it, the following commands are used: mkdir /usr/microblaze

export PATH=$PATH:/usr/microblaze/bin

cd microblaze-toolchain-sources/srcs/binutils

mkdir build

cd build

../configure --target=microblaze --prefix=/usr/microblaze

make all CFLAGS="-O2 -g -DMICROBLAZE -DEDK" CXXFLAGS="-O2 -g -DMICROBLAZE -DEDK"

make install

ln -s /usr/microblaze/bin/microblaze-as /usr/microblaze/bin/mb-as

ln -s /usr/microblaze/bin/microblaze-ld /usr/microblaze/bin/mb-ld

ln -s /usr/microblaze/bin/microblaze-ar /usr/microblaze/bin/mb-ar

ln -s /usr/microblaze/bin/microblaze-ranlib /usr/microblaze/bin/mb-ranlib

cd ../../gcc

mkdir build

cd build

../configure --target=microblaze --prefix=/usr/microblaze --enable-languages="c"

make all CFLAGS="-O2 -g -DMICROBLAZE -DEDK" CXXFLAGS="-O2 -g -DMICROBLAZE -DEDK"

make install

ln -s /usr/microblaze/bin/microblaze-gcc /usr/microblaze/bin/mb-gcc

This differs from the usual installation procedure by disabling C++ support and Newlib. The Milkymist BIOS and demonstration firmware do not use C++ and come with their own lightweight C library and startup code.

If using another firmware with the Milkymist SoC, this toolchain may not be suitable.

Personal tools