base.hh (11139:bd894d2bdd7c) base.hh (11168:f98eb2da15a4)
1/*
2 * Copyright (c) 2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 51 unchanged lines hidden (view full) ---

60 * distance probe could be hooked up to multiple memories in a
61 * multi-channel configuration.
62 */
63class BaseMemProbe : public SimObject
64{
65 public:
66 BaseMemProbe(BaseMemProbeParams *params);
67
1/*
2 * Copyright (c) 2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 51 unchanged lines hidden (view full) ---

60 * distance probe could be hooked up to multiple memories in a
61 * multi-channel configuration.
62 */
63class BaseMemProbe : public SimObject
64{
65 public:
66 BaseMemProbe(BaseMemProbeParams *params);
67
68 void regProbeListeners() M5_ATTR_OVERRIDE;
68 void regProbeListeners() override;
69
70 protected:
71 /**
72 * Callback to analyse intercepted Packets.
73 */
74 virtual void handleRequest(const ProbePoints::PacketInfo &pkt_info) = 0;
75
76 private:
77 class PacketListener : public ProbeListenerArgBase<ProbePoints::PacketInfo>
78 {
79 public:
80 PacketListener(BaseMemProbe &_parent,
81 ProbeManager *pm, const std::string &name)
82 : ProbeListenerArgBase(pm, name),
83 parent(_parent) {}
84
69
70 protected:
71 /**
72 * Callback to analyse intercepted Packets.
73 */
74 virtual void handleRequest(const ProbePoints::PacketInfo &pkt_info) = 0;
75
76 private:
77 class PacketListener : public ProbeListenerArgBase<ProbePoints::PacketInfo>
78 {
79 public:
80 PacketListener(BaseMemProbe &_parent,
81 ProbeManager *pm, const std::string &name)
82 : ProbeListenerArgBase(pm, name),
83 parent(_parent) {}
84
85 void notify(const ProbePoints::PacketInfo &pkt_info) M5_ATTR_OVERRIDE {
85 void notify(const ProbePoints::PacketInfo &pkt_info) override {
86 parent.handleRequest(pkt_info);
87 }
88
89 protected:
90 BaseMemProbe &parent;
91 };
92
93 std::vector<std::unique_ptr<PacketListener>> listeners;
94};
95
96#endif // __MEM_PROBES_BASE_HH__
86 parent.handleRequest(pkt_info);
87 }
88
89 protected:
90 BaseMemProbe &parent;
91 };
92
93 std::vector<std::unique_ptr<PacketListener>> listeners;
94};
95
96#endif // __MEM_PROBES_BASE_HH__