mobile version

Debugging software with the UNISIM Virtex 5 FXT Simulator

The goal of that tutorial is to show how to start debugging sessions with the UNISIM Virtex 5 FXT Simulator. The UNISIM Virtex 5 FXT simulator supports two methods for debugging a software application: (1) a built-in console debugger (inline-debugger); (2) the simulator is a remote target (over TCP/IP) for the GNU GDB debugger. Below, we show step by step, how to build a cross tool-chain, a Linux kernel and the MiBench benchmark suite for the simulator, and then start debugging sessions of a MiBench benchmark.

1. Build a cross tool-chain for PPC440FP

$ cd ${HOME}
$ wget http://unisim-vp.org/downloads/other/crosstool/crosstool-source-v4.tar.gz
$ tar zxvf crosstool-source-v4.tar.gz
$ mv crosstool-source-v4 cross_compiler
$ cd cross_compiler
$ ./build.sh all powerpc-440fp-linux-gnu
See also “Building a GNU Cross tool-chain for PPC440FP”.

2. Build the simulator

$ cd ${HOME}
$ wget http://unisim-vp.org/downloads/virtual-platforms/powerpc/virtex5fxt/unisim-virtex5fxt-1.0beta12.tar.gz
$ tar zxvf unisim-virtex5fxt-1.0beta12.tar.gz
$ cd unisim-virtex5fxt-1.0beta12
$ ./configure --with-systemc=${HOME}/systemc CXXFLAGS='-O3 -g3 -Wall'
$ make
See also “How to install SystemC?”.
See also “UNISIM Virtex 5 FXT Simulator Manual”.

3. Build the Mibench benchmark suite for PPC440FP

$ cd ${HOME}
$ wget http://unisim-vp.org/downloads/other/benchmarks/mibench/mibench-v1-source-v5.tar.gz
$ tar zxvf mibench-v1-source-v5.tar.gz
$ mv mibench-v1-source-v5 mibench
$ cd mibench
$ ./build.sh --target=powerpc-440fp-linux-gnu --cross-compiler-prefix=${HOME}/cross_compiler/powerpc-440fp-linux-gnu --target-simulator="${HOME}/unisim-virtex5fxt-1.0beta12/virtex5fxt/bin/unisim-virtex5fxt-wfpu-1.0beta12 -s enable-linux-os=1" all
See also “Building the MiBench benchmark suite for PPC440FP”.

4. Build a Linux distribution for the UNISIM Virtex 5 FXT Simulator

$ cd ${HOME}
$ wget http://unisim-vp.org/downloads/other/benchmarks/linux-distro/unisim-virtex5fxt-linux-distro-source-v5.tar.gz
$ tar zxvf unisim-virtex5fxt-linux-distro-source-v5.tar.gz
$ cd unisim-virtex5fxt-linux-distro-source-v5
$ ./build.sh all ${HOME}/mibench/builds/powerpc-440fp-linux-gnu ${HOME}/cross_compiler/powerpc-440fp-linux-gnu
See also “Building a Linux distribution for the UNISIM Virtex 5 FXT Simulator”.

5. Start the simulator

As an example, we propose to start a debug session of MiBench CRC32 benchmark (small data set). To debug the benchmark using the built-in debugger (inline-debugger), do the following:
$ cd ${HOME}/unisim-virtex5fxt-linux-distro-source-v5
$ ${HOME}/unisim-virtex5fxt-1.0beta12/virtex5fxt/bin/unisim-virtex5fxt-wfpu-1.0beta12 -c config/sim_config_telecomm_crc32_small.xml -s enable-inline-debugger=true
To debug the benchmark using an external GNU cross-GDB debugger, do the following:
$ cd ${HOME}/unisim-virtex5fxt-linux-distro-source-v5
$ ${HOME}/unisim-virtex5fxt-1.0beta12/virtex5fxt/bin/unisim-virtex5fxt-wfpu-1.0beta12 -c config/sim_config_telecomm_crc32_small.xml -s enable-gdb-server=true -s gdb-server.tcp-port=1235
See also “Booting Linux on the UNISIM Virtex 5 FXT Simulator”.

6. Connect an external GNU cross-GDB debugger to the simulator

For the GNU cross-GDB debugger, do the following:
$ cd ${HOME}/unisim-virtex5fxt-linux-distro-source-v5
$ ${HOME}/cross_compiler/powerpc-440fp-linux-gnu/bin/powerpc-440fp-linux-gnu-gdb -d ${HOME}/unisim-virtex5fxt-linux-distro-source-v4/linux-3.8.13 -d ${HOME}/unisim-virtex5fxt-linux-distro-source-v4/linux-3.8.13/arch/powerpc/kernel vmlinux
For the GNU DDD debugger (the graphical font-end for GDB), do the following:
$ cd ${HOME}/unisim-virtex5fxt-linux-distro-source-v5
$ ddd --debugger ${HOME}/cross_compiler/powerpc-440fp-linux-gnu/bin/powerpc-440fp-linux-gnu-gdb --directory=${HOME}/unisim-virtex5fxt-linux-distro-source-v4/linux-3.8.13 --directory=${HOME}/unisim-virtex5fxt-linux-distro-source-v4/linux-3.8.13/arch/powerpc/kernel vmlinux
In the debugger console, do the following to initialize a connection with the simulator:
(gdb) target remote :1235

7. Connect a telnet client to the simulator

$ telnet localhost 1234

Steps 5 to 7 in a video...

What's new ?

The web site has been migrated to a new server. Please note that contact mails have changed too. More to come…stay tuned!

Virtual Platforms

Highlights

Acknowledgments

Digiteo
We would like to thank Digiteo that supported us in making the UNISIM virtual platforms available to the community.

Exhibition

HiPEAC
We presented a poster at the poster sessions of the HiPEAC'12 conference, January 23-25, 2012, Paris, France. The HiPEAC conference provides a forum for experts in computer architecture, programming models, compilers, and operating systems for embedded and general-purpose systems. The conference aims at the dissemination of advanced scientific knowledge and the promotion of international contacts among scientists from academia and industry.

On-going evaluation

OPEES
A UNISIM virtual platform of a Xilinx Virtex-5 FXT is being evaluated by project partners in the context of OPEES (Open Platform for the Engineering of Embedded Systems), a European project that aims to ensure long-term availability of critical / embedded systems engineering technologies to secure industry competitiveness and development.