target/mips: Use OPC_MUL instead of OPC__MXU_MUL
[qemu/ar7.git] / docs / system / target-riscv.rst
blob94d99c4c82937b5b4b0c176db4ba3ef19c150e7e
1 .. _RISC-V-System-emulator:
3 RISC-V System emulator
4 ======================
6 QEMU can emulate both 32-bit and 64-bit RISC-V CPUs. Use the
7 ``qemu-system-riscv64`` executable to simulate a 64-bit RISC-V machine,
8 ``qemu-system-riscv32`` executable to simulate a 32-bit RISC-V machine.
10 QEMU has generally good support for RISC-V guests. It has support for
11 several different machines. The reason we support so many is that
12 RISC-V hardware is much more widely varying than x86 hardware. RISC-V
13 CPUs are generally built into "system-on-chip" (SoC) designs created by
14 many different companies with different devices, and these SoCs are
15 then built into machines which can vary still further even if they use
16 the same SoC.
18 For most boards the CPU type is fixed (matching what the hardware has),
19 so typically you don't need to specify the CPU type by hand, except for
20 special cases like the ``virt`` board.
22 Choosing a board model
23 ----------------------
25 For QEMU's RISC-V system emulation, you must specify which board
26 model you want to use with the ``-M`` or ``--machine`` option;
27 there is no default.
29 Because RISC-V systems differ so much and in fundamental ways, typically
30 operating system or firmware images intended to run on one machine
31 will not run at all on any other. This is often surprising for new
32 users who are used to the x86 world where every system looks like a
33 standard PC. (Once the kernel has booted, most user space software
34 cares much less about the detail of the hardware.)
36 If you already have a system image or a kernel that works on hardware
37 and you want to boot with QEMU, check whether QEMU lists that machine
38 in its ``-machine help`` output. If it is listed, then you can probably
39 use that board model. If it is not listed, then unfortunately your image
40 will almost certainly not boot on QEMU. (You might be able to
41 extract the file system and use that with a different kernel which
42 boots on a system that QEMU does emulate.)
44 If you don't care about reproducing the idiosyncrasies of a particular
45 bit of hardware, such as small amount of RAM, no PCI or other hard
46 disk, etc., and just want to run Linux, the best option is to use the
47 ``virt`` board. This is a platform which doesn't correspond to any
48 real hardware and is designed for use in virtual machines. You'll
49 need to compile Linux with a suitable configuration for running on
50 the ``virt`` board. ``virt`` supports PCI, virtio, recent CPUs and
51 large amounts of RAM. It also supports 64-bit CPUs.
53 Board-specific documentation
54 ----------------------------
56 Unfortunately many of the RISC-V boards QEMU supports are currently
57 undocumented; you can get a complete list by running
58 ``qemu-system-riscv64 --machine help``, or
59 ``qemu-system-riscv32 --machine help``.
62    This table of contents should be kept sorted alphabetically
63    by the title text of each file, which isn't the same ordering
64    as an alphabetical sort by filename.
66 .. toctree::
67    :maxdepth: 1
69    riscv/sifive_u
71 RISC-V CPU features
72 -------------------