qualcomm/qbox
Loading...
Searching...
No Matches
QemuDevice Class Reference

QEMU device abstraction as a SystemC module. More...

#include <device.h>

Inheritance diagram for QemuDevice:
Collaboration diagram for QemuDevice:

Public Member Functions

void instantiate ()
void realize ()
void unrealize ()
 QemuDevice (const sc_core::sc_module_name &name, QemuInstance &inst, const char *qom_type)
 Construct a QEMU device.
 QemuDevice (const sc_core::sc_module_name &name, QemuInstance &inst, const char *qom_type, const char *id)
 Construct a QEMU device.
virtual void before_end_of_elaboration () override
virtual void end_of_elaboration () override
void set_qom_type (std::string const &qom_type)
const char * get_qom_type () const
const char * get_id () const
void set_id (const std::string &nm)
qemu::Device get_qemu_dev ()
QemuInstance & get_qemu_inst ()
void set_sysbus_as_parent_bus (void)
Public Member Functions inherited from QemuDeviceBaseIF
virtual bool can_run ()
 SCP_LOGGER ()

Protected Attributes

QemuInstance & m_inst
qemu::Device m_dev
bool m_instanciated = false
bool m_realized = false

Detailed Description

QEMU device abstraction as a SystemC module.

This class abstract a QEMU device as a SystemC module. It is constructed using the QEMU instance it will lie in, and the QOM type name corresponding to the device. This class is meant to be inherited from by children classes that implement a given device.

The elaboration flow is as follows:

  • At construct time, nothing happen on the QEMU side.
  • When before_end_of_elaboration is called, the QEMU object correponding to this component is created. Children classes should always call the parent method when overriding it. Usually, they start by calling it and then set the QEMU properties on the device.
  • When end_of_elaboration is called, the device is realized. No more property can be set (unless particular cases such as some link properties) and the device can now be connected to busses and GPIO.

Constructor & Destructor Documentation

◆ QemuDevice() [1/2]

QemuDevice::QemuDevice ( const sc_core::sc_module_name & name,
QemuInstance & inst,
const char * qom_type )
inline

Construct a QEMU device.

Parameters
[in]nameSystemC module name
[in]instQEMU instance the device will be created in
[in]qom_typeDevice QOM type name

◆ QemuDevice() [2/2]

QemuDevice::QemuDevice ( const sc_core::sc_module_name & name,
QemuInstance & inst,
const char * qom_type,
const char * id )
inline

Construct a QEMU device.

Parameters
[in]nameSystemC module name
[in]instQEMU instance the device will be created in
[in]qom_typeDevice QOM type name
[in]idDevice QOM id

Member Function Documentation

◆ end_of_elaboration()

virtual void QemuDevice::end_of_elaboration ( )
inlineoverridevirtual

Reimplemented in qemu_xhci::Device, and ufs::Device.


The documentation for this class was generated from the following file:
  • qemu-components/common/include/device.h