SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
pci_bus.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2013 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_TLM2SIMICS_PCI_BUS_H
17#define SIMICS_SYSTEMC_TLM2SIMICS_PCI_BUS_H
18
26
27namespace simics {
28namespace systemc {
29namespace tlm2simics {
30
36 public:
37 PciBus() : InterfaceProvider("pci_bus"),
39 iface::PciBusExtension::createIgnoreReceiver(),
40 &dmi_interface_provider_),
41 dmi_interface_provider_("memory_space"),
42 device_(NULL),
43 payload_(NULL),
44 upstream_provider_("pci_upstream_operation") {
46 dispatcher_.subscribe(
48 }
49
50 // Special handling of DMI support
51 bool get_direct_mem_ptr(ConfObjectRef &simics_obj,
52 tlm::tlm_generic_payload &trans,
53 tlm::tlm_dmi& dmi_data) override;
54
55 // PciBusInterface
56 void raise_interrupt(int pin) override;
57 void lower_interrupt(int pin) override;
58 int interrupt_acknowledge() override;
60 int remove_map(types::addr_space_t space, int function) override;
61 void set_bus_number(int bus_id) override;
62 void set_sub_bus_number(int bus_id) override;
64 types::map_info_t info) override;
65 void remove_default(types::addr_space_t space) override;
66 void bus_reset() override;
67 void special_cycle(uint32_t value) override;
68 void system_error() override;
69 int get_bus_address() override;
70 void set_device_status(int device, int function, int enabled) override;
71
72 // PciUpstreamOperationInterface
74 types::addr_space_t space) override;
76 types::addr_space_t space) override;
77
78 // The pci-bus gasket wraps pci_upstream interface too
79 void set_target(const ConfObjectRef &obj) override {
81 upstream_provider_.set_target(obj);
82 }
83 void set_device(conf_object_t *device) {
84 device_ = device;
85 }
86 // TransactionHandler
88
89 private:
90 tlm::tlm_response_status simics_transaction(
91 ConfObjectRef &simics_obj,
92 tlm::tlm_generic_payload *trans) override;
93 InterfaceProvider dmi_interface_provider_;
94 conf_object_t *device_;
95 tlm::tlm_generic_payload *payload_;
97 InterfaceProvider upstream_provider_;
98};
99
100} // namespace tlm2simics
101} // namespace systemc
102} // namespace simics
103
104#endif
Returns the interface provided by the associated Simics object.
Definition: interface_provider.h:32
virtual void set_target(const ConfObjectRef &obj)
Definition: interface_provider.h:58
Utility class that can unmarshal a Simics interface embedded as an Extension in the tlm::tlm_generic_...
Definition: extension_dispatcher.h:33
void subscribe(ReceiverInterface *receiver)
Definition: extension_dispatcher.h:35
static ReceiverInterface * createReceiver(PciBusInterface *device)
Definition: extension.h:105
Simics SystemC pci_bus interface.
Definition: pci_bus_interface.h:28
Simics SystemC pci_upstream_operation interface.
Definition: pci_upstream_operation_interface.h:28
Interface implemented by the ExtensionReceiver class, used by the ExtensionDispatcher.
Definition: receiver_interface.h:29
Base class for transaction handlers that support DMI.
Definition: dmi_transaction_handler.h:32
Protocol specific transaction handler for Simics pci_bus interface.
Definition: pci_bus.h:35
void remove_default(types::addr_space_t space) override
int remove_map(types::addr_space_t space, int function) override
void set_device_status(int device, int function, int enabled) override
int add_map(types::addr_space_t space, types::map_info_t info) override
iface::ReceiverInterface * receiver() override
void set_bus_number(int bus_id) override
void lower_interrupt(int pin) override
void set_target(const ConfObjectRef &obj) override
Definition: pci_bus.h:79
PciBus()
Definition: pci_bus.h:37
void add_default(types::addr_space_t space, types::map_info_t info) override
void set_sub_bus_number(int bus_id) override
bool get_direct_mem_ptr(ConfObjectRef &simics_obj, tlm::tlm_generic_payload &trans, tlm::tlm_dmi &dmi_data) override
types::pci_bus_exception_type_t write(uint16_t rid, types::addr_space_t space) override
void special_cycle(uint32_t value) override
void set_device(conf_object_t *device)
Definition: pci_bus.h:83
void raise_interrupt(int pin) override
types::pci_bus_exception_type_t read(uint16_t rid, types::addr_space_t space) override
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
Reduced, stand-alone, version of the Simics map_info_t struct.
Definition: map_info.h:25