SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
spi_slave.h
Go to the documentation of this file.
1/*
2 © 2025 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_SLAVE_H
15#define SIMICS_SYSTEMC_SIMICS2TLM_SPI_SLAVE_H
16
17#include <tlm>
20
21namespace simics {
22namespace systemc {
23
24class SpiSlaveExtension : public tlm::tlm_extension<SpiSlaveExtension> {
25 public:
26 int first;
27 int last;
28
29 tlm_extension_base* clone() const override {
30 auto *ext = new SpiSlaveExtension;
31 ext->first = this->first;
32 ext->last = this->last;
33 return ext;
34 }
35
36 void copy_from(const tlm_extension_base& ext) override {
37 const auto &spi_ext = static_cast<const SpiSlaveExtension&>(ext);
38 first = spi_ext.first;
39 last = spi_ext.last;
40 }
41};
42
43namespace simics2tlm {
44
50 public:
51 virtual void spi_request(int first, int last, const uint8 *data_ptr,
52 size_t data_length);
53 virtual void connect_master(conf_object_t *master, const char *port,
54 serial_peripheral_interface_flags_t flags) {}
55 virtual void disconnect_master(conf_object_t *master) {}
56};
57
58} // namespace simics2tlm
59} // namespace systemc
60} // namespace simics
61
62#endif
Definition: spi_slave.h:24
void copy_from(const tlm_extension_base &ext) override
Definition: spi_slave.h:36
int first
Definition: spi_slave.h:26
int last
Definition: spi_slave.h:27
tlm_extension_base * clone() const override
Definition: spi_slave.h:29
Simics serial_peripheral_interface_slave interface.
Definition: spi_slave_interface.h:27
Base class, responsible for handling a gasket.
Definition: gasket_owner.h:30
Class that implements the Simics serial_peripheral_interface_slave interface and translates it into a...
Definition: spi_slave.h:49
virtual void disconnect_master(conf_object_t *master)
Definition: spi_slave.h:55
virtual void spi_request(int first, int last, const uint8 *data_ptr, size_t data_length)
virtual void connect_master(conf_object_t *master, const char *port, serial_peripheral_interface_flags_t flags)
Definition: spi_slave.h:53
Definition: adapter.h:79