18class tlm_dmi_ex :
public tlm::tlm_dmi
21 enum dmi_type { dmi_mapped, dmi_nomap, dmi_valid, dmi_iommu } type;
22 sc_core::sc_module* module;
23 tlm_dmi_ex(sc_core::sc_module* m, tlm::tlm_dmi dmi, dmi_type t): module(m), tlm::tlm_dmi(dmi), type(t) {}
32class UnderlyingDMITlmExtension :
public tlm::tlm_extension<UnderlyingDMITlmExtension>,
33 public std::vector<gs::tlm_dmi_ex>
36 UnderlyingDMITlmExtension() =
default;
37 UnderlyingDMITlmExtension(
const UnderlyingDMITlmExtension&) =
default;
39 virtual tlm_extension_base* clone()
const override {
return new UnderlyingDMITlmExtension(*
this); }
41 virtual void copy_from(tlm_extension_base
const& ext)
override
43 const UnderlyingDMITlmExtension& other =
static_cast<const UnderlyingDMITlmExtension&
>(ext);
46 void add_dmi(sc_core::sc_module* m, tlm::tlm_dmi dmi, tlm_dmi_ex::dmi_type type)
51 bool has_dmi(tlm_dmi_ex::dmi_type type)
53 for (
auto d = begin(); d != end(); d++) {
54 if (d->type == type)
return true;
58 tlm::tlm_dmi& get_first(tlm_dmi_ex::dmi_type type)
60 for (
auto d = begin(); d != end(); d++) {
61 if (d->type == type)
return *d;
63 SCP_FATAL(
"UnderlyingDMITlmExtension")(
"No iommu DMI data found\n");
64 __builtin_unreachable();
66 tlm::tlm_dmi& get_last(tlm_dmi_ex::dmi_type type)
68 for (
auto d = rbegin(); d != rend(); d++) {
69 if (d->type == type)
return *d;
71 SCP_FATAL(
"UnderlyingDMITlmExtension")(
"No iommu DMI data found\n");
72 __builtin_unreachable();