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