Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
67aff3e
docs: Add hexagon sysemu docs
androm3da Apr 30, 2024
db5ce71
docs/system: Add hexagon CPU emulation
androm3da Oct 26, 2024
62ffe00
target/hexagon: Fix badva reference, delete CAUSE
androm3da Aug 8, 2024
15615de
target/hexagon: Add missing A_CALL attr, hintjumpr to multi_cof
androm3da May 18, 2024
4153e41
target/hexagon: Handle system/guest registers in gen_analyze_funcs.py…
androm3da May 18, 2024
22389d1
target/hexagon: Make gen_exception_end_tb non-static
androm3da May 20, 2024
5c159ea
target/hexagon: Switch to tag_ignore(), generate via get_{user,sys}_t…
androm3da May 18, 2024
bb2479c
FIXME target/hexagon: Add privilege check, use tag_ignore()
androm3da May 18, 2024
947ff4a
target/hexagon: Add memory order definition
androm3da May 20, 2024
725700a
target/hexagon: Add a placeholder fp exception
androm3da May 20, 2024
33dba19
target/hexagon: Add guest, system reg number defs
androm3da May 20, 2024
58c88a3
target/hexagon: Add guest, system reg number state
androm3da May 29, 2024
658266e
target/hexagon: Add TCG values for sreg, greg
androm3da May 20, 2024
fc73bb7
target/hexagon: Add guest/sys reg writes to DisasContext
androm3da May 20, 2024
9aab4e9
target/hexagon: Add imported macro, attr defs for sysemu
androm3da May 20, 2024
9bd7d0a
target/hexagon: Define DCache states
androm3da Sep 9, 2024
7a3f5fb
target/hexagon: Add new macro definitions for sysemu
androm3da May 20, 2024
62c7876
target/hexagon: Add handlers for guest/sysreg r/w
androm3da May 20, 2024
52957a4
target/hexagon: Add placeholder greg/sreg r/w helpers
androm3da May 20, 2024
df70447
target/hexagon: Add vmstate representation
androm3da Sep 8, 2024
20dee88
target/hexagon: Make A_PRIV, "J2_trap*" insts need_env()
androm3da May 27, 2024
0410964
target/hexagon: Define register fields for system regs
androm3da May 24, 2024
b714e0d
target/hexagon: Implement do_raise_exception()
androm3da Sep 5, 2024
9e0416e
target/hexagon: Add system reg insns
androm3da May 29, 2024
19b3186
target/hexagon: Add sysemu TCG overrides
androm3da Jul 8, 2024
f6a8b72
target/hexagon: Add implicit attributes to sysemu macros
androm3da Sep 12, 2024
7175be4
target/hexagon: Add TCG overrides for int handler insts
androm3da Jul 25, 2024
10f534d
target/hexagon: Add TCG overrides for thread ctl
androm3da Jul 25, 2024
7cbaac0
target/hexagon: Add TCG overrides for rte, nmi
androm3da Jul 25, 2024
98cba5f
target/hexagon: Add sreg_{read,write} helpers
androm3da Jul 26, 2024
5e22e95
target/hexagon: Initialize htid, modectl regs
androm3da Aug 9, 2024
53084d0
target/hexagon: Add locks, id, next_PC to state
androm3da Aug 10, 2024
a577f78
target/hexagon: Add a TLB count property
androm3da Aug 10, 2024
ac08b30
target/hexagon: Add {TLB,k0}lock, cause code, wait_next_pc
androm3da Aug 16, 2024
21c2580
target/hexagon: Add stubs for modify_ssr/get_exe_mode
androm3da Aug 16, 2024
eb34544
target/hexagon: Add gdb support for sys regs
androm3da Aug 27, 2024
5ea56bb
target/hexagon: Add initial MMU model
androm3da Aug 26, 2024
827b283
target/hexagon: Add IRQ events
androm3da Aug 27, 2024
e2271b2
target/hexagon: Add clear_wait_mode() definition
androm3da Aug 27, 2024
e739aff
target/hexagon: Define f{S,G}ET_FIELD macros
androm3da Aug 27, 2024
566eda0
target/hexagon: Add hex_interrupts support
androm3da Aug 27, 2024
8541b40
target/hexagon: Implement ciad helper
androm3da Aug 28, 2024
b98d6d4
target/hexagon: Implement {c,}swi helpers
androm3da Aug 28, 2024
1bea095
target/hexagon: Implement iassign{r,w} helpers
androm3da Aug 28, 2024
2ef582a
target/hexagon: Implement start/stop helpers
androm3da Aug 28, 2024
3abca4e
target/hexagon: Implement modify SSR
androm3da Aug 28, 2024
3417d1b
target/hexagon: Implement {g,s}etimask helpers
androm3da Aug 28, 2024
ff9d654
target/hexagon: Implement wait helper
androm3da Aug 28, 2024
769773c
target/hexagon: Implement get_exe_mode()
androm3da Aug 28, 2024
2b9d879
target/hexagon: Implement arch_get_system_reg()
androm3da Aug 28, 2024
b21b79c
target/hexagon: Implement arch_{s,g}et_{thread,system}_reg()
androm3da Aug 28, 2024
5eb9561
target/hexagon: Add representation to count cycles
androm3da Aug 29, 2024
31ea879
target/hexagon: Add implementation of cycle counters
androm3da Aug 29, 2024
feb2239
target/hexagon: Implement modify_syscfg()
androm3da Aug 29, 2024
53db00c
target/hexagon: Add system event, cause codes
androm3da Sep 4, 2024
10ce750
target/hexagon: Implement hex_tlb_entry_get_perm()
androm3da Sep 4, 2024
ded6a19
target/hexagon: Implement hex_tlb_lookup_by_asid()
androm3da Sep 4, 2024
e096fd8
target/hexagon: Implement software interrupt
androm3da Sep 4, 2024
d3861d6
target/hexagon: Implement exec_interrupt, set_irq
androm3da Sep 5, 2024
5827ece
Hexagon: add simple cpu_exect_reset and pointer_wrap
quic-mathbern Jul 17, 2025
374125f
target/hexagon: Implement hexagon_tlb_fill()
androm3da Sep 5, 2024
66a596d
target/hexagon: Implement siad inst
androm3da Sep 5, 2024
844b21b
target/hexagon: Implement hexagon_resume_threads()
androm3da Sep 5, 2024
456f5f6
target/hexagon: Implement setprio, resched
androm3da Sep 5, 2024
0fbea5c
target/hexagon: Add sysemu_ops, cpu_get_phys_page_debug()
androm3da Sep 5, 2024
8ce01c6
target/hexagon: Add exec-start-addr prop
androm3da Sep 5, 2024
80c549d
target/hexagon: extend hexagon_cpu_mmu_index() for sysemu
androm3da Sep 5, 2024
50e16b0
target/hexagon: Decode trap1, rte as COF
androm3da Sep 6, 2024
0026b7c
target/hexagon: Implement hexagon_find_last_irq()
androm3da Sep 8, 2024
b00c277
target/hexagon: Implement modify_ssr, resched, pending_interrupt
androm3da Sep 9, 2024
641c025
target/hexagon: Add pkt_ends_tb to translation
androm3da Sep 9, 2024
55f39f3
target/hexagon: Add next_PC, {s,g}reg writes
androm3da Sep 9, 2024
0aaf0cf
target/hexagon: Add implicit sysreg writes
androm3da Sep 9, 2024
060301e
target/hexagon: Define system, guest reg names
androm3da Sep 11, 2024
3a456d2
target/hexagon: initialize sys/guest reg TCGvs
androm3da Sep 11, 2024
a359147
target/hexagon: Add TLB, k0 {un,}lock
androm3da Sep 12, 2024
e00b951
target/hexagon: Define gen_precise_exception()
androm3da Sep 12, 2024
c3e5a27
target/hexagon: Add TCG overrides for transfer insts
androm3da Sep 18, 2024
178fc69
target/hexagon: Add support for loadw_phys
androm3da Sep 18, 2024
7a40f33
target/hexagon: Add guest reg reading functionality
quic-mathbern Dec 6, 2024
771942e
target/hexagon: Add pcycle setting functionality
androm3da Dec 11, 2024
9329046
hw/intc: Add l2vic interrupt controller
SidManning Nov 8, 2023
ca81d8f
FIXME hw/hexagon: Add machine configs for sysemu
androm3da Dec 2, 2023
b803f09
hw/hexagon: Add v68, sa8775-cdsp0 defs
androm3da Oct 16, 2024
57d3b25
hw/hexagon: Add support for cfgbase
SidManning Dec 18, 2024
1ca2c23
hw/hexagon: Modify "Standalone" symbols
androm3da Oct 22, 2024
6ca1ca8
target/hexagon: add build config for softmmu
androm3da Dec 2, 2023
b5192b5
hw/hexagon: Define hexagon "virt" machine
androm3da Jul 29, 2024
65e7b82
tests/functional: Add a hexagon minivm test
androm3da Oct 26, 2024
33a4dce
target/hexagon: s/pkt_has_store/pkt_has_scalar_store
androm3da Sep 9, 2024
ef93524
target/hexagon: Add a QTimer address prop
androm3da Jan 3, 2025
e67b147
hw/timer: Add QTimer device
SidManning Nov 8, 2023
45b6f82
docs: Add hexagon VM info
androm3da Jul 9, 2024
42e382a
target/hexagon: Implement hexagon_read_timer()
androm3da Jan 3, 2025
57cdfb4
semihosting: add the "usefs" feature
quic-mathbern Jan 28, 2025
242a9b7
semihosting: add option for extended open() modes
quic-mathbern Jan 29, 2025
16939b8
semihosting: extract GET_ARG() to its own function
quic-mathbern Jan 29, 2025
825b084
semihosting: add optional callbacks
quic-mathbern Jan 29, 2025
101ae32
semihosting: add config opt to use stdio
quic-mathbern Jan 29, 2025
d212677
Hexagon: add aux functions for guest mem load/store
quic-mathbern Jan 29, 2025
0942b94
Hexagon: add semihosting support
quic-mathbern Jan 29, 2025
89ff682
Hexagon: add main arch-specific semihosting operations
quic-mathbern Jan 29, 2025
6c50a19
Hexagon: add COREDUMP semihosting operation
quic-mathbern Jan 29, 2025
8677f1a
Hexagon: add {OPEN|READ|CLOSE}_DIR semihosting operations
quic-mathbern Jan 29, 2025
4ec4d61
Hexagon: add semihosting check-tcg test
quic-mathbern Jan 29, 2025
bc06109
target/hexagon: fill in the 'rev' system register
quic-mathbern Feb 5, 2025
f9fe4d3
target/hexagon: print full name of control regs
quic-mathbern Feb 5, 2025
c468ed5
target/hexagon: fix system register names with -d in_asm
quic-mathbern Feb 5, 2025
46ccd03
target/hexagon: reset registers on cpu_reset
quic-mathbern Feb 5, 2025
6affd0a
tests/tcg/hexagon: add MMU tests
quic-mathbern Feb 5, 2025
15ddfcd
tests/tcg/hexagon: add interrupt and priority tests
quic-mathbern Feb 5, 2025
3c27335
tests/tcg/hexagon: add tests for system registers
quic-mathbern Feb 5, 2025
f93ca28
tests/tcg/hexagon: add HVX tests
quic-mathbern Feb 5, 2025
8bbca27
tests/tcg/hexagon: add l2vic tests
quic-mathbern Feb 5, 2025
6dd6e45
target/hexagon: add utimer reg impl
androm3da Sep 24, 2024
1b00a73
Hexagon (target/hexagon) Make "info tlb" work in qemu monitor
taylorsimpson Oct 29, 2024
ea2484c
target/hexagon: Add instruction definitions
quic-mliebel Feb 27, 2025
e88e8b9
FIXME: target/hexagon: Add qfloat files
quic-mliebel Feb 27, 2025
ae7ecbb
target/hexagon: Add macro imports
quic-mliebel Feb 27, 2025
a7ec2fb
target/hexagon: Update encoding of vunpackob
quic-mliebel Mar 5, 2025
89a1090
target/hexagon: Add encodings
quic-mliebel Mar 5, 2025
e8e1996
target/hexagon: Add simple qfloat test
quic-mliebel Mar 5, 2025
df57725
FIXME: Add unimplemented DMA instructions
androm3da Mar 9, 2025
0062fb6
FIXME: workaround - disable plugins tests
androm3da Mar 26, 2025
3ee0dd5
FIXME add support for trap1
androm3da Mar 26, 2025
e06ce86
FIXME add support for yield
androm3da Mar 26, 2025
e98112d
target/hexagon: add get_arch_id()
androm3da Mar 30, 2025
9262cf4
FIXME add support for FETCH_NO_UPAGE/PRIV_NO_UREAD
androm3da Mar 26, 2025
0068823
FIXME: this fixes compilation, but in which commit should it go???
quic-mathbern Jul 16, 2025
196a716
Map errno to fixed values
quic-k Aug 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,26 @@ Hexagon TCG CPUs
M: Brian Cain <[email protected]>
S: Supported
F: target/hexagon/
F: hw/intc/l2vic.[ch]
F: hw/hexagon/
F: hw/timer/qct-qtimer.c
F: include/hw/hexagon/
F: include/hw/timer/qct-qtimer.h
X: target/hexagon/idef-parser/
X: target/hexagon/gen_idef_parser_funcs.py
F: linux-user/hexagon/
F: tests/tcg/hexagon/
F: disas/hexagon.c
F: configs/targets/hexagon-linux-user/default.mak
F: configs/devices/hexagon-softmmu/default.mak
F: docker/dockerfiles/debian-hexagon-cross.docker
F: gdb-xml/hexagon*.xml
F: docs/system/target-hexagon.rst
F: docs/system/hexagon/cdsp.rst
F: docs/devel/hexagon-sys.rst
F: docs/devel/hexagon-l2vic.rst
F: tests/functional/test_hexagon_minivm.py
F: docs/devel/hexagon-vm.rst
T: git https://github.com/quic/qemu.git hex-next

