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/*
2 © 2014 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_SIMICS2TLM_SERIAL_DEVICE_GASKET_ADAPTER_H
15#define SIMICS_SYSTEMC_SIMICS2TLM_SERIAL_DEVICE_GASKET_ADAPTER_H
16
21
22namespace simics {
23namespace systemc {
24namespace simics2tlm {
25
26//:: pre SerialDeviceGasketAdapter {{
29 public GasketAdapter<iface::SerialDeviceInterface> {
30 public:
31 SerialDeviceGasketAdapter(SerialDeviceInterface *serial_device,
33 : serial_device_(serial_device), simulation_(simulation) {
34 }
35 int write(int value) override {
36 Context context(simulation_);
37 return serial_device_->write(value);
38 }
39 void receive_ready() override {
40 Context context(simulation_);
41 serial_device_->receive_ready();
42 }
44 return dynamic_cast<simics2tlm::GasketOwner *>(serial_device_);
45 }
46
47 private:
48 SerialDeviceInterface *serial_device_;
49 iface::SimulationInterface *simulation_;
50};
51// }}
52
53} // namespace simics2tlm
54} // namespace systemc
55} // namespace simics
56
57#endif
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Definition: serial_device_interface.h:22
Interface to the SystemC simulation.
Definition: simulation_interface.h:25
Definition: gasket_adapter.h:43
Base class, responsible for handling a gasket.
Definition: gasket_owner.h:30
Definition: serial_device_gasket_adapter.h:29
simics2tlm::GasketOwner * gasket_owner() const override
Definition: serial_device_gasket_adapter.h:43
SerialDeviceGasketAdapter(SerialDeviceInterface *serial_device, iface::SimulationInterface *simulation)
Definition: serial_device_gasket_adapter.h:31
void receive_ready() override
Definition: serial_device_gasket_adapter.h:39
int write(int value) override
Definition: serial_device_gasket_adapter.h:35
Definition: adapter.h:79