SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
packet_gasket_adapter.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2018 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_SIMICS2TLM_PACKET_GASKET_ADAPTER_H
17#define SIMICS_SYSTEMC_SIMICS2TLM_PACKET_GASKET_ADAPTER_H
18
23
24namespace simics {
25namespace systemc {
26namespace simics2tlm {
27
30 public GasketAdapter<iface::PacketInterface> {
31 public:
32 PacketGasketAdapter(PacketInterface *packet,
34 : packet_(packet), simulation_(simulation) {
35 }
36 virtual void transfer(const uint8 *data_ptr, size_t data_length) {
37 Context context(simulation_);
38 packet_->transfer(data_ptr, data_length);
39 }
41 return dynamic_cast<simics2tlm::GasketOwner *>(packet_);
42 }
43
44 private:
45 PacketInterface* packet_;
46 iface::SimulationInterface *simulation_;
47};
48
49} // namespace simics2tlm
50} // namespace systemc
51} // namespace simics
52
53#endif
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Simics packet interface.
Definition: packet_interface.h:26
Interface to the SystemC simulation.
Definition: simulation_interface.h:27
Definition: gasket_adapter.h:45
Base class, responsible for handling a gasket.
Definition: gasket_owner.h:32
Definition: packet_gasket_adapter.h:30
PacketGasketAdapter(PacketInterface *packet, iface::SimulationInterface *simulation)
Definition: packet_gasket_adapter.h:32
virtual void transfer(const uint8 *data_ptr, size_t data_length)
Definition: packet_gasket_adapter.h:36
simics2tlm::GasketOwner * gasket_owner() const override
Definition: packet_gasket_adapter.h:40
Definition: pci_bus_interface.h:24