Hexagon idef-parser
Expand Down
8 changes: 8 additions & 0 deletions configs/devices/hexagon-softmmu/default.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Default configuration for hexagon-softmmu

# Uncomment the following lines to disable these optional devices:

# Boards are selected by default, uncomment to keep out of the build.
# CONFIG_HEX_VIRT=y
# CONFIG_HEX_DSP=y
# CONFIG_L2VIC=y
10 changes: 10 additions & 0 deletions configs/targets/hexagon-softmmu.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Default configuration for hexagon-softmmu

TARGET_ARCH=hexagon
TARGET_SUPPORTS_MTTCG=y
TARGET_XML_FILES=gdb-xml/hexagon-core.xml gdb-xml/hexagon-hvx.xml gdb-xml/hexagon-sys.xml
TARGET_LONG_BITS=32
TARGET_NEED_FDT=y
CONFIG_SEMIHOSTING=y
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
CONFIG_SEMIHOSTING_USE_STDIO=y
59 changes: 59 additions & 0 deletions docs/devel/hexagon-l2vic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Hexagon L2 Vectored Interrupt Controller
========================================


.. code-block:: none

+-------+
| | +----------------+
| l2vic | | hexagon core |
| | | |
| +-----| | |
------> |VID0 >------------->irq2 -\ |
------> | | | | |
... > | | | | |
------> | | | <int steering> |
| +-----| | / | | \ |
| ... | | | | | | |
| +-----| | t0 t1 t2 t3 ...|
------> |VIDN | | |
------> | | | |
------> | | | |
------> | | | |
| +-----| | |
| | |Global SREG File|
| State | | |
| [ ]|<============|=>[VID ] |
| [ ]|<============|=>[VID1] |
| [ ]| | |
| [ ]| | |
| | | |
+-------+ +----------------+

L2VIC/Core Integration
----------------------

* hexagon core supports 8 external interrupt sources
* l2vic supports 1024 input interrupts mapped among 4 output interrupts
* l2vic has four output signals: { VID0, VID1, VID2, VID3 }
* l2vic device has a bank of registers per-VID that can be used to query
the status or assert new interrupts.
* Interrupts are 'steered' to threads based on { thread priority, 'EX' state,
thread interrupt mask, thread interrupt enable, global interrupt enable,
etc. }.
* Any hardware thread could conceivably handle any input interrupt, dependent
on state.
* The system register transfer instruction can read the VID0-VID3 values from
the l2vic when reading from hexagon core system registers "VID" and "VID1".
* When l2vic VID0 has multiple active interrupts, it pulses the VID0 output
IRQ and stores the IRQ number for the VID0 register field. Only after this
interrupt is cleared can the l2vic pulse the VID0 output IRQ again and provide
the next interrupt number on the VID0 register.
* The ``ciad`` instruction clears the l2vic input interrupt and un-disables the
core interrupt. If some/an l2vic VID0 interrupt is pending when this occurs,
the next interrupt should fire and any subseqeunt reads of the VID register
should reflect the newly raised interrupt.
* In QEMU, on an external interrupt or an unmasked-pending interrupt,
all vCPUs are triggered (has_work==true) and each will grab the IO lock
while considering the steering logic to determine whether they're the thread
that must handle the interrupt.
106 changes: 106 additions & 0 deletions docs/devel/hexagon-sys.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
.. _Hexagon-System-arch:

