SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
inject_pci_device.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_INJECT_PCI_DEVICE_H
15#define SIMICS_SYSTEMC_INJECTION_EXTENSION_INJECT_PCI_DEVICE_H
16
17
18
22
23#include <string>
24
25namespace simics {
26namespace systemc {
27namespace injection {
28namespace extension {
29
31template <typename TPAYLOAD>
32class InjectPciDevice : public InjectBase<TPAYLOAD> {
33 public:
34 ATTR_DICT_PARSER_NAMESPACE("pci_device.")
35
36 bool setValue(AttrDictParser *parser, const std::string &key,
37 attr_value_t *attr, TPAYLOAD *gp) override {
38 if (key == "bus_reset") {
40 ->bus_reset();
41 return true;
42 } else if (key == "system_error") {
44 ->system_error();
45 return true;
46 } else if (key == "interrupt_raised") {
47 int pin = 0;
48 if (!parser->value(&pin))
49 return false;
50
52 ->interrupt_raised(pin);
53 return true;
54 } else if (key == "interrupt_lowered") {
55 int pin = 0;
56 if (!parser->value(&pin))
57 return false;
58
60 ->interrupt_lowered(pin);
61 return true;
62 }
63
64 return false;
65 }
66};
67
68} // namespace extension
69} // namespace injection
70} // namespace systemc
71} // namespace simics
72
73#endif
#define ATTR_DICT_PARSER_NAMESPACE(ns)
Definition: attr_dict_parser.h:32
Definition: attr_dict_parser.h:38
Definition: inject_base.h:43
bool setValue(AttrDictParser *parser, const std::string &key, attr_value_t *attr, TPAYLOAD *gp) override
Definition: inject_pci_device.h:36
Definition: adapter.h:79