SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
i3c_master_simics_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_IFACE_I3C_MASTER_SIMICS_ADAPTER_H
15#define SIMICS_SYSTEMC_IFACE_I3C_MASTER_SIMICS_ADAPTER_H
16
17#include <simics/devs/i3c.h>
21
22#include <string>
23#include <vector>
24
25namespace simics {
26namespace systemc {
27namespace iface {
28
29template<typename TBase, typename TInterface = I3cMasterInterface>
31 : public SimicsAdapter<i3c_master_interface_t> {
32 public:
34 : SimicsAdapter<i3c_master_interface_t>(
35 I3C_MASTER_INTERFACE, init_iface()) {
36 }
37
38 protected:
39 static void acknowledge(conf_object_t *obj, ::i3c_ack_t ack) {
40 adapter<TBase, TInterface>(obj)->acknowledge(
41 ack == I3C_ack ? types::I3C_ack : types::I3C_noack);
42 }
43 static void read_response(conf_object_t *obj, uint8 value, bool more) {
44 adapter<TBase, TInterface>(obj)->read_response(value, more);
45 }
46 static void daa_response(conf_object_t *obj, ::uint64 id,
47 uint8 bcr, uint8 dcr) {
48 adapter<TBase, TInterface>(obj)->daa_response(id, bcr, dcr);
49 }
50 static void ibi_request(conf_object_t *obj) {
51 adapter<TBase, TInterface>(obj)->ibi_request();
52 }
53 static void ibi_address(conf_object_t *obj, uint8 address) {
54 adapter<TBase, TInterface>(obj)->ibi_address(address);
55 }
56
57 private:
58 std::vector<std::string> description(conf_object_t *obj,
59 DescriptionType type) override {
60 return descriptionBase<TBase, TInterface>(obj, type);
61 }
62 i3c_master_interface_t init_iface() {
63 i3c_master_interface_t iface = {};
64 iface.acknowledge = acknowledge;
65 iface.read_response = read_response;
66 iface.daa_response = daa_response;
67 iface.ibi_request = ibi_request;
68 iface.ibi_address = ibi_address;
69 return iface;
70 }
71};
72
73} // namespace iface
74} // namespace systemc
75} // namespace simics
76
77#endif
Definition: i3c_master_simics_adapter.h:31
static void read_response(conf_object_t *obj, uint8 value, bool more)
Definition: i3c_master_simics_adapter.h:43
static void daa_response(conf_object_t *obj, ::uint64 id, uint8 bcr, uint8 dcr)
Definition: i3c_master_simics_adapter.h:46
static void ibi_request(conf_object_t *obj)
Definition: i3c_master_simics_adapter.h:50
static void acknowledge(conf_object_t *obj, ::i3c_ack_t ack)
Definition: i3c_master_simics_adapter.h:39
I3cMasterSimicsAdapter()
Definition: i3c_master_simics_adapter.h:33
static void ibi_address(conf_object_t *obj, uint8 address)
Definition: i3c_master_simics_adapter.h:53
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:45
DescriptionType
Definition: description_interface.h:23
@ I3C_ack
Definition: i3c_ack.h:21
@ I3C_noack
Definition: i3c_ack.h:22
Definition: adapter.h:79