pmu.hh (10905:a6ca6831e775) | pmu.hh (11168:f98eb2da15a4) |
---|---|
1/* 2 * Copyright (c) 2011-2014 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 --- 82 unchanged lines hidden (view full) --- 91class PMU : public SimObject, public ArmISA::BaseISADevice { 92 public: 93 PMU(const ArmPMUParams *p); 94 ~PMU(); 95 96 void addEventProbe(unsigned int id, SimObject *obj, const char *name); 97 98 public: // SimObject and related interfaces | 1/* 2 * Copyright (c) 2011-2014 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 --- 82 unchanged lines hidden (view full) --- 91class PMU : public SimObject, public ArmISA::BaseISADevice { 92 public: 93 PMU(const ArmPMUParams *p); 94 ~PMU(); 95 96 void addEventProbe(unsigned int id, SimObject *obj, const char *name); 97 98 public: // SimObject and related interfaces |
99 void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE; 100 void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE; | 99 void serialize(CheckpointOut &cp) const override; 100 void unserialize(CheckpointIn &cp) override; |
101 | 101 |
102 void drainResume() M5_ATTR_OVERRIDE; | 102 void drainResume() override; |
103 104 105 public: // ISA Device interface 106 /** 107 * Set a register within the PMU. 108 * 109 * @param misc_reg Register number (see miscregs.hh) 110 * @param val Value to store 111 */ | 103 104 105 public: // ISA Device interface 106 /** 107 * Set a register within the PMU. 108 * 109 * @param misc_reg Register number (see miscregs.hh) 110 * @param val Value to store 111 */ |
112 void setMiscReg(int misc_reg, MiscReg val) M5_ATTR_OVERRIDE; | 112 void setMiscReg(int misc_reg, MiscReg val) override; |
113 /** 114 * Read a register within the PMU. 115 * 116 * @param misc_reg Register number (see miscregs.hh) 117 * @return Register value. 118 */ | 113 /** 114 * Read a register within the PMU. 115 * 116 * @param misc_reg Register number (see miscregs.hh) 117 * @return Register value. 118 */ |
119 MiscReg readMiscReg(int misc_reg) M5_ATTR_OVERRIDE; | 119 MiscReg readMiscReg(int misc_reg) override; |
120 121 protected: // PMU register types and constants 122 BitUnion32(PMCR_t) 123 // PMU Enable 124 Bitfield<0> e; 125 // Event counter reset 126 Bitfield<1> p; 127 // Cycle counter reset --- 136 unchanged lines hidden (view full) --- 264 class ProbeListener : public ProbeListenerArgBase<uint64_t> 265 { 266 public: 267 ProbeListener(PMU &_pmu, CounterId _id, 268 ProbeManager *pm, const std::string &name) 269 : ProbeListenerArgBase(pm, name), 270 pmu(_pmu), id(_id) {} 271 | 120 121 protected: // PMU register types and constants 122 BitUnion32(PMCR_t) 123 // PMU Enable 124 Bitfield<0> e; 125 // Event counter reset 126 Bitfield<1> p; 127 // Cycle counter reset --- 136 unchanged lines hidden (view full) --- 264 class ProbeListener : public ProbeListenerArgBase<uint64_t> 265 { 266 public: 267 ProbeListener(PMU &_pmu, CounterId _id, 268 ProbeManager *pm, const std::string &name) 269 : ProbeListenerArgBase(pm, name), 270 pmu(_pmu), id(_id) {} 271 |
272 void notify(const uint64_t &val) M5_ATTR_OVERRIDE | 272 void notify(const uint64_t &val) override |
273 { 274 pmu.handleEvent(id, val); 275 } 276 277 protected: 278 PMU &pmu; 279 const CounterId id; 280 }; --- 43 unchanged lines hidden (view full) --- 324 struct CounterState : public Serializable { 325 CounterState() 326 : eventId(0), filter(0), value(0), enabled(false), 327 overflow64(false) { 328 329 listeners.reserve(4); 330 } 331 | 273 { 274 pmu.handleEvent(id, val); 275 } 276 277 protected: 278 PMU &pmu; 279 const CounterId id; 280 }; --- 43 unchanged lines hidden (view full) --- 324 struct CounterState : public Serializable { 325 CounterState() 326 : eventId(0), filter(0), value(0), enabled(false), 327 overflow64(false) { 328 329 listeners.reserve(4); 330 } 331 |
332 void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE; 333 void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE; | 332 void serialize(CheckpointOut &cp) const override; 333 void unserialize(CheckpointIn &cp) override; |
334 335 /** 336 * Add an event count to the counter and check for overflow. 337 * 338 * @param delta Number of events to add to the counter. 339 * @return true on overflow, false otherwise. 340 */ 341 bool add(uint64_t delta); --- 165 unchanged lines hidden --- | 334 335 /** 336 * Add an event count to the counter and check for overflow. 337 * 338 * @param delta Number of events to add to the counter. 339 * @return true on overflow, false otherwise. 340 */ 341 bool add(uint64_t delta); --- 165 unchanged lines hidden --- |