Hexagon System Architecture
===========================

The hexagon architecture has some unique elements which are described here.

Interrupts
----------
When interrupts arrive at a Hexagon DSP core, they are priority-steered to
be handled by an eligible hardware thread with the lowest priority.

Memory
------
Each hardware thread has an ``SSR.ASID`` field that contains its Address
Space Identifier. This value is catenated with a 32-bit virtual address -
the MMU can then resolve this extended virtual address to a physical address.

TLBs
----
The format of a TLB entry is shown below.

.. note::
The Small Core DSPs have a different TLB format which is not yet
supported.

.. admonition:: Diagram

.. code:: text

6 5 4 3
3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|v|g|x|A|A| | |
|a|l|P|1|0| ASID | Virtual Page |
|l|b| | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

3 2 1 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | | | | | |
|x|w|r|u|Cacheab| Physical Page |S|
| | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


* ASID: the address-space identifier
* A1, A0: the behavior of these cache line attributes are not modeled by QEMU.
* xP: the extra-physical bit is the most significant physical address bit.
* S: the S bit and the LSBs of the physical page indicate the page size
* val: this is the 'valid' bit, when set it indicates that page matching
should consider this entry.

.. list-table:: Page sizes
:widths: 25 25 50
:header-rows: 1

* - S-bit
- Phys page LSBs
- Page size
* - 1
- N/A
- 4kb
* - 0
- 0b1
- 16kb
* - 0
- 0b10
- 64kb
* - 0
- 0b100
- 256kb
* - 0
- 0b1000
- 1MB
* - 0
- 0b10000
- 4MB
* - 0
- 0b100000
- 16MB

* glb: if the global bit is set, the ASID is not considered when matching
TLBs.
* Cacheab: the cacheability attributes of TLBs are not modeled, these bits
are ignored.
* RWX: read-, write-, execute-, enable bits. Indicates if user programs
are permitted to read/write/execute the given page.
* U: indicates if user programs can access this page.

Scheduler
---------
The Hexagon system architecture has a feature to assist the guest OS
task scheduler. The guest OS can enable this feature by setting
``SCHEDCFG.EN``. The ``BESTWAIT`` register is programmed by the guest OS
to indicate the priority of the highest priority task waiting to run on a
hardware thread. The reschedule interrupt is triggered when any hardware
thread's priority in ``STID.PRIO`` is worse than the ``BESTWAIT``. When
it is triggered, the ``BESTWAIT.PRIO`` value is reset to 0x1ff.

HVX Coprocessor
---------------
The Supervisor Status Register field ``SSR.XA`` binds a DSP hardware thread
to one of the eight possible HVX contexts. The guest OS is responsible for
managing this resource.
Loading