Skip to content

hw/core: Introduce Remote Port Co-simulation Protocol

Ruslan Ruslichenko qemu-arm qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest20 patches 13 repliesIn review
  2. v129 patches 11 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20hw/core: Add Remote Port protocol packet definitioninclude/hw/core/remote-port-proto.h+299 -00 replies
2/20hw/core: Add Remote Port header helpershw/core/remote-port-proto.c include/hw/core/remote-port-proto.h+91 -00 replies
3/20hw/core: Add Remote Port session state and hello protocolhw/core/remote-port-proto.c include/hw/core/remote-port-proto.h+205 -10 replies
4/20hw/core: Implement Remote Port bus access helpershw/core/remote-port-proto.c include/hw/core/remote-port-proto.h+285 -00 replies
5/20hw/core: Implement Remote Port irq, sync and ATS helpershw/core/remote-port-proto.c include/hw/core/remote-port-proto.h+129 -00 replies
6/20hw/core: Add Remote Port object skeletonhw/core/remote-port.c include/hw/core/remote-port.h+227 -00 replies
7/20hw/core: Add Remote Port protocol thread and handshakehw/core/remote-port.c hw/core/trace-events include/hw/core/remote-port.h+340 -10 replies
8/20hw/core: Implement Remote Port response handlinghw/core/remote-port.c hw/core/trace-events include/hw/core/remote-port.h+163 -20 replies
9/20hw/core: Implement Remote Port time synchronizationhw/core/remote-port.c include/hw/core/remote-port.h+188 -20 replies
10/20hw/core: Add Remote Port Memory Master object skeletonhw/core/remote-port-memory-master.c hw/core/remote-port.c include/hw/core/remote-port-memory-master.h +1 more+256 -00 replies
11/20hw/core: Implement Remote Port Memory Master bus transactionshw/core/remote-port-memory-master.c hw/core/remote-port.c hw/core/trace-events +1 more+207 -46 replies
12/20system/physmem: Add ats_do_translate helperinclude/system/memory.h system/physmem.c+61 -05 replies
13/20hw/core: Add Remote Port ATS device skeletonhw/core/remote-port-ats.c include/hw/core/remote-port-ats.h+285 -00 replies
14/20hw/core: Implement Remote Port ATS logic and cache managementhw/core/remote-port-ats.c+205 -20 replies
15/20hw/core: Add Remote Port memory slave devicehw/core/remote-port-memory-slave.c hw/core/trace-events include/hw/core/remote-port-memory-slave.h+281 -00 replies
16/20hw/core: Add Remote Port GPIO/Interrupt bridgehw/core/remote-port-gpio.c hw/core/trace-events include/hw/core/remote-port-gpio.h+225 -00 replies
17/20hw/core: Add Remote Port Stream devicehw/core/remote-port-stream.c hw/core/trace-events+250 -00 replies
18/20hw/core: Add Remote Port files to buildhw/core/Kconfig hw/core/meson.build+14 -00 replies
19/20hw/core: Add FDT support to Remote Port GPIOhw/core/remote-port-gpio.c+23 -00 replies
20/20hw/core: Add FDT support to Remote Port memory masterhw/core/remote-port-memory-master.c+34 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/20] hw/core: Introduce Remote Port Co-simulation Protocol

From: Ruslan Ruslichenko <[email protected]>

This patch series introduces the Remote Port (RP) subsystem, a framework designed to connect QEMU with external simulation environments (such as SystemC models or RTL simulators).

Updates in v2:

- Removed global 'machine-path' and 'sync-quantum' cmdline options
- Added EventNotifier for communication between IO and CPU threads, instead of pipes and sockets
- Made chrdev_id mandatory and simplified chardev configuration
- MemoryTransaction .access handler dropped and reworked RPMemoryTransaction to use existing .read/write_with_attrs
- Reduced coupling with HW Device Tree by making rp devices register themselves within rp core using rp-chan property
- Dropped debug macros and added tracepoints instead
- Added reference to sample project using QEMU with SystemC
- Addressed review comments from v1 patch series:
https://lists.gnu.org/archive/html/qemu-devel/2026-02/msg01760.html

Origin:
The Remote Port protocol was originally developed by Edgar E. Iglesias.
The original source code is available in the QEMU repository at AMD: https://github.com/Xilinx/qemu.

Motivation
In modern SoC and FPGA development, specialized hardware blocks are often verified using SystemC, Verilog, or VHDL long before silicon is available. While QEMU is optimized for high-performance CPU emulation and software development, it requires hardware models to be rewritten in C, which is time-consuming and duplicates effort.

The Remote Port (RP) subsystem addresses this limitation by enabling a Co-simulation environment. It allows QEMU to act as the high-performance Processing Subsystem, booting complex operating systems (e.g. Linux), while delegating specific peripheral modeling to external simulators (SystemC, RTL) via a socket connection.

The Remote Port protocol provides a socket-based interface that supports:

Memory Transactions: Bidirectional memory accesses (Master and Slave) allowing QEMU to access remote devices and vice versa. Interrupts/GPIO: Propagation of interrupt signals between QEMU and the remote peer.
IOMMU/ATS Support: Support for Address Translation Services, allowing remote devices to operate correctly behind IOMMU. Time Synchronization: Keeps QEMU and the external simulator in sync by advancing time in fixed steps (quantums).

Integration with SystemC Ecosystem

To connect the simulation side, the open-source libsystemctlm-soc library [1] is used. It acts as a bridge, translating Remote Port protocol packets into standard SystemC/TLM-2.0 transactions [2]. This allows users to attach existing TLM-2.0 compliant models to QEMU.

