SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
i2c_master_v2_gasket_adapter.h
Go to the documentation of this file.
1/*
2 © 2018 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_MASTER_V2_GASKET_ADAPTER_H
15#define SIMICS_SYSTEMC_SIMICS2TLM_I2C_MASTER_V2_GASKET_ADAPTER_H
16
18
22
23#include <stdint.h>
24
25namespace simics {
26namespace systemc {
27namespace simics2tlm {
28
34 public GasketAdapter<iface::I2cMasterV2Interface> {
35 public:
36 I2cMasterV2GasketAdapter(I2cMasterV2Interface *i2cmasterv2,
38 : i2cmasterv2_(i2cmasterv2), simulation_(simulation) {
39 }
40 void acknowledge(types::i2c_ack_t ack) override {
41 Context context(simulation_);
42 i2cmasterv2_->acknowledge(ack);
43 }
44 void read_response(uint8_t value) override {
45 Context context(simulation_);
46 i2cmasterv2_->read_response(value);
47 }
49 return dynamic_cast<simics2tlm::GasketOwner *>(i2cmasterv2_);
50 }
51
52 private:
53 I2cMasterV2Interface* i2cmasterv2_;
54 iface::SimulationInterface *simulation_;
55};
56
57} // namespace simics2tlm
58} // namespace systemc
59} // namespace simics
60
61#endif
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Simics i2c_master_v2 interface.
Definition: i2c_master_v2_interface.h:25
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 I2cMasterV2 gasket.
Definition: i2c_master_v2_gasket_adapter.h:34
simics2tlm::GasketOwner * gasket_owner() const override
Definition: i2c_master_v2_gasket_adapter.h:48
void read_response(uint8_t value) override
Definition: i2c_master_v2_gasket_adapter.h:44
I2cMasterV2GasketAdapter(I2cMasterV2Interface *i2cmasterv2, iface::SimulationInterface *simulation)
Definition: i2c_master_v2_gasket_adapter.h:36
void acknowledge(types::i2c_ack_t ack) override
Definition: i2c_master_v2_gasket_adapter.h:40
i2c_ack_t
Definition: i2c_ack.h:20
Definition: adapter.h:79