SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
extension_receiver.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2015 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_EXTENSION_RECEIVER_H
17#define SIMICS_SYSTEMC_IFACE_EXTENSION_RECEIVER_H
18
19#include <tlm>
20
22
23namespace simics {
24namespace systemc {
25namespace iface {
26
35//:: pre ExtensionReceiver {{
36template<class TExtension, class TInterface>
38 public:
39 explicit ExtensionReceiver(TInterface *device)
40 : device_(device) {}
41 bool handle(tlm::tlm_generic_payload *payload) override {
42 TExtension *extension = payload->get_extension<TExtension>();
43 if (extension && extension->valid()) {
44 payload->set_response_status(tlm::TLM_OK_RESPONSE);
45 extension->method_call(device_);
46 return true;
47 }
48
49 return false;
50 }
51 bool probe(tlm::tlm_generic_payload *payload) override {
52 TExtension *extension = payload->get_extension<TExtension>();
53 return extension && extension->valid();
54 }
55
56 private:
57 TInterface *device_;
58};
59// }}
60
61} // namespace iface
62} // namespace systemc
63} // namespace simics
64
65#endif
Receiver of protocol specific extensions.
Definition: extension_receiver.h:37
bool handle(tlm::tlm_generic_payload *payload) override
Definition: extension_receiver.h:41
bool probe(tlm::tlm_generic_payload *payload) override
Definition: extension_receiver.h:51
ExtensionReceiver(TInterface *device)
Definition: extension_receiver.h:39
Interface implemented by the ExtensionReceiver class, used by the ExtensionDispatcher.
Definition: receiver_interface.h:29
Definition: pci_bus_interface.h:24