comm_monitor.hh (10995:a114e2712642) | comm_monitor.hh (10996:d48fda705f4d) |
---|---|
1/* 2 * Copyright (c) 2012-2013, 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 --- 30 unchanged lines hidden (view full) --- 39 */ 40 41#ifndef __MEM_COMM_MONITOR_HH__ 42#define __MEM_COMM_MONITOR_HH__ 43 44#include "base/statistics.hh" 45#include "mem/mem_object.hh" 46#include "params/CommMonitor.hh" | 1/* 2 * Copyright (c) 2012-2013, 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 --- 30 unchanged lines hidden (view full) --- 39 */ 40 41#ifndef __MEM_COMM_MONITOR_HH__ 42#define __MEM_COMM_MONITOR_HH__ 43 44#include "base/statistics.hh" 45#include "mem/mem_object.hh" 46#include "params/CommMonitor.hh" |
47#include "proto/protoio.hh" | |
48#include "sim/probe/mem.hh" | 47#include "sim/probe/mem.hh" |
49#include "sim/system.hh" | |
50 51/** 52 * The communication monitor is a MemObject which can monitor statistics of 53 * the communication happening between two ports in the memory system. 54 * 55 * Currently the following stats are implemented: Histograms of read/write 56 * transactions, read/write burst lengths, read/write bandwidth, 57 * outstanding read/write requests, read latency and inter transaction time --- 13 unchanged lines hidden (view full) --- 71 72 /** 73 * Constructor based on the Python params 74 * 75 * @param params Python parameters 76 */ 77 CommMonitor(Params* params); 78 | 48 49/** 50 * The communication monitor is a MemObject which can monitor statistics of 51 * the communication happening between two ports in the memory system. 52 * 53 * Currently the following stats are implemented: Histograms of read/write 54 * transactions, read/write burst lengths, read/write bandwidth, 55 * outstanding read/write requests, read latency and inter transaction time --- 13 unchanged lines hidden (view full) --- 69 70 /** 71 * Constructor based on the Python params 72 * 73 * @param params Python parameters 74 */ 75 CommMonitor(Params* params); 76 |
79 /** Destructor */ 80 ~CommMonitor(); 81 | |
82 void init() M5_ATTR_OVERRIDE; 83 void regStats() M5_ATTR_OVERRIDE; 84 void startup() M5_ATTR_OVERRIDE; 85 void regProbePoints() M5_ATTR_OVERRIDE; 86 87 public: // MemObject interfaces 88 BaseMasterPort& getMasterPort(const std::string& if_name, 89 PortID idx = InvalidPortID) M5_ATTR_OVERRIDE; --- 296 unchanged lines hidden (view full) --- 386 disableAddrDists(params->disable_addr_dists) 387 { } 388 389 }; 390 391 /** This function is called periodically at the end of each time bin */ 392 void samplePeriodic(); 393 | 77 void init() M5_ATTR_OVERRIDE; 78 void regStats() M5_ATTR_OVERRIDE; 79 void startup() M5_ATTR_OVERRIDE; 80 void regProbePoints() M5_ATTR_OVERRIDE; 81 82 public: // MemObject interfaces 83 BaseMasterPort& getMasterPort(const std::string& if_name, 84 PortID idx = InvalidPortID) M5_ATTR_OVERRIDE; --- 296 unchanged lines hidden (view full) --- 381 disableAddrDists(params->disable_addr_dists) 382 { } 383 384 }; 385 386 /** This function is called periodically at the end of each time bin */ 387 void samplePeriodic(); 388 |
394 /** 395 * Callback to flush and close all open output streams on exit. If 396 * we were calling the destructor it could be done there. 397 */ 398 void closeStreams(); 399 | |
400 /** Periodic event called at the end of each simulation time bin */ 401 EventWrapper<CommMonitor, &CommMonitor::samplePeriodic> samplePeriodicEvent; 402 403 /** 404 *@{ 405 * @name Configuration 406 */ 407 408 /** Length of simulation time bin*/ 409 const Tick samplePeriodTicks; 410 /** Sample period in seconds */ 411 const double samplePeriod; 412 413 /** Address mask for sources of read accesses to be captured */ 414 const Addr readAddrMask; 415 416 /** Address mask for sources of write accesses to be captured */ 417 const Addr writeAddrMask; 418 | 389 /** Periodic event called at the end of each simulation time bin */ 390 EventWrapper<CommMonitor, &CommMonitor::samplePeriodic> samplePeriodicEvent; 391 392 /** 393 *@{ 394 * @name Configuration 395 */ 396 397 /** Length of simulation time bin*/ 398 const Tick samplePeriodTicks; 399 /** Sample period in seconds */ 400 const double samplePeriod; 401 402 /** Address mask for sources of read accesses to be captured */ 403 const Addr readAddrMask; 404 405 /** Address mask for sources of write accesses to be captured */ 406 const Addr writeAddrMask; 407 |
419 /** The system in which the monitor lives */ 420 System *const system; 421 | |
422 /** @} */ 423 | 408 /** @} */ 409 |
424 /** Output stream for a potential trace. */ 425 ProtoOutputStream *traceStream; 426 | |
427 /** Instantiate stats */ 428 MonitorStats stats; 429 430 protected: // Probe points 431 /** 432 * @{ 433 * @name Memory system probe points 434 */ 435 436 /** Successfully forwarded request packet */ 437 ProbePoints::PacketUPtr ppPktReq; 438 439 /** Successfully forwarded response packet */ 440 ProbePoints::PacketUPtr ppPktResp; 441 442 /** @} */ 443}; 444 445#endif //__MEM_COMM_MONITOR_HH__ | 410 /** Instantiate stats */ 411 MonitorStats stats; 412 413 protected: // Probe points 414 /** 415 * @{ 416 * @name Memory system probe points 417 */ 418 419 /** Successfully forwarded request packet */ 420 ProbePoints::PacketUPtr ppPktReq; 421 422 /** Successfully forwarded response packet */ 423 ProbePoints::PacketUPtr ppPktResp; 424 425 /** @} */ 426}; 427 428#endif //__MEM_COMM_MONITOR_HH__ |