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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2017 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_TOOLS_SC_TRANSACTION_TRACKER_EXTENSION_H
17#define SIMICS_SYSTEMC_TOOLS_SC_TRANSACTION_TRACKER_EXTENSION_H
18
19
21#include <systemc>
22#include <tlm>
23
24#include <cstring>
25#include <map>
26#include <utility>
27#include <vector>
28
29namespace simics {
30namespace systemc {
31namespace tools {
32
33/* Extension for tracking TLM2 transaction changes.
34 If you change the class, update corresponding GDB Pretty-Printer. */
36 : public tlm::tlm_extension<TransactionTrackerExtension> {
37 public:
39
40 virtual tlm::tlm_extension_base *clone() const;
41 virtual void copy_from(tlm::tlm_extension_base const &extension);
42
43 static unsigned int get_id();
44
45 void add_sighting(simics::ConfObjectRef obj,
46 tlm::tlm_generic_payload const *trans,
47 sc_core::sc_object const *socket_sc_obj);
49
50 void set_initiator_socket(sc_core::sc_object const *socket_obj);
51 sc_core::sc_object const *get_initiator_socket() const;
52
53 void clear();
54
55 private:
56 struct CompareStr {
57 bool operator()(const char *str1, const char *str2) const {
58 return std::strcmp(str1, str2) < 0;
59 }
60 };
61
62 struct PayloadAttributes {
63 sc_dt::uint64 address;
64 };
65
66 struct Sighting {
67 const char *socket_name;
68 const sc_core::sc_object *socket_obj;
69 PayloadAttributes attributes;
70 };
71
72 typedef std::vector<Sighting> Sightings;
73 typedef std::map<const char *, Sightings, CompareStr> ToolSightings;
74 ToolSightings tool_sightings_;
75
76 sc_core::sc_object const *socket_obj_;
77};
78
79} // namespace tools
80} // namespace systemc
81} // namespace simics
82
83#endif
Definition: sc_transaction_tracker_extension.h:36
void set_initiator_socket(sc_core::sc_object const *socket_obj)
virtual void copy_from(tlm::tlm_extension_base const &extension)
virtual tlm::tlm_extension_base * clone() const
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: pci_bus_interface.h:24