SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
pci_upstream_operation_extension.h
Go to the documentation of this file.
1/*
2 © 2016 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_IFACE_PCI_UPSTREAM_OPERATION_EXTENSION_H
15#define SIMICS_SYSTEMC_IFACE_PCI_UPSTREAM_OPERATION_EXTENSION_H
16
19
20namespace simics {
21namespace systemc {
22namespace iface {
23
27 : public Extension<PciUpstreamOperationExtension,
28 PciUpstreamOperationInterface> {
29 public:
30 void call(PciUpstreamOperationInterface *device) override {
31 switch (method_.value<Method>()) {
32 case READ:
33 method_return_ = device->read(
34 method_input_[0].value<uint16_t>(),
35 method_input_[1].value<types::addr_space_t>());
36 break;
37 case WRITE:
38 method_return_ = device->write(
39 method_input_[0].value<uint16_t>(),
40 method_input_[1].value<types::addr_space_t>());
41 break;
42 }
43 }
44
46 types::addr_space_t space) override {
47 method_ = READ;
48 method_input_.push_back(rid);
49 method_input_.push_back(space);
50 send();
52 }
54 types::addr_space_t space) override {
55 method_ = WRITE;
56 method_input_.push_back(rid);
57 method_input_.push_back(space);
58 send();
60 }
61
62 private:
63 enum Method {
64 READ,
65 WRITE
66 };
67};
68
69} // namespace iface
70} // namespace systemc
71} // namespace simics
72
73#endif
Base class for TLM2 extension, responsible for marshal/unmarshal of a Simics interface.
Definition: extension.h:38
Extension for Simics pci_upstream_operation interface.
Definition: pci_upstream_operation_extension.h:28
types::pci_bus_exception_type_t read(uint16_t rid, types::addr_space_t space) override
Definition: pci_upstream_operation_extension.h:45
void call(PciUpstreamOperationInterface *device) override
Definition: pci_upstream_operation_extension.h:30
types::pci_bus_exception_type_t write(uint16_t rid, types::addr_space_t space) override
Definition: pci_upstream_operation_extension.h:53
Simics SystemC pci_upstream_operation interface.
Definition: pci_upstream_operation_interface.h:26
virtual types::pci_bus_exception_type_t read(uint16_t rid, types::addr_space_t space)=0
virtual types::pci_bus_exception_type_t write(uint16_t rid, types::addr_space_t space)=0
T value()
Definition: any_type.h:87
pci_bus_exception_type_t
Reduced, stand-alone, version of the Simics exception_type_t enum.
Definition: pci_bus_exception_type.h:21
addr_space_t
Stand-alone, version of the Simics addr_space_t enum.
Definition: addr_space.h:21
Definition: adapter.h:79