What is QBox?
QBox or "QEMU in a box" is QEMU with a TLM-2.0 like interface. Qemu is a system platform emulator based on JIT technology which is an industry benchmark in terms of execution speed. It can be used to simulate a wide variety of platforms, based on an equally wide variety of CPU architectures. QBox allows the powerful JIT based CPU simulations to be exploited within a TLM-2.0 context, such that it can, for instance be instanciated without TLM models in a SystemC simulation environment.
QBox is sufficiently flexible that some of the basic system components can be included within QBox, so only the device models of interest need to be modelled in SystemC.
The result is that QBox is a flexible platform simulation environment perfect for either adding new components and designing device drivers, or it can be used within the context of a much wider system as mearly one of many components.
Qbox's are shared libraries that contain Qemu based CPU models. Each Qbox contains a specific CPU core. QBox's are C objects that export a TLM-2.0 like interface. The GreenSocs Library contains TLM2C bridges to connect C TLM-2 style models to SystemC TLM-2.0. This can be used with Qbox in order to allow a Qbox to execute with your existing systems SystemC simulation library.
QBox also supports the use of:
- Eclipse connection (Use Eclipse for the full debug environment)
- Guest O/S debug (Connect to the running O/S via Qemu's GDB server port)
- Coming Soon... Multi-host thread support (multi-core platforms simulated on multi-host threads for efficacy and speed)
- Mac OS X and Windows MinGW support
For more information about Qbox's and training on how to use Qbox's and the GreenSocs SystemC library please contact us.
This platform contains the following SystemC models:
- ARM926 Qbox (Containing ARM 926 + System controller) + TLM2C SimpleCPU
- PL011 (Serial UART)
- PL190 (Interupt Controller)
- SP804 (Timers)
QBox requires :
- git > 1.8.2
- systemc 2.1.0 to 2.3.1
- cmake > 2.8
- libboost > 1.34
- python dev
- glib2 dev
- pixman dev
- lua 5.2 dev
Official OS support :
- Linux :
- Ubuntu 12.04 and 14.04
- CentOS 6 and 7
- OS X : soon
- Windows : soon
Download and install requirements
Be sure to clone the repository, including the sub-modules (see below). After cloning the repository, you should run:
$ git submodule update --init $ cd libs/qbox $ git submodule update --init dtc $ cd ../..
Ubuntu / Debian :
$ sudo apt-get install cmake libboost-dev python-dev libglib2.0-dev libpixman-1-dev liblua5.2-dev swig
CentOS / Fedora :
$ sudo yum install cmake boost-devel python-devel glib2-devel pixman-devel lua-devel swig
$ cmake -DCMAKE_INSTALL_PREFIX=[install dir] -DSYSTEMC_PREFIX=[systemc prefix]
Note : If you're using CentOS 6, add this option to fix Boost module
$ cmake -DCMAKE_INSTALL_PREFIX=build -DSYSTEMC_PREFIX=/usr/local/lib/systemc-2.3.0/
(The default value of
Compile with :
$ make install
Change directory to your install dir :
$ cd build/bin $ ./toplevel --conf [platform.lua]
platform.lua is the path to your platform conf file. You can find some examples in
The Serial UARTs connect on ports 1236, 1237, 1238 and 1239. Port 1236 corrisponds to the console. Once the system starts, you have 7 seconds to connect to that port before the system will continue, so that you can see the output from the system as it boots. The simplest way of doing this is with telnet.
$ telnet localhost 1236
You may also use nc and cat to move files into the system. On your host (where you are running the simulation), you shoud copy the file into the guest using the command:
$ nc localhost 1237 < FILE_TO_SEND
On your guest (inside the simulation), you should receive the file using the command:
QBox is an open source, community-driven project. If you'd like to contribute, please feel free to fork project and open merge request or to send us patch.