Architecture Overview

The series is structured into the following logical components:

1. Core Protocol & Infrastructure

Establishes the socket connection and handshake (Hello protocol). Implements the packet dispatch loop and thread management.

2. Memory Transaction Support

RP Memory Slave: Allows the remote peer to initiate bus transactions within QEMU. RP Memory Master: Represents a memory region in QEMU that forwards accesses to the remote peer.

3. Address Translation Services (ATS)

Implements the logic to handle ATS requests from remote masters. Integrates with QEMU's IOMMU notifiers to manage translation caches.

4. Device Tree (FDT) & Configuration

Added FDT support for Remote Port Memory Master and GPIO

Dependencies

Patches 19-20 in series are based on the following previously submitted series:
FDT based machine v3: https://lists.nongnu.org/archive/html/qemu-devel/2026-04/msg00415.html

Instantiation of Remote Port via FDT also registers its reset handler, needed to start protocol thread.

Validation:

The Sample Project demonstrating test setup with QEMU/Remote Port and SystemC emulated PL011 UART module available by following link:
https://github.com/renesas/SysC_Island_MIT

Patch Summary
The series is organized as follows:

System/Global:

system/physmem: Add ats_do_translate helper

Remote Port Core:

hw/core: Add Remote Port protocol packet definition hw/core: Add Remote Port header helpers
hw/core: Add Remote Port session state and hello protocol hw/core: Add Remote Port object skeleton hw/core: Add Remote Port protocol thread and handshake hw/core: Implement Remote Port response handling hw/core: Implement Remote Port time synchronization hw/core: Implement Remote Port irq, sync and ATS helpers hw/core: Add Remote Port files to build

Memory & Bus Access:

hw/core: Implement Remote Port bus access helpers hw/core: Add Remote Port Memory Master object skeleton hw/core: Implement Remote Port Memory Master bus transactions hw/core: Add Remote Port memory slave device

ATS & Streams:

hw/core: Add Remote Port Stream device
hw/core: Add Remote Port ATS device skeleton hw/core: Implement Remote Port ATS logic and cache management

FDT & GPIO:

hw/core: Add Remote Port GPIO/Interrupt bridge hw/core: Add FDT support to Remote Port GPIO hw/core: Add FDT support to Remote Port memory master

Links:
[1] libsystemctlm library: https://github.com/Xilinx/libsystemctlm-soc

[2] SystemC TLM description: https://systemc.org/overview/systemc-tlm/

Ruslan Ruslichenko (20):
hw/core: Add Remote Port protocol packet definition hw/core: Add Remote Port header helpers
hw/core: Add Remote Port session state and hello protocol hw/core: Implement Remote Port bus access helpers hw/core: Implement Remote Port irq, sync and ATS helpers hw/core: Add Remote Port object skeleton
hw/core: Add Remote Port protocol thread and handshake hw/core: Implement Remote Port response handling hw/core: Implement Remote Port time synchronization hw/core: Add Remote Port Memory Master object skeleton hw/core: Implement Remote Port Memory Master bus transactions system/physmem: Add ats_do_translate helper hw/core: Add Remote Port ATS device skeleton hw/core: Implement Remote Port ATS logic and cache management hw/core: Add Remote Port memory slave device hw/core: Add Remote Port GPIO/Interrupt bridge hw/core: Add Remote Port Stream device
hw/core: Add Remote Port files to build
hw/core: Add FDT support to Remote Port GPIO hw/core: Add FDT support to Remote Port memory master

 hw/core/Kconfig                             |   4 +
 hw/core/meson.build                         |  10 +
 hw/core/remote-port-ats.c                   | 412 +++++++++++
 hw/core/remote-port-gpio.c                  | 210 ++++++
 hw/core/remote-port-memory-master.c         | 369 +++++++++
 hw/core/remote-port-memory-slave.c          | 242 ++++++
 hw/core/remote-port-proto.c                 | 467 ++++++++++++
 hw/core/remote-port-stream.c                | 246 ++++++
 hw/core/remote-port.c                       | 782 ++++++++++++++++++++
 hw/core/trace-events                        |  22 +
 include/hw/core/remote-port-ats.h           |  76 ++
 include/hw/core/remote-port-gpio.h          |  34 +
 include/hw/core/remote-port-memory-master.h |  81 ++
 include/hw/core/remote-port-memory-slave.h  |  35 +
 include/hw/core/remote-port-proto.h         | 541 ++++++++++++++
 include/hw/core/remote-port.h               | 164 ++++
 include/system/memory.h                     |   8 +
 system/physmem.c                            |  53 ++
 18 files changed, 3756 insertions(+)
 create mode 100644 hw/core/remote-port-ats.c
 create mode 100644 hw/core/remote-port-gpio.c
 create mode 100644 hw/core/remote-port-memory-master.c
 create mode 100644 hw/core/remote-port-memory-slave.c
 create mode 100644 hw/core/remote-port-proto.c
 create mode 100644 hw/core/remote-port-stream.c
 create mode 100644 hw/core/remote-port.c
 create mode 100644 include/hw/core/remote-port-ats.h
 create mode 100644 include/hw/core/remote-port-gpio.h
 create mode 100644 include/hw/core/remote-port-memory-master.h
 create mode 100644 include/hw/core/remote-port-memory-slave.h
 create mode 100644 include/hw/core/remote-port-proto.h
 create mode 100644 include/hw/core/remote-port.h
Signature · 1 line
2.43.0