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/*
2 © 2013 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_TLM2SIMICS_PCI_BUS_H
15#define SIMICS_SYSTEMC_TLM2SIMICS_PCI_BUS_H
16
24
25namespace simics {
26namespace systemc {
27namespace tlm2simics {
28
34 public:
35 PciBus() : InterfaceProvider("pci_bus"),
37 iface::PciBusExtension::createIgnoreReceiver(),
38 &dmi_interface_provider_),
39 dmi_interface_provider_("memory_space"),
40 device_(NULL),
41 payload_(NULL),
42 upstream_provider_("pci_upstream_operation") {
44 dispatcher_.subscribe(
46 }
47
48 // Special handling of DMI support
49 bool get_direct_mem_ptr(ConfObjectRef &simics_obj,
50 tlm::tlm_generic_payload &trans,
51 tlm::tlm_dmi& dmi_data) override;
52
53 // PciBusInterface
54 void raise_interrupt(int pin) override;
55 void lower_interrupt(int pin) override;
56 int interrupt_acknowledge() override;
58 int remove_map(types::addr_space_t space, int function) override;
59 void set_bus_number(int bus_id) override;
60 void set_sub_bus_number(int bus_id) override;
62 types::map_info_t info) override;
63 void remove_default(types::addr_space_t space) override;
64 void bus_reset() override;
65 void special_cycle(uint32_t value) override;
66 void system_error() override;
67 int get_bus_address() override;
68 void set_device_status(int device, int function, int enabled) override;
69
70 // PciUpstreamOperationInterface
72 types::addr_space_t space) override;
74 types::addr_space_t space) override;
75
76 // The pci-bus gasket wraps pci_upstream interface too
77 void set_target(const ConfObjectRef &obj) override {
79 upstream_provider_.set_target(obj);
80 }
81 void set_device(conf_object_t *device) {
82 device_ = device;
83 }
84 // TransactionHandler
86
87 private:
88 tlm::tlm_response_status simics_transaction(
89 ConfObjectRef &simics_obj,
90 tlm::tlm_generic_payload *trans) override;
91 InterfaceProvider dmi_interface_provider_;
92 conf_object_t *device_;
93 tlm::tlm_generic_payload *payload_;
95 InterfaceProvider upstream_provider_;
96};
97
98} // namespace tlm2simics
99} // namespace systemc
100} // namespace simics
101
102#endif
Returns the interface provided by the associated Simics object.
Definition: interface_provider.h:30
virtual void set_target(const ConfObjectRef &obj)
Definition: interface_provider.h:56
Utility class that can unmarshal a Simics interface embedded as an Extension in the tlm::tlm_generic_...
Definition: extension_dispatcher.h:31
void subscribe(ReceiverInterface *receiver)
Definition: extension_dispatcher.h:33
static ReceiverInterface * createReceiver(PciBusInterface *device)
Definition: extension.h:103
Simics SystemC pci_bus interface.
Definition: pci_bus_interface.h:26
Simics SystemC pci_upstream_operation interface.
Definition: pci_upstream_operation_interface.h:26
Interface implemented by the ExtensionReceiver class, used by the ExtensionDispatcher.
Definition: receiver_interface.h:27
Base class for transaction handlers that support DMI.
Definition: dmi_transaction_handler.h:30
Protocol specific transaction handler for Simics pci_bus interface.
Definition: pci_bus.h:33
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:77
PciBus()
Definition: pci_bus.h:35
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:81
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:21
addr_space_t
Stand-alone, version of the Simics addr_space_t enum.
Definition: addr_space.h:21
Definition: adapter.h:79
Reduced, stand-alone, version of the Simics map_info_t struct.
Definition: map_info.h:23