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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2016 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_IFACE_PCI_UPSTREAM_OPERATION_EXTENSION_H
17#define SIMICS_SYSTEMC_IFACE_PCI_UPSTREAM_OPERATION_EXTENSION_H
18
21
22namespace simics {
23namespace systemc {
24namespace iface {
25
29 : public Extension<PciUpstreamOperationExtension,
30 PciUpstreamOperationInterface> {
31 public:
32 virtual void call(PciUpstreamOperationInterface *device) {
33 switch (method_.value<Method>()) {
34 case READ:
35 method_return_ = device->read(
36 method_input_[0].value<uint16_t>(),
37 method_input_[1].value<types::addr_space_t>());
38 break;
39 case WRITE:
40 method_return_ = device->write(
41 method_input_[0].value<uint16_t>(),
42 method_input_[1].value<types::addr_space_t>());
43 break;
44 }
45 }
46
48 types::addr_space_t space) {
49 method_ = READ;
50 method_input_.push_back(rid);
51 method_input_.push_back(space);
52 send();
54 }
56 types::addr_space_t space) {
57 method_ = WRITE;
58 method_input_.push_back(rid);
59 method_input_.push_back(space);
60 send();
62 }
63
64 private:
65 enum Method {
66 READ,
67 WRITE
68 };
69};
70
71} // namespace iface
72} // namespace systemc
73} // namespace simics
74
75#endif
Base class for TLM2 extension, responsible for marshal/unmarshal of a Simics interface.
Definition: extension.h:40
Extension for Simics pci_upstream_operation interface.
Definition: pci_upstream_operation_extension.h:30
virtual types::pci_bus_exception_type_t write(uint16_t rid, types::addr_space_t space)
Definition: pci_upstream_operation_extension.h:55
virtual void call(PciUpstreamOperationInterface *device)
Definition: pci_upstream_operation_extension.h:32
virtual types::pci_bus_exception_type_t read(uint16_t rid, types::addr_space_t space)
Definition: pci_upstream_operation_extension.h:47
Simics SystemC pci_upstream_operation interface.
Definition: pci_upstream_operation_interface.h:28
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:84
pci_bus_exception_type_t
Reduced, stand-alone, version of the Simics exception_type_t enum.
Definition: pci_bus_exception_type.h:23
addr_space_t
Stand-alone, version of the Simics addr_space_t enum.
Definition: addr_space.h:23
Definition: pci_bus_interface.h:24