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// -*- 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_EXTENSION_MAP_INFO_PARSER_H
17#define SIMICS_SYSTEMC_INJECTION_EXTENSION_MAP_INFO_PARSER_H
18
19#include <simics/base/types.h>
20
22
23#include <string>
24
25namespace simics {
26namespace systemc {
27namespace injection {
28namespace extension {
29
32 public:
33 virtual std::string prefix() {return "";}
34 virtual bool parse(AttrDictParser *parser, const std::string &key,
35 attr_value_t *attr) {
36 uint64_t addr = 0;
37 if (key == "base") {
38 if (!parser->value(&addr))
39 return false;
40
41 map_info_.base = addr;
42 } else if (key == "start") {
43 if (!parser->value(&addr))
44 return false;
45
46 map_info_.start = addr;
47 } else if (key == "length") {
48 if (!parser->value(&addr))
49 return false;
50
51 map_info_.length = addr;
52 } else if (key == "function") {
53 int64_t function = 0;
54 if (!parser->value(&function))
55 return false;
56
57 map_info_.function = function;
58 } else {
59 return false;
60 }
61
62 return true;
63 }
65};
66
67} // namespace extension
68} // namespace injection
69} // namespace systemc
70} // namespace simics
71
72#endif
Definition: attr_dict_parser.h:40
bool value(T *v)
Definition: attr_dict_parser.h:66
virtual bool parse(AttrDictParser *parser, const std::string &key, attr_value_t *attr)
Definition: map_info_parser.h:34
virtual std::string prefix()
Definition: map_info_parser.h:33
types::map_info_t map_info_
Definition: map_info_parser.h:64
Definition: pci_bus_interface.h:24
Reduced, stand-alone, version of the Simics map_info_t struct.
Definition: map_info.h:25
physical_address_t start
Definition: map_info.h:28
int function
Definition: map_info.h:30
physical_address_t length
Definition: map_info.h:29
physical_address_t base
Definition: map_info.h:27