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
17
#include <
simics/systemc/context.h
>
18
19
#include <
simics/systemc/iface/i2c_master_v2_interface.h
>
20
#include <
simics/systemc/iface/simulation_interface.h
>
21
#include <
simics/systemc/simics2tlm/gasket_adapter.h
>
22
23
#include <stdint.h>
24
25
namespace
simics
{
26
namespace
systemc {
27
namespace
simics2tlm {
28
32
class
I2cMasterV2GasketAdapter
33
:
public
iface::I2cMasterV2Interface
,
34
public
GasketAdapter
<iface::I2cMasterV2Interface> {
35
public
:
36
I2cMasterV2GasketAdapter
(I2cMasterV2Interface *i2cmasterv2,
37
iface::SimulationInterface
*simulation)
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
}
48
simics2tlm::GasketOwner
*
gasket_owner
()
const override
{
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
simics::systemc::Context
Utility class that handles the context switching, using RAII methodology.
Definition:
context.h:31
simics::systemc::iface::I2cMasterV2Interface
Simics i2c_master_v2 interface.
Definition:
i2c_master_v2_interface.h:25
simics::systemc::iface::SimulationInterface
Interface to the SystemC simulation.
Definition:
simulation_interface.h:25
simics::systemc::simics2tlm::GasketAdapter
Definition:
gasket_adapter.h:43
simics::systemc::simics2tlm::GasketOwner
Base class, responsible for handling a gasket.
Definition:
gasket_owner.h:30
simics::systemc::simics2tlm::I2cMasterV2GasketAdapter
Adapter for I2cMasterV2 gasket.
Definition:
i2c_master_v2_gasket_adapter.h:34
simics::systemc::simics2tlm::I2cMasterV2GasketAdapter::gasket_owner
simics2tlm::GasketOwner * gasket_owner() const override
Definition:
i2c_master_v2_gasket_adapter.h:48
simics::systemc::simics2tlm::I2cMasterV2GasketAdapter::read_response
void read_response(uint8_t value) override
Definition:
i2c_master_v2_gasket_adapter.h:44
simics::systemc::simics2tlm::I2cMasterV2GasketAdapter::I2cMasterV2GasketAdapter
I2cMasterV2GasketAdapter(I2cMasterV2Interface *i2cmasterv2, iface::SimulationInterface *simulation)
Definition:
i2c_master_v2_gasket_adapter.h:36
simics::systemc::simics2tlm::I2cMasterV2GasketAdapter::acknowledge
void acknowledge(types::i2c_ack_t ack) override
Definition:
i2c_master_v2_gasket_adapter.h:40
context.h
gasket_adapter.h
i2c_master_v2_interface.h
simics::types::i2c_ack_t
i2c_ack_t
Definition:
i2c_ack.h:20
simics
Definition:
adapter.h:79
simulation_interface.h