ppc_sim_booke (codename : Rhea)
The purpose of this project is to explore an experimental instruction set simulator for booke powerpc architectures in C++.
The reference core is freescale e500v2.
1. ISS is being designed in C++ as a shared library with a python frontend (developed using boost::python).
2. The simulator can only be compiled with GCC/llvm toolchain on a Linux/BSD based platform,
since it uses x86/x86_64 inline assembly in ppc RTL logic to map some of the ppc instructions directly to x86 instructions,
and at other places to generate optimized assembly.
3. It's not portable across platforms (for the same reason mentioned above) and would only work on an x86[_64] Linux/BSD host.
4. To facilitate loading of elf files directly into memory, the memory interface now supports an elf-loader.
1. boost C++ library (www.boost.org)
2. ipython/python. (www.python.org)
3. elfio C++ library (http://sourceforge.net/projects/elfio)
Simulator sanity tests are there in sim/src/tests/sim directory, which exercise various functionalities for different simulator modules.
DUT(design under test) tests are there in sim/tests/dut.
How to Compile :-
1. To compile everthing, go to sim/src/build and just issue "make CROSS_PREFIX=xxx",
where prefix is the cross-compiler prefix (for eg. powerpc-unknown-linux- etc).
2. To compile only dut testcases, issue "make dut_tests CROSS_PREFIX=xxx".
3. To compile only sim testcases, issue "make sim_tests".
4. To compile the simulator model, issue "make ppcsimbooke".
Running dut tests :-
After doing "make" in sim/src/build, we get the simulator module (with name ppcsim.so), some dut tests (elf files) and a python script called
run_and_check.py. It loads the elf file into simulator's memory, runs it and checks back the result.
To run palindrome test 0 (test_palindrome_0.elf), just run "./run_and_check.py --file test_palindrome_0.elf"
To run all dut tests automatically in one shot, do "make run_dut_tests" in sim/src/build.
Likewise do "make run_sim_tests" for simulator sanity tests for individual modules.
1. There is no dependency checking during build process, since it's a simple makefile based build process.
2. The cross compiler for building dut tests should have newlib C library compiled in.
Preferable choice is CodeSourcery C++ suite (http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition).
3. llvm can also be used as the host compiler (tested with llvm-3.2). For compiling with llvm, use "make CXX=clang++".
This work is distributed under the terms of GNU GPL v2. Detailed license agreements are there in COPYING file.
Copyright : Vikas Chouhan (firstname.lastname@example.org) 2012/2013.