SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
i2c_slave_v2_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_I2C_SLAVE_V2_GASKET_ADAPTER_H
15#define SIMICS_SYSTEMC_SIMICS2TLM_I2C_SLAVE_V2_GASKET_ADAPTER_H
16
18
22
23#include <stdint.h>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace simics2tlm {
29
35 public GasketAdapter<iface::I2cSlaveV2Interface> {
36 public:
37 I2cSlaveV2GasketAdapter(I2cSlaveV2Interface *i2cslavev2,
39 : i2cslavev2_(i2cslavev2), simulation_(simulation) {
40 }
41 void start(uint8_t address) override {
42 Context context(simulation_);
43 i2cslavev2_->start(address);
44 }
45 void read() override {
46 Context context(simulation_);
47 i2cslavev2_->read();
48 }
49 void write(uint8_t value) override {
50 Context context(simulation_);
51 i2cslavev2_->write(value);
52 }
53 void stop() override {
54 Context context(simulation_);
55 i2cslavev2_->stop();
56 }
57 std::vector<uint8_t> addresses() override {
58 Context context(simulation_);
59 return i2cslavev2_->addresses();
60 }
62 return dynamic_cast<simics2tlm::GasketOwner *>(i2cslavev2_);
63 }
64
65 private:
66 I2cSlaveV2Interface *i2cslavev2_;
67 iface::SimulationInterface *simulation_;
68};
69
70} // namespace simics2tlm
71} // namespace systemc
72} // namespace simics
73
74#endif
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Definition: i2c_slave_v2_interface.h:24
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
Adapter for I2cSlaveV2 gasket.
Definition: i2c_slave_v2_gasket_adapter.h:35
void start(uint8_t address) override
Definition: i2c_slave_v2_gasket_adapter.h:41
simics2tlm::GasketOwner * gasket_owner() const override
Definition: i2c_slave_v2_gasket_adapter.h:61
void read() override
Definition: i2c_slave_v2_gasket_adapter.h:45
void stop() override
Definition: i2c_slave_v2_gasket_adapter.h:53
std::vector< uint8_t > addresses() override
Definition: i2c_slave_v2_gasket_adapter.h:57
void write(uint8_t value) override
Definition: i2c_slave_v2_gasket_adapter.h:49
I2cSlaveV2GasketAdapter(I2cSlaveV2Interface *i2cslavev2, iface::SimulationInterface *simulation)
Definition: i2c_slave_v2_gasket_adapter.h:37
Definition: adapter.h:79