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
// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3
/*
4
© 2014 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_SLAVE_V2_GASKET_ADAPTER_H
17
#define SIMICS_SYSTEMC_SIMICS2TLM_I2C_SLAVE_V2_GASKET_ADAPTER_H
18
19
#include <
simics/systemc/context.h
>
20
21
#include <
simics/systemc/iface/i2c_slave_v2_interface.h
>
22
#include <
simics/systemc/iface/simulation_interface.h
>
23
#include <
simics/systemc/simics2tlm/gasket_adapter.h
>
24
25
#include <stdint.h>
26
#include <vector>
27
28
namespace
simics
{
29
namespace
systemc {
30
namespace
simics2tlm {
31
35
class
I2cSlaveV2GasketAdapter
36
:
public
iface::I2cSlaveV2Interface
,
37
public
GasketAdapter
<iface::I2cSlaveV2Interface> {
38
public
:
39
I2cSlaveV2GasketAdapter
(I2cSlaveV2Interface *i2cslavev2,
40
iface::SimulationInterface
*simulation)
41
: i2cslavev2_(i2cslavev2), simulation_(simulation) {
42
}
43
void
start
(uint8_t address)
override
{
44
Context
context(simulation_);
45
i2cslavev2_->start(address);
46
}
47
void
read
()
override
{
48
Context
context(simulation_);
49
i2cslavev2_->read();
50
}
51
void
write
(uint8_t value)
override
{
52
Context
context(simulation_);
53
i2cslavev2_->write(value);
54
}
55
void
stop
()
override
{
56
Context
context(simulation_);
57
i2cslavev2_->stop();
58
}
59
std::vector<uint8_t>
addresses
()
override
{
60
Context
context(simulation_);
61
return
i2cslavev2_->addresses();
62
}
63
simics2tlm::GasketOwner
*
gasket_owner
()
const override
{
64
return
dynamic_cast<
simics2tlm::GasketOwner
*
>
(i2cslavev2_);
65
}
66
67
private
:
68
I2cSlaveV2Interface *i2cslavev2_;
69
iface::SimulationInterface
*simulation_;
70
};
71
72
}
// namespace simics2tlm
73
}
// namespace systemc
74
}
// namespace simics
75
76
#endif
simics::systemc::Context
Utility class that handles the context switching, using RAII methodology.
Definition:
context.h:33
simics::systemc::iface::I2cSlaveV2Interface
Definition:
i2c_slave_v2_interface.h:26
simics::systemc::iface::SimulationInterface
Interface to the SystemC simulation.
Definition:
simulation_interface.h:27
simics::systemc::simics2tlm::GasketAdapter
Definition:
gasket_adapter.h:45
simics::systemc::simics2tlm::GasketOwner
Base class, responsible for handling a gasket.
Definition:
gasket_owner.h:32
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter
Adapter for I2cSlaveV2 gasket.
Definition:
i2c_slave_v2_gasket_adapter.h:37
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::start
void start(uint8_t address) override
Definition:
i2c_slave_v2_gasket_adapter.h:43
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::gasket_owner
simics2tlm::GasketOwner * gasket_owner() const override
Definition:
i2c_slave_v2_gasket_adapter.h:63
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::read
void read() override
Definition:
i2c_slave_v2_gasket_adapter.h:47
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::stop
void stop() override
Definition:
i2c_slave_v2_gasket_adapter.h:55
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::addresses
std::vector< uint8_t > addresses() override
Definition:
i2c_slave_v2_gasket_adapter.h:59
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::write
void write(uint8_t value) override
Definition:
i2c_slave_v2_gasket_adapter.h:51
simics::systemc::simics2tlm::I2cSlaveV2GasketAdapter::I2cSlaveV2GasketAdapter
I2cSlaveV2GasketAdapter(I2cSlaveV2Interface *i2cslavev2, iface::SimulationInterface *simulation)
Definition:
i2c_slave_v2_gasket_adapter.h:39
context.h
gasket_adapter.h
i2c_slave_v2_interface.h
simics
Definition:
adapter.h:80
simulation_interface.h