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);
75 m_dev.set_prop_bool(
"realized",
false);
87 : sc_module(name), m_qom_type(qom_type), m_inst(inst)
89 SCP_WARN(())(
"QOM Device creation {}", qom_type);
101 : sc_module(name), m_qom_type(qom_type), m_inst(inst), m_id(id)
103 SCP_WARN(())(
"QOM Device creation {} with id: {}", qom_type, id);
108 virtual void before_end_of_elaboration()
override { instantiate(); }
110 virtual void end_of_elaboration()
override { realize(); }
112 void set_qom_type(std::string
const& qom_type) { m_qom_type = qom_type; }
114 const char* get_qom_type()
const {
return m_qom_type.c_str(); }
116 const char* get_id()
const {
return m_id.c_str(); }
118 void set_id(
const std::string& nm) { m_id = nm; }
120 qemu::Device get_qemu_dev() {
return m_dev; }
122 QemuInstance& get_qemu_inst() {
return m_inst; }
124 void set_sysbus_as_parent_bus(
void) { m_dev.set_parent_bus(m_inst.get().sysbus_get_default()); }
Definition qemu-instance.h:36
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:100
QemuDevice(const sc_core::sc_module_name &name, QemuInstance &inst, const char *qom_type)
Construct a QEMU device.
Definition device.h:86
This class encapsulates a libqemu-cxx qemu::LibQemu instance. It handles QEMU parameters and instance...
Definition qemu-instance.h:89
Definition libqemu-cxx.h:675