SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
serial_device_gasket_adapter.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2014 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_SERIAL_DEVICE_GASKET_ADAPTER_H
17#define SIMICS_SYSTEMC_SIMICS2TLM_SERIAL_DEVICE_GASKET_ADAPTER_H
18
23
24namespace simics {
25namespace systemc {
26namespace simics2tlm {
27
28//:: pre SerialDeviceGasketAdapter {{
31 public GasketAdapter<iface::SerialDeviceInterface> {
32 public:
33 SerialDeviceGasketAdapter(SerialDeviceInterface *serial_device,
35 : serial_device_(serial_device), simulation_(simulation) {
36 }
37 int write(int value) override {
38 Context context(simulation_);
39 return serial_device_->write(value);
40 }
41 void receive_ready() override {
42 Context context(simulation_);
43 serial_device_->receive_ready();
44 }
46 return dynamic_cast<simics2tlm::GasketOwner *>(serial_device_);
47 }
48
49 private:
50 SerialDeviceInterface *serial_device_;
51 iface::SimulationInterface *simulation_;
52};
53// }}
54
55} // namespace simics2tlm
56} // namespace systemc
57} // namespace simics
58
59#endif
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Definition: serial_device_interface.h:24
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: serial_device_gasket_adapter.h:31
simics2tlm::GasketOwner * gasket_owner() const override
Definition: serial_device_gasket_adapter.h:45
SerialDeviceGasketAdapter(SerialDeviceInterface *serial_device, iface::SimulationInterface *simulation)
Definition: serial_device_gasket_adapter.h:33
void receive_ready() override
Definition: serial_device_gasket_adapter.h:41
int write(int value) override
Definition: serial_device_gasket_adapter.h:37
Definition: pci_bus_interface.h:24