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
17
#include <
simics/systemc/context.h
>
18
19
#include <
simics/systemc/iface/i2c_slave_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
#include <vector>
25
26
namespace
simics
{
27
namespace
systemc {
28
namespace
simics2tlm {
29
33
class
I2cSlaveV2GasketAdapter
34
:
public
iface::I2cSlaveV2Interface
,
35
public
GasketAdapter
<iface::I2cSlaveV2Interface> {
36
public
:
37
I2cSlaveV2GasketAdapter
(I2cSlaveV2Interface *i2cslavev2,
38
iface::SimulationInterface
*simulation)
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
}
61
simics2tlm::GasketOwner
*
gasket_owner
()
const override
{
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
simics::systemc::Context
Utility class that handles the context switching, using RAII methodology.
Definition:
context.h:31
simics::systemc::iface::I2cSlaveV2Interface
Definition:
i2c_slave_v2_interface.h:24
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::I2cSlaveV2GasketAdapter
Adapter for I2cSlaveV2 gasket.
Definition:
i2c_slave_v2_gasket_adapter.h:35
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::start
void start(uint8_t address) override
Definition:
i2c_slave_v2_gasket_adapter.h:41
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::gasket_owner
simics2tlm::GasketOwner * gasket_owner() const override
Definition:
i2c_slave_v2_gasket_adapter.h:61
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::read
void read() override
Definition:
i2c_slave_v2_gasket_adapter.h:45
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::stop
void stop() override
Definition:
i2c_slave_v2_gasket_adapter.h:53
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::addresses
std::vector< uint8_t > addresses() override
Definition:
i2c_slave_v2_gasket_adapter.h:57
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::write
void write(uint8_t value) override
Definition:
i2c_slave_v2_gasket_adapter.h:49
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::I2cSlaveV2GasketAdapter
I2cSlaveV2GasketAdapter(I2cSlaveV2Interface *i2cslavev2, iface::SimulationInterface *simulation)
Definition:
i2c_slave_v2_gasket_adapter.h:37
context.h
gasket_adapter.h
i2c_slave_v2_interface.h
simics
Definition:
adapter.h:79
simulation_interface.h