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// -*- 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_I2C_MASTER_V2_GASKET_ADAPTER_H
17#define SIMICS_SYSTEMC_SIMICS2TLM_I2C_MASTER_V2_GASKET_ADAPTER_H
18
20
24
25#include <stdint.h>
26
27namespace simics {
28namespace systemc {
29namespace simics2tlm {
30
36 public GasketAdapter<iface::I2cMasterV2Interface> {
37 public:
38 I2cMasterV2GasketAdapter(I2cMasterV2Interface *i2cmasterv2,
40 : i2cmasterv2_(i2cmasterv2), simulation_(simulation) {
41 }
42 void acknowledge(types::i2c_ack_t ack) override {
43 Context context(simulation_);
44 i2cmasterv2_->acknowledge(ack);
45 }
46 void read_response(uint8_t value) override {
47 Context context(simulation_);
48 i2cmasterv2_->read_response(value);
49 }
51 return dynamic_cast<simics2tlm::GasketOwner *>(i2cmasterv2_);
52 }
53
54 private:
55 I2cMasterV2Interface* i2cmasterv2_;
56 iface::SimulationInterface *simulation_;
57};
58
59} // namespace simics2tlm
60} // namespace systemc
61} // namespace simics
62
63#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:27
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
Adapter for I2cMasterV2 gasket.
Definition: i2c_master_v2_gasket_adapter.h:36
simics2tlm::GasketOwner * gasket_owner() const override
Definition: i2c_master_v2_gasket_adapter.h:50
void read_response(uint8_t value) override
Definition: i2c_master_v2_gasket_adapter.h:46
I2cMasterV2GasketAdapter(I2cMasterV2Interface *i2cmasterv2, iface::SimulationInterface *simulation)
Definition: i2c_master_v2_gasket_adapter.h:38
void acknowledge(types::i2c_ack_t ack) override
Definition: i2c_master_v2_gasket_adapter.h:42
i2c_ack_t
Definition: i2c_ack.h:22
Definition: pci_bus_interface.h:24