SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
map_info_parser.h
Go to the documentation of this file.
1/*
2 © 2017 Intel Corporation
3
4 This software and the related documents are Intel copyrighted materials, and
5 your use of them is governed by the express license under which they were
6 provided to you ("License"). Unless the License provides otherwise, you may
7 not use, modify, copy, publish, distribute, disclose or transmit this software
8 or the related documents without Intel's prior written permission.
9
10 This software and the related documents are provided as is, with no express or
11 implied warranties, other than those that are expressly stated in the License.
12*/
13
14#ifndef SIMICS_SYSTEMC_INJECTION_EXTENSION_MAP_INFO_PARSER_H
15#define SIMICS_SYSTEMC_INJECTION_EXTENSION_MAP_INFO_PARSER_H
16
17#include <simics/base/types.h>
18
20
21#include <string>
22
23namespace simics {
24namespace systemc {
25namespace injection {
26namespace extension {
27
30 public:
31 std::string prefix() override {return "";}
32 bool parse(AttrDictParser *parser, const std::string &key,
33 attr_value_t *attr) override {
34 uint64_t addr = 0;
35 if (key == "base") {
36 if (!parser->value(&addr))
37 return false;
38
39 map_info_.base = addr;
40 } else if (key == "start") {
41 if (!parser->value(&addr))
42 return false;
43
44 map_info_.start = addr;
45 } else if (key == "length") {
46 if (!parser->value(&addr))
47 return false;
48
49 map_info_.length = addr;
50 } else if (key == "function") {
51 int64_t function = 0;
52 if (!parser->value(&function))
53 return false;
54
55 map_info_.function = function;
56 } else {
57 return false;
58 }
59
60 return true;
61 }
63};
64
65} // namespace extension
66} // namespace injection
67} // namespace systemc
68} // namespace simics
69
70#endif
Definition: attr_dict_parser.h:38
bool value(T *v)
Definition: attr_dict_parser.h:64
std::string prefix() override
Definition: map_info_parser.h:31
bool parse(AttrDictParser *parser, const std::string &key, attr_value_t *attr) override
Definition: map_info_parser.h:32
types::map_info_t map_info_
Definition: map_info_parser.h:62
Definition: adapter.h:79
Reduced, stand-alone, version of the Simics map_info_t struct.
Definition: map_info.h:23
physical_address_t start
Definition: map_info.h:26
int function
Definition: map_info.h:28
physical_address_t length
Definition: map_info.h:27
physical_address_t base
Definition: map_info.h:25