SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
i3c_master_extension.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_EXTENSION_H
17#define SIMICS_SYSTEMC_IFACE_I3C_MASTER_EXTENSION_H
18
21
22namespace simics {
23namespace systemc {
24namespace iface {
25
26class I3cMasterExtension : public Extension<I3cMasterExtension,
27 I3cMasterInterface> {
28 public:
29 virtual void call(I3cMasterInterface *device) {
30 switch (method_.value<Method>()) {
31 case ACKNOWLEDGE:
32 device->acknowledge(method_input_[0].value<types::i3c_ack_t>());
33 break;
34 case READ_RESPONSE:
35 device->read_response(method_input_[0].value<uint8_t>(),
36 method_input_[1].value<bool>());
37 break;
38 case DAA_RESPONSE:
39 device->daa_response(method_input_[0].value<uint64_t>(),
40 method_input_[1].value<uint8_t>(),
41 method_input_[2].value<uint8_t>());
42 break;
43 case IBI_REQUEST:
44 device->ibi_request();
45 break;
46 case IBI_ADDRESS:
47 device->ibi_address(method_input_[0].value<uint8_t>());
48 break;
49 }
50 }
51
52 virtual void acknowledge(types::i3c_ack_t ack) {
53 method_input_.push_back(ack);
54 method_ = ACKNOWLEDGE;
55 send();
56 }
57 virtual void read_response(uint8_t value, bool more) {
58 method_input_.push_back(value);
59 method_input_.push_back(more);
60 method_ = READ_RESPONSE;
61 send();
62 }
63 virtual void daa_response(uint64_t id, uint8_t bcr, uint8_t dcr) {
64 method_input_.push_back(id);
65 method_input_.push_back(bcr);
66 method_input_.push_back(dcr);
67 method_ = DAA_RESPONSE;
68 send();
69 }
70 virtual void ibi_request() {
71 method_ = IBI_REQUEST;
72 send();
73 }
74 virtual void ibi_address(uint8_t address) {
75 method_input_.push_back(address);
76 method_ = IBI_ADDRESS;
77 send();
78 }
79
80 private:
81 enum Method {
82 ACKNOWLEDGE,
83 READ_RESPONSE,
84 DAA_RESPONSE,
85 IBI_REQUEST,
86 IBI_ADDRESS
87 };
88};
89
90} // namespace iface
91} // namespace systemc
92} // namespace simics
93
94#endif
Base class for TLM2 extension, responsible for marshal/unmarshal of a Simics interface.
Definition: extension.h:40
std::vector< types::AnyType > method_input_
Definition: extension.h:118
Definition: i3c_master_extension.h:27
virtual void read_response(uint8_t value, bool more)
Definition: i3c_master_extension.h:57
virtual void acknowledge(types::i3c_ack_t ack)
Definition: i3c_master_extension.h:52
virtual void ibi_request()
Definition: i3c_master_extension.h:70
virtual void ibi_address(uint8_t address)
Definition: i3c_master_extension.h:74
virtual void call(I3cMasterInterface *device)
Definition: i3c_master_extension.h:29
virtual void daa_response(uint64_t id, uint8_t bcr, uint8_t dcr)
Definition: i3c_master_extension.h:63
Simics i3c_master interface.
Definition: i3c_master_interface.h:27
virtual void daa_response(uint64_t id, uint8_t bcr, uint8_t dcr)=0
virtual void ibi_address(uint8_t address)=0
virtual void acknowledge(types::i3c_ack_t ack)=0
virtual void read_response(uint8_t value, bool more)=0
T value()
Definition: any_type.h:84
i3c_ack_t
Definition: i3c_ack.h:22
Definition: pci_bus_interface.h:24