SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
pcie_tlm_extension.h
Go to the documentation of this file.
1/* -*- C++ -*-
2
3 © 2024 Intel Corporation
4
5 This software and the related documents are Intel copyrighted materials, and
6 your use of them is governed by the express license under which they were
7 provided to you ("License"). Unless the License provides otherwise, you may
8 not use, modify, copy, publish, distribute, disclose or transmit this software
9 or the related documents without Intel's prior written permission.
10
11 This software and the related documents are provided as is, with no express or
12 implied warranties, other than those that are expressly stated in the License.
13*/
14
15#ifndef SIMICS_SYSTEMC_PCIE_TLM_EXTENSION_H
16#define SIMICS_SYSTEMC_PCIE_TLM_EXTENSION_H
17
18#include <tlm>
19
21#include <cstdint>
22#include <typeinfo>
23
24namespace simics {
25namespace systemc {
26
27/*
28 * PCIe TLM extension
29 *
30 * Because the local bus part is dropped Endpoints need capture their
31 * BDF(Bus/Device/Function) id from the pcie_device_id atom.
32 */
33class PcieTlmExtension : public tlm::tlm_extension<PcieTlmExtension> {
34 public:
35 using tlm_extension::tlm_extension;
36 virtual ~PcieTlmExtension() = default;
37
38 // tlm::tlm_extension
39 tlm::tlm_extension_base *clone() const override {
40 return new PcieTlmExtension(*this);
41 }
42 void copy_from(tlm::tlm_extension_base const &extension) override {
43 *this = static_cast<const PcieTlmExtension &>(extension);
44 }
45
46 void reset() {
48 msg_type_set = false;
50 device_id_set = false;
51 device_id = 0;
52 pasid_set = false;
53 pasid = 0;
54 requester_id_set = false;
55 requester_id = 0;
56 ide_secured_set = false;
58 }
59
60 // A transaction comes in four different types: Config, Memory, I/O, and
61 // Message
63
64 bool msg_type_set {false};
66
67 bool device_id_set {false};
68 uint16_t device_id {0};
69
70 bool pasid_set {false};
71 uint32_t pasid {0};
72
73 bool requester_id_set {false};
74 uint16_t requester_id {0};
75
76 bool ide_secured_set {false};
78
79 // Define the unique ID for this extension
80 static const unsigned int ID;
81};
82
83} // namespace systemc
84} // namespace simics
85
86#endif
Definition: pcie_tlm_extension.h:33
types::pcie_ide_secured_t ide_secured
Definition: pcie_tlm_extension.h:77
virtual ~PcieTlmExtension()=default
static const unsigned int ID
Definition: pcie_tlm_extension.h:80
bool requester_id_set
Definition: pcie_tlm_extension.h:73
void reset()
Definition: pcie_tlm_extension.h:46
bool pasid_set
Definition: pcie_tlm_extension.h:70
bool ide_secured_set
Definition: pcie_tlm_extension.h:76
bool msg_type_set
Definition: pcie_tlm_extension.h:64
void copy_from(tlm::tlm_extension_base const &extension) override
Definition: pcie_tlm_extension.h:42
tlm::tlm_extension_base * clone() const override
Definition: pcie_tlm_extension.h:39
uint16_t requester_id
Definition: pcie_tlm_extension.h:74
types::pcie_message_type_t msg_type
Definition: pcie_tlm_extension.h:65
bool device_id_set
Definition: pcie_tlm_extension.h:67
uint32_t pasid
Definition: pcie_tlm_extension.h:71
uint16_t device_id
Definition: pcie_tlm_extension.h:68
types::pcie_type_t type
Definition: pcie_tlm_extension.h:62
pcie_message_type_t
Definition: pcie_type.h:31
@ PCIE_ERR_FATAL
Definition: pcie_type.h:60
pcie_type_t
Definition: pcie_type.h:22
@ PCIE_Type_Not_Set
Definition: pcie_type.h:23
Definition: adapter.h:80
Definition: pcie_type.h:104