9#ifndef _LIBQBOX_PORTS_INITIATOR_SIGNAL_SOCKET_H
10#define _LIBQBOX_PORTS_INITIATOR_SIGNAL_SOCKET_H
15#include <libqemu-cxx/libqemu-cxx.h>
17#include <ports/target-signal-socket.h>
18#include <ports/initiator-signal-socket.h>
22#include <ports/qemu-target-signal-socket.h>
46 void event_cb(
bool val)
48 if (m_qemu_remote && (m_qemu_remote->
get_gpio().same_inst_as(m_proxy))) {
69 m_proxy.get_inst().unlock_iothread();
73 m_proxy.get_inst().lock_iothread();
78 using namespace std::placeholders;
80 m_proxy =
dev.get_inst().gpio_new();
82 auto cb = std::bind(&QemuInitiatorSignalSocket::event_cb,
this,
_1);
83 m_proxy.set_event_callback(
cb);
88 sc_core::sc_interface* iface;
92 init_qemu_to_sysc_gpio_proxy(
dev);
106 if (remote ==
nullptr) {
116 m_qemu_remote = remote;
A QEMU output GPIO exposed as a InitiatorSignalSocket<bool>
Definition qemu-initiator-signal-socket.h:40
void init_sbd(qemu::SysBusDevice sbd, int gpio_idx)
Initialize this socket with a QEMU SysBusDevice, and a GPIO index.
Definition qemu-initiator-signal-socket.h:173
void init_named(qemu::Device dev, const char *gpio_name, int gpio_idx)
Initialize this socket with a device, a GPIO namespace, and a GPIO index.
Definition qemu-initiator-signal-socket.h:155
void init(qemu::Device dev, int gpio_idx)
Initialize this socket with a device and a GPIO index.
Definition qemu-initiator-signal-socket.h:137
A QEMU input GPIO exposed as a TargetSignalSocket<bool>
Definition qemu-target-signal-socket.h:29
void notify()
Force a notification on the default event.
Definition qemu-target-signal-socket.h:94
qemu::Gpio get_gpio()
Returns the GPIO wrapped by this socket.
Definition qemu-target-signal-socket.h:89
Definition runonsysc.h:22
bool run_on_sysc(std::function< void()> job_entry, bool wait=true)
Run a job on the SystemC kernel thread.
Definition runonsysc.h:181
Definition libqemu-cxx.h:616
Definition libqemu-cxx.h:273
Definition libqemu-cxx.h:638