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/*
2 © 2019 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_SPI_MASTER_GASKET_ADAPTER_H
15#define SIMICS_SYSTEMC_SIMICS2TLM_SPI_MASTER_GASKET_ADAPTER_H
16
21
22#include <stdint.h>
23
24namespace simics {
25namespace systemc {
26namespace simics2tlm {
27
33 public GasketAdapter<iface::SpiMasterInterface> {
34 public:
35 SpiMasterGasketAdapter(SpiMasterInterface *spimaster,
37 : spimaster_(spimaster), simulation_(simulation) {
38 }
39 void spi_response(const uint8 *data_ptr, size_t data_length) override {
40 Context context(simulation_);
41 spimaster_->spi_response(data_ptr, data_length);
42 }
44 return dynamic_cast<simics2tlm::GasketOwner *>(spimaster_);
45 }
46
47 private:
48 SpiMasterInterface *spimaster_;
49 iface::SimulationInterface *simulation_;
50};
51
52} // namespace simics2tlm
53} // namespace systemc
54} // namespace simics
55
56#endif
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Interface to the SystemC simulation.
Definition: simulation_interface.h:25
Simics serial_peripheral_interface_master interface.
Definition: spi_master_interface.h:24
Definition: gasket_adapter.h:43
Base class, responsible for handling a gasket.
Definition: gasket_owner.h:30
Adapter for SpiMaster gasket.
Definition: spi_master_gasket_adapter.h:33
SpiMasterGasketAdapter(SpiMasterInterface *spimaster, iface::SimulationInterface *simulation)
Definition: spi_master_gasket_adapter.h:35
simics2tlm::GasketOwner * gasket_owner() const override
Definition: spi_master_gasket_adapter.h:43
void spi_response(const uint8 *data_ptr, size_t data_length) override
Definition: spi_master_gasket_adapter.h:39
Definition: adapter.h:79