9#ifndef _LIBQBOX_COMPONENTS_DEVICE_H
10#define _LIBQBOX_COMPONENTS_DEVICE_H
14#include "qemu-instance.h"
39 std::string m_qom_type;
45 bool m_instanciated =
false;
46 bool m_realized =
false;
55 m_dev = m_inst.
get().object_new(m_qom_type.c_str(), m_id.c_str());
56 m_instanciated =
true;
65 m_dev.set_prop_bool(
"realized",
true);
77 : sc_module(name), m_qom_type(
qom_type), m_inst(inst)
91 : sc_module(name), m_qom_type(
qom_type), m_inst(inst), m_id(id)
98 virtual void before_end_of_elaboration()
override { instantiate(); }
100 virtual void end_of_elaboration()
override { realize(); }
104 const char* get_qom_type()
const {
return m_qom_type.c_str(); }
106 const char* get_id()
const {
return m_id.c_str(); }
112 void set_sysbus_as_parent_bus(
void) { m_dev.set_parent_bus(m_inst.
get().sysbus_get_default()); }
Definition qemu-instance.h:33
QEMU device abstraction as a SystemC module.
Definition device.h:37
QemuDevice(const sc_core::sc_module_name &name, QemuInstance &inst, const char *qom_type, const char *id)
Construct a QEMU device.
Definition device.h:90
QemuDevice(const sc_core::sc_module_name &name, QemuInstance &inst, const char *qom_type)
Construct a QEMU device.
Definition device.h:76
This class encapsulates a libqemu-cxx qemu::LibQemu instance. It handles QEMU parameters and instance...
Definition qemu-instance.h:89
qemu::LibQemu & get()
Returns the underlying qemu::LibQemu instance.
Definition qemu-instance.h:461
Definition libqemu-cxx.h:616