1.. _qemu_arc:
2
3ARCv2 & ARCv3 Emulation (QEMU)
4###############################
5
6Overview
7********
8
9This board configuration will use QEMU to emulate set of generic
10ARCv2 and ARCv3 hardware platforms.
11
12The following features of ARC ISA cores are currently supported:
13
14* CPU:
15  * ARCv2 EM
16  * ARCv2 HS3x
17  * ARCv3 HS5x
18  * ARCv3 HS6x
19* Only little-endian configurations
20* Full 32 register set
21* ARC core free-running timers/counters Timer0 & Timer1
22* ARC core interrupt controller with multiple priority levels
23* DW UART
24* 5 slots for MMIO Virtio devices
25
26Hardware
27********
28Supported Features
29==================
30
31The following hardware features are supported:
32
33+--------------+------------+----------------------+
34| Interface    | Controller | Driver/Component     |
35+==============+============+======================+
36| ARCv2 INTC   | on-chip    | interrupt controller |
37+--------------+------------+----------------------+
38| DW UART      | on-chip    | serial port          |
39+--------------+------------+----------------------+
40| ARC TIMER0   | on-chip    | system clock         |
41+--------------+------------+----------------------+
42
43The kernel currently does not support other hardware features on this platform.
44
45Devices
46========
47System Clock
48------------
49
50This board configuration uses a system clock frequency of 1 MHz.
51
52Serial Port
53-----------
54
55This board configuration uses a single serial communication channel with the
56DesignWare UART.
57
58Known Problems or Limitations
59==============================
60
61The following platform features are unsupported:
62
63* Memory-protection unit (MPU)
64* MMIO Virtio Ethernet
65
66Programming and Debugging
67*************************
68
69Use this configuration to run basic Zephyr applications and kernel tests in the QEMU
70emulated environment, for example, with the :zephyr:code-sample:`synchronization` sample
71(note you may use ``qemu_arc_em``, ``qemu_arc_hs``,  ``qemu_arc_hs5x`` or
72``qemu_arc_hs6x`` depending on target CPU):
73
74.. zephyr-app-commands::
75   :zephyr-app: samples/synchronization
76   :host-os: unix
77   :board: qemu_arc_em
78   :goals: run
79
80This will build an image with the synchronization sample app, boot it using
81QEMU, and display the following console output:
82
83.. code-block:: console
84
85        *** Booting Zephyr OS build zephyr-v2.2.0-2486-g7dbfcf4bab57  ***
86        threadA: Hello World from qemu_arc!
87        threadB: Hello World from qemu_arc!
88        threadA: Hello World from qemu_arc!
89        threadB: Hello World from qemu_arc!
90
91Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.
92
93Debugging
94=========
95
96Refer to the detailed overview about :ref:`application_debugging`.
97
98References
99**********
100
1011.`Programmer’s Reference Manual for ARC HS
102   <https://www.synopsys.com/dw/doc.php/iip/dwc_arc_hs4xd/latest/doc/ARC_V2_PublicProgrammers_Reference.pdf>`_
103