This repository has been archived by the owner. It is now read-only.
WIP qemu RISC-V target support
C C++ Python Shell Haxe Assembly Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
audio
backends
block
bsd-user
contrib
crypto
default-configs
disas
docs
dtc @ 65cc4d2
fpu
fsdev
gdb-xml
hw
include
io
libdecnumber
linux-headers
linux-user
migration
nbd
net
pc-bios
pixman @ 87eea99
po
qapi
qga
qobject
qom
replay
roms
scripts
slirp
stubs
target-alpha
target-arm
target-cris
target-i386
target-lm32
target-m68k
target-microblaze
target-mips
target-moxie
target-openrisc
target-ppc
target-riscv
target-s390x
target-sh4
target-sparc
target-tilegx
target-tricore
target-unicore32
target-xtensa
tcg
tests
trace
ui
util
.dir-locals.el
.exrc
.gitignore
.gitmodules
.mailmap
.travis.yml
CODING_STYLE
COPYING
COPYING.LIB
Changelog
HACKING
LICENSE
MAINTAINERS
Makefile
Makefile.objs
Makefile.target
README
VERSION
accel.c
aio-posix.c
aio-win32.c
arch_init.c
async.c
balloon.c
block.c
blockdev-nbd.c
blockdev.c
blockjob.c
bootdevice.c
bt-host.c
bt-vhci.c
configure
cpu-exec-common.c
cpu-exec.c
cpus.c
cputlb.c
device-hotplug.c
device_tree.c
disas.c
dma-helpers.c
dump.c
exec.c
gdbstub.c
hmp-commands-info.hx
hmp-commands.hx
hmp.c
hmp.h
iohandler.c
ioport.c
iothread.c
kvm-all.c
kvm-stub.c
main-loop.c
memory.c
memory_mapping.c
module-common.c
monitor.c
numa.c
os-posix.c
os-win32.c
page_cache.c
qapi-schema.json
qdev-monitor.c
qdict-test-data.txt
qemu-bridge-helper.c
qemu-char.c
qemu-doc.texi
qemu-ga.texi
qemu-img-cmds.hx
qemu-img.c
qemu-img.texi
qemu-io-cmds.c
qemu-io.c
qemu-nbd.c
qemu-nbd.texi
qemu-option-trace.texi
qemu-options-wrapper.h
qemu-options.h
qemu-options.hx
qemu-seccomp.c
qemu-tech.texi
qemu-timer.c
qemu.nsi
qemu.sasl
qmp-commands.hx
qmp.c
qtest.c
rules.mak
softmmu_template.h
spice-qemu-char.c
tcg-runtime.c
tci.c
thread-pool.c
thunk.c
tpm.c
trace-events
translate-all.c
translate-all.h
translate-common.c
user-exec.c
version.rc
vl.c
xen-common-stub.c
xen-common.c
xen-hvm-stub.c
xen-hvm.c
xen-mapcache.c

README

About
~~~~~
This repo a personal side branch of RISC-V QEMU.

Current status re. riscv/riscv-qemu:

  * alternative TCG frontend:
    * different implementation insn decoder
    * different implementation of certain instructions
    * RVC support
    * missing privileged instructions
  * some nasty linux-user bugs

Linux-user code has been merged into riscv/riscv-qemu.
The parent repo improved their frontend a lot since the time
this branch started, and fixed certain bugs still present here.

Do not use this if you just need a RISC-V qemu.
See https://github.com/riscv/riscv-qemu instead.


Coverage and status
~~~~~~~~~~~~~~~~~~~
User mode RV64/RV32 emulation builds and runs some executables.
System mode emulation is not supported yet.

Extensions A, M, F, D and C are implemented for RV64 and RV32.
Most CSRs are not properly supported, including mandatory counters.
This implementation follows RISC-V ISA spec version 2.1.

GDB remote debugging works.


Building
~~~~~~~~
Follow standard qemu procedure for riscv64-linux-user target:

    ./configure --target-list=riscv64-linux-user [--python=/usr/bin/python2]
    make

Note configure needs explicit python2 command supplied in case the host
python is python 3.x, which is pretty common in modern distros.

Target name for RV32 is riscv32-linux-user.


Debugging
~~~~~~~~~
ISA test suite can be found at https://github.com/arsv/riscv-qemu-tests

Use GDB from the official RISC-V toolchain in extended-remote mode:

    qemu-riscv -g 1234 ./executable

    riscv64-unknown-elf-gdb -ex "target extended-remote :1234" ./executable

Instruction single-stepping, line stepping and breakpoints should work.
GDB should display xN and fN registers properly as well.


Where's the code
~~~~~~~~~~~~~~~~
Check target-riscv/, linux-user/riscv/, and search for TARGET_RISCV ifdefs
in linux-user{main.c,elfload.c,signal.c,syscall_defs.h}.


License and contacts
~~~~~~~~~~~~~~~~~~~~
RISC-V related code in this branch is licensed under the terms
of GNU General Public License version 2, like most of QEMU.

Alex Suykov <alex.suykov@gmail.com>