activity.hh (2689:dbf969c18a65) | activity.hh (5804:34fe9bbc6705) |
---|---|
1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 35 unchanged lines hidden (view full) --- 44 * its time buffer at the same time as all other stages. The 45 * ActivityRecorder also records if a stage has activity to do next 46 * cycle. The recorder keeps a count of these two. Thus any time the 47 * count is non-zero, there is either communication still in flight, 48 * or activity that still must be done, meaning that the CPU can not 49 * idle. If count is zero, then the CPU can safely idle as it has no 50 * more outstanding work to do. 51 */ | 1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 35 unchanged lines hidden (view full) --- 44 * its time buffer at the same time as all other stages. The 45 * ActivityRecorder also records if a stage has activity to do next 46 * cycle. The recorder keeps a count of these two. Thus any time the 47 * count is non-zero, there is either communication still in flight, 48 * or activity that still must be done, meaning that the CPU can not 49 * idle. If count is zero, then the CPU can safely idle as it has no 50 * more outstanding work to do. 51 */ |
52class ActivityRecorder { | 52class ActivityRecorder 53{ |
53 public: | 54 public: |
54 ActivityRecorder(int num_stages, int longest_latency, int count); | 55 ActivityRecorder(const std::string &name, int num_stages, 56 int longest_latency, int count); |
55 56 /** Records that there is activity this cycle. */ 57 void activity(); 58 59 /** Advances the activity buffer, decrementing the activityCount 60 * if active communication just left the time buffer, and 61 * determining if there is no activity. 62 */ --- 24 unchanged lines hidden (view full) --- 87 void dump(); 88 89 /** Debug function to ensure that the activity count matches the 90 * contents of the time buffer. 91 */ 92 void validate(); 93 94 private: | 57 58 /** Records that there is activity this cycle. */ 59 void activity(); 60 61 /** Advances the activity buffer, decrementing the activityCount 62 * if active communication just left the time buffer, and 63 * determining if there is no activity. 64 */ --- 24 unchanged lines hidden (view full) --- 89 void dump(); 90 91 /** Debug function to ensure that the activity count matches the 92 * contents of the time buffer. 93 */ 94 void validate(); 95 96 private: |
97 // provide name() for DPRINTF. 98 std::string _name; 99 const std::string &name() { return _name; } 100 |
|
95 /** Time buffer that tracks if any cycles has active communication 96 * in them. It should be as long as the longest communication 97 * latency in the system. Each time any time buffer is written, 98 * the activity buffer should also be written to. The 99 * activityBuffer is advanced along with all the other time 100 * buffers, so it should have a 1 somewhere in it only if there 101 * is active communication in a time buffer. 102 */ --- 24 unchanged lines hidden --- | 101 /** Time buffer that tracks if any cycles has active communication 102 * in them. It should be as long as the longest communication 103 * latency in the system. Each time any time buffer is written, 104 * the activity buffer should also be written to. The 105 * activityBuffer is advanced along with all the other time 106 * buffers, so it should have a 1 somewhere in it only if there 107 * is active communication in a time buffer. 108 */ --- 24 unchanged lines hidden --- |