quic/qbox
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QemuInitiatorSignalSocket Class Reference

A QEMU output GPIO exposed as a InitiatorSignalSocket<bool> More...

#include <qemu-initiator-signal-socket.h>

Inheritance diagram for QemuInitiatorSignalSocket:
Inheritance graph
[legend]
Collaboration diagram for QemuInitiatorSignalSocket:
Collaboration graph
[legend]

Public Member Functions

 QemuInitiatorSignalSocket (const char *name)
 
void init (qemu::Device dev, int gpio_idx)
 Initialize this socket with a device and a GPIO index.
 
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.
 
void init_sbd (qemu::SysBusDevice sbd, int gpio_idx)
 Initialize this socket with a QEMU SysBusDevice, and a GPIO index.
 

Protected Member Functions

void event_cb (bool val)
 
void init_qemu_to_sysc_gpio_proxy (qemu::Device &dev)
 
void init_internal (qemu::Device &dev)
 

Protected Attributes

qemu::Gpio m_proxy
 
gs::runonsysc m_on_sysc
 
QemuTargetSignalSocketm_qemu_remote = nullptr
 

Detailed Description

A QEMU output GPIO exposed as a InitiatorSignalSocket<bool>

This class exposes an output GPIO of a QEMU device as a InitiatorSignalSocket<bool>. It can be connected to an sc_core::sc_port<bool> or a TargetSignalSocket<bool>. Modifications to the interal QEMU GPIO will be propagated through the socket.

If this socket happens to be connected to a QemuTargetSignalSocket, the propagation is done directly within QEMU and do not go through the SystemC kernel. Note that this is only true if the GPIOs wrapped by both this socket and the remote socket lie in the same QEMU instance.

Member Function Documentation

◆ init()

void QemuInitiatorSignalSocket::init ( qemu::Device  dev,
int  gpio_idx 
)
inline

Initialize this socket with a device and a GPIO index.

This method initializes the socket using the given QEMU device and the corresponding GPIO index in this device. See the QEMU API and the device you want to wrap to know what index to use here.

Parameters
[in]devThe QEMU device
[in]gpio_idxThe GPIO index within the device

◆ init_named()

void QemuInitiatorSignalSocket::init_named ( qemu::Device  dev,
const char gpio_name,
int  gpio_idx 
)
inline

Initialize this socket with a device, a GPIO namespace, and a GPIO index.

This method initializes the socket using the given QEMU device and the corresponding GPIO (namespace, index) pair in this device. See the QEMU API and the device you want to wrap to know what namespace/index to use here.

Parameters
[in]devThe QEMU device
[in]gpio_nameThe GPIO namespace within the device
[in]gpio_idxThe GPIO index within the device

◆ init_sbd()

void QemuInitiatorSignalSocket::init_sbd ( qemu::SysBusDevice  sbd,
int  gpio_idx 
)
inline

Initialize this socket with a QEMU SysBusDevice, and a GPIO index.

This method initializes the socket using the given QEMU SysBusDevice (SBD) and the corresponding GPIO index) in this SBD. See the QEMU API and the SBD you want to wrap to know what index to use here. This is only for "sysbus_irq", if you want to wrap a normal gpio, just use init or init_named.

Parameters
[in]sbdThe QEMU SysBusDevice
[in]gpio_idxThe GPIO index within the SBD

The documentation for this class was generated from the following file: