SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
attr_dmi.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2017 Intel Corporation
5
6 This software and the related documents are Intel copyrighted materials, and
7 your use of them is governed by the express license under which they were
8 provided to you ("License"). Unless the License provides otherwise, you may
9 not use, modify, copy, publish, distribute, disclose or transmit this software
10 or the related documents without Intel's prior written permission.
11
12 This software and the related documents are provided as is, with no express or
13 implied warranties, other than those that are expressly stated in the License.
14*/
15
16#ifndef SIMICS_SYSTEMC_INJECTION_ATTR_DMI_H
17#define SIMICS_SYSTEMC_INJECTION_ATTR_DMI_H
18
19
20
22
23#include <tlm>
24
25#include <string>
26
27namespace simics {
28namespace systemc {
29namespace injection {
30
33 public:
34 explicit AttrDmi(tlm::tlm_dmi *dmi) : dmi_(dmi) {}
36
37 virtual bool parse(AttrDictParser *parser, const std::string &key,
38 attr_value_t *attr) {
39 if (key == "dmi_ptr") {
40 uint64_t v;
41 if (!parser->value(&v))
42 return false;
43
44 dmi_->set_dmi_ptr(reinterpret_cast<unsigned char*> (v));
45 } else if (key == "start_address") {
46 uint64_t v;
47 if (!parser->value(&v))
48 return false;
49
50 dmi_->set_start_address(v);
51 } else if (key == "end_address") {
52 uint64_t v;
53 if (!parser->value(&v))
54 return false;
55
56 dmi_->set_end_address(v);
57 } else if (key == "read_latency") {
58 uint64_t v;
59 if (!parser->value(&v))
60 return false;
61
62 dmi_->set_read_latency(sc_core::sc_time::from_value(v));
63 } else if (key == "write_latency") {
64 uint64_t v;
65 if (!parser->value(&v))
66 return false;
67
68 dmi_->set_write_latency(sc_core::sc_time::from_value(v));
69 } else if (key == "granted_access") {
70 uint64_t v;
71 if (!parser->value(&v))
72 return false;
73
74 dmi_->set_granted_access(static_cast<tlm::tlm_dmi::dmi_access_e>(
75 v));
76 } else {
77 return false;
78 }
79
80 return true;
81 }
82
83 private:
84 tlm::tlm_dmi *dmi_;
85};
86
87} // namespace injection
88} // namespace systemc
89} // namespace simics
90
91#endif
#define ATTR_DICT_PARSER_NAMESPACE(ns)
Definition: attr_dict_parser.h:34
Definition: attr_dict_parser.h:40
Definition: attr_dmi.h:32
AttrDmi(tlm::tlm_dmi *dmi)
Definition: attr_dmi.h:34
virtual bool parse(AttrDictParser *parser, const std::string &key, attr_value_t *attr)
Definition: attr_dmi.h:37
Definition: pci_bus_interface.h:24