[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Debconf-video] Limited QEmu emulation support for HDMI2USB gateware (Develop firmware without hardware!)

We now have working or1k support & spi flash support in the repo at https://github.com/timvideos/qemu-litex, it's going to need some cleanup before we can upstream it however.

You can continue to build QEmu as part of the HDMI2USB-litex-firmware with the https://github.com/mithro/HDMI2USB-litex-firmware/blob/master/scripts/build-qemu.sh script.

However, if you prefer you can build QEMu directly without the rest of the environment using the https://github.com/timvideos/qemu-litex/blob/master/build-litex-qemu.sh script. This will download the generated headers, BIOS and firmware from our prebuilt repo.

Tim 'mithro' Ansell

On 31 March 2017 at 11:53, Tim Ansell <mithro@mithis.com> wrote:
Hi everyone!

Thanks to some excellent work by Key2, we now have basic support for emulation of some HDMI2USB gateware features. This allows you to play with many parts of firmware development without needing hardware!

To use this emulation, the process should be;

 1) Follow "getting started" instructions for getting the gateware setup (https://github.com/timvideos/HDMI2USB-litex-firmware/blob/master/getting-started.md)

     - You can skip the section requiring the Xilinx tools if you don't ever want to use the real hardware.

 2) Enter the gateware environment with ./scripts/enter-env.sh

 3) Set PLATFORM and TARGET correctly - IE "export PLATFORM=mimasv2" if using the MimasV2

 4) Run ./scripts/build-qemu.sh

This will build you an QEmu emulator for your target in ./build/$PLATFORM_$TARGET_lm32/qemu and then run the bios+firmware using the emulator.

The QEmu support is still very limited, at the moment it supports;
 * Only the net and base TARGETs (no support for video or hdmi2usb targets yet).
 * Emulation of lm32 CPU architecture (no support for or1k or risc-v yet).
 * Stub emulation of memory interfaces like DDR ram, block RAM and memory mapped SPI flash.
 * Emulation of liteEth for network connectivity (including mdio support).
 * Emulation of I2C bitbanging.

There is still a lot of things which don't work properly (for example the timers) and it will be a lot of work to get this stuff upstream. Things which need work are support for more peripherals like the LED/switches, SPI flash bit banging, and video output stuff soon. Hopefully a GSoC student is interested in continuing this work (https://github.com/timvideos/getting-started/issues/41) as it would accelerate it significantly!

As QEmu does emulates the liteEth hardware, it should be very useful in improving the network stack (such as adding DHCP support). It should be very useful in projects like porting NuttX (https://github.com/timvideos/getting-started/issues/42) and Linux (https://github.com/timvideos/getting-started/issues/30) to our FPGA SoC.

Looking forward to seeing what this enables!

Tim 'mithro' Ansell

Reply to: