SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
sc_transaction_tracker_extension.h
Go to the documentation of this file.
1/*
2 © 2017 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_TOOLS_SC_TRANSACTION_TRACKER_EXTENSION_H
15#define SIMICS_SYSTEMC_TOOLS_SC_TRANSACTION_TRACKER_EXTENSION_H
16
17
19#include <systemc>
20#include <tlm>
21
22#include <cstring>
23#include <map>
24#include <utility>
25#include <vector>
26
27namespace simics {
28namespace systemc {
29namespace tools {
30
31/* Extension for tracking TLM2 transaction changes.
32 If you change the class, update corresponding GDB Pretty-Printer. */
34 : public tlm::tlm_extension<TransactionTrackerExtension> {
35 public:
37
38 tlm::tlm_extension_base *clone() const override;
39 void copy_from(tlm::tlm_extension_base const &extension) override;
40
41 static unsigned int get_id();
42
43 void add_sighting(simics::ConfObjectRef obj,
44 tlm::tlm_generic_payload const *trans,
45 sc_core::sc_object const *socket_sc_obj);
47
48 void set_initiator_socket(sc_core::sc_object const *socket_obj);
49 sc_core::sc_object const *get_initiator_socket() const;
50
51 void clear();
52
53 private:
54 struct CompareStr {
55 bool operator()(const char *str1, const char *str2) const {
56 return std::strcmp(str1, str2) < 0;
57 }
58 };
59
60 struct PayloadAttributes {
61 sc_dt::uint64 address;
62 };
63
64 struct Sighting {
65 const char *socket_name;
66 const sc_core::sc_object *socket_obj;
67 PayloadAttributes attributes;
68 };
69
70 typedef std::vector<Sighting> Sightings;
71 typedef std::map<const char *, Sightings, CompareStr> ToolSightings;
72 ToolSightings tool_sightings_;
73
74 sc_core::sc_object const *socket_obj_;
75};
76
77} // namespace tools
78} // namespace systemc
79} // namespace simics
80
81#endif
Definition: sc_transaction_tracker_extension.h:34
void set_initiator_socket(sc_core::sc_object const *socket_obj)
void copy_from(tlm::tlm_extension_base const &extension) override
tlm::tlm_extension_base * clone() const override
sc_core::sc_object const * get_initiator_socket() const
void add_sighting(simics::ConfObjectRef obj, tlm::tlm_generic_payload const *trans, sc_core::sc_object const *socket_sc_obj)
Definition: adapter.h:79