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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2025 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_SLAVE_H
17#define SIMICS_SYSTEMC_SIMICS2TLM_SPI_SLAVE_H
18
19#include <tlm>
22
23namespace simics {
24namespace systemc {
25
26class SpiSlaveExtension : public tlm::tlm_extension<SpiSlaveExtension> {
27 public:
28 int first;
29 int last;
30
31 tlm_extension_base* clone() const override {
32 auto *ext = new SpiSlaveExtension;
33 ext->first = this->first;
34 ext->last = this->last;
35 return ext;
36 }
37
38 void copy_from(const tlm_extension_base& ext) override {
39 const auto &spi_ext = static_cast<const SpiSlaveExtension&>(ext);
40 first = spi_ext.first;
41 last = spi_ext.last;
42 }
43};
44
45namespace simics2tlm {
46
52 public:
53 virtual void spi_request(int first, int last, const uint8 *data_ptr,
54 size_t data_length);
55 virtual void connect_master(conf_object_t *master, const char *port,
56 serial_peripheral_interface_flags_t flags) {}
57 virtual void disconnect_master(conf_object_t *master) {}
58};
59
60} // namespace simics2tlm
61} // namespace systemc
62} // namespace simics
63
64#endif
Definition: spi_slave.h:26
void copy_from(const tlm_extension_base &ext) override
Definition: spi_slave.h:38
int first
Definition: spi_slave.h:28
int last
Definition: spi_slave.h:29
tlm_extension_base * clone() const override
Definition: spi_slave.h:31
Simics serial_peripheral_interface_slave interface.
Definition: spi_slave_interface.h:29
Base class, responsible for handling a gasket.
Definition: gasket_owner.h:32
Class that implements the Simics serial_peripheral_interface_slave interface and translates it into a...
Definition: spi_slave.h:51
virtual void disconnect_master(conf_object_t *master)
Definition: spi_slave.h:57
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:55
Definition: adapter.h:80