QEmu for LiteX
This repository contains a version of QEmu for emulating LiteX based SoCs. This is mainly targeted at being used with the TimVideos HDMI2USB firmware which can be found here but could be reused with other LiteX based SoCs with some work.
There are two methods for building qemu-litex.
As qemu-litex targets a specific LiteX SoC it currently needs the configuration information from that SoC.
From fresh install, you will need the following packages: sudo apt-get install flex bison autoconf libtool libpixman-1-dev
Building inside HDMI2USB-litex-firmware
- Follow "getting started" instructions for getting the gateware setup.
- You can skip the "Prerequisite (Xilinx)" section if you never want to build gateware for the FPGAs.
Enter the HDMI2USB-litex-firmware environment with
- For example on the MimasV2 you need to set
./scripts/build-qemu.sh. This will;
- Get the qemu-litex repo.
- Configure a qemu system for your platform/target in
- Build qemu.
- Run the bios+firmware using qemu.
Building outside HDMI2USB-litex-firmware
Clone the git repo with
git clone https://github.com/timvideos/qemu-litex.git
(Optional) Set the
CPUSto your required configuration. The defaults should be fine if you are just playing with things.
- Download the configuration information, BIOS and firmware from the
HDMI2USB-firmware-prebuilt repo into the
- Configure qemu to build in the
- Build qemu.
- You can then run qemu by following the examples output at the end of the script.
- or1k (openrisc)
- sh2 (j-core)
- block rom
- block sram
- main memory (DDR?)
- spiflash (including bitbanging)