SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
Loading...
Searching...
No Matches
spi_master_gasket_adapter.h
Go to the documentation of this file.
1
// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3
/*
4
© 2019 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_SPI_MASTER_GASKET_ADAPTER_H
17
#define SIMICS_SYSTEMC_SIMICS2TLM_SPI_MASTER_GASKET_ADAPTER_H
18
19
#include <
simics/systemc/context.h
>
20
#include <
simics/systemc/iface/simulation_interface.h
>
21
#include <
simics/systemc/iface/spi_master_interface.h
>
22
#include <
simics/systemc/simics2tlm/gasket_adapter.h
>
23
24
#include <stdint.h>
25
26
namespace
simics
{
27
namespace
systemc {
28
namespace
simics2tlm {
29
33
class
SpiMasterGasketAdapter
34
:
public
iface::SpiMasterInterface
,
35
public
GasketAdapter
<iface::SpiMasterInterface> {
36
public
:
37
SpiMasterGasketAdapter
(SpiMasterInterface *spimaster,
38
iface::SimulationInterface
*simulation)
39
: spimaster_(spimaster), simulation_(simulation) {
40
}
41
virtual
void
spi_response
(
const
uint8 *data_ptr,
size_t
data_length) {
42
Context
context(simulation_);
43
spimaster_->spi_response(data_ptr, data_length);
44
}
45
simics2tlm::GasketOwner
*
gasket_owner
()
const override
{
46
return
dynamic_cast<
simics2tlm::GasketOwner
*
>
(spimaster_);
47
}
48
49
private
:
50
SpiMasterInterface *spimaster_;
51
iface::SimulationInterface
*simulation_;
52
};
53
54
}
// namespace simics2tlm
55
}
// namespace systemc
56
}
// namespace simics
57
58
#endif
simics::systemc::Context
Utility class that handles the context switching, using RAII methodology.
Definition:
context.h:31
simics::systemc::iface::SimulationInterface
Interface to the SystemC simulation.
Definition:
simulation_interface.h:27
simics::systemc::iface::SpiMasterInterface
Simics serial_peripheral_interface_master interface.
Definition:
spi_master_interface.h:26
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::SpiMasterGasketAdapter
Adapter for SpiMaster gasket.
Definition:
spi_master_gasket_adapter.h:35
simics::systemc::simics2tlm::SpiMasterGasketAdapter::spi_response
virtual void spi_response(const uint8 *data_ptr, size_t data_length)
Definition:
spi_master_gasket_adapter.h:41
simics::systemc::simics2tlm::SpiMasterGasketAdapter::SpiMasterGasketAdapter
SpiMasterGasketAdapter(SpiMasterInterface *spimaster, iface::SimulationInterface *simulation)
Definition:
spi_master_gasket_adapter.h:37
simics::systemc::simics2tlm::SpiMasterGasketAdapter::gasket_owner
simics2tlm::GasketOwner * gasket_owner() const override
Definition:
spi_master_gasket_adapter.h:45
context.h
gasket_adapter.h
simics
Definition:
pci_bus_interface.h:24
simulation_interface.h
spi_master_interface.h