gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
base.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2013 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
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2003-2005 The Regents of The University of Michigan
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  *
40  * Authors: Erik Hallnor
41  */
42 
48 #include "mem/cache/base.hh"
49 
50 #include "debug/Cache.hh"
51 #include "debug/Drain.hh"
52 #include "mem/cache/cache.hh"
53 #include "mem/cache/mshr.hh"
54 #include "mem/cache/tags/fa_lru.hh"
55 #include "mem/cache/tags/lru.hh"
57 #include "sim/full_system.hh"
58 
59 using namespace std;
60 
62  BaseCache *_cache,
63  const std::string &_label)
64  : QueuedSlavePort(_name, _cache, queue), queue(*_cache, *this, _label),
65  blocked(false), mustSendRetry(false), sendRetryEvent(this)
66 {
67 }
68 
69 BaseCache::BaseCache(const BaseCacheParams *p, unsigned blk_size)
70  : MemObject(p),
71  cpuSidePort(nullptr), memSidePort(nullptr),
72  mshrQueue("MSHRs", p->mshrs, 0, p->demand_mshr_reserve), // see below
73  writeBuffer("write buffer", p->write_buffers, p->mshrs), // see below
74  blkSize(blk_size),
75  lookupLatency(p->tag_latency),
76  dataLatency(p->data_latency),
77  forwardLatency(p->tag_latency),
78  fillLatency(p->data_latency),
79  responseLatency(p->response_latency),
80  numTarget(p->tgts_per_mshr),
81  forwardSnoops(true),
82  isReadOnly(p->is_read_only),
83  blocked(0),
84  order(0),
85  noTargetMSHR(nullptr),
86  missCount(p->max_miss_count),
87  addrRanges(p->addr_ranges.begin(), p->addr_ranges.end()),
88  system(p->system)
89 {
90  // the MSHR queue has no reserve entries as we check the MSHR
91  // queue on every single allocation, whereas the write queue has
92  // as many reserve entries as we have MSHRs, since every MSHR may
93  // eventually require a writeback, and we do not check the write
94  // buffer before committing to an MSHR
95 
96  // forward snoops is overridden in init() once we can query
97  // whether the connected master is actually snooping or not
98 }
99 
100 void
102 {
103  assert(!blocked);
104  DPRINTF(CachePort, "Port is blocking new requests\n");
105  blocked = true;
106  // if we already scheduled a retry in this cycle, but it has not yet
107  // happened, cancel it
108  if (sendRetryEvent.scheduled()) {
110  DPRINTF(CachePort, "Port descheduled retry\n");
111  mustSendRetry = true;
112  }
113 }
114 
115 void
117 {
118  assert(blocked);
119  DPRINTF(CachePort, "Port is accepting new requests\n");
120  blocked = false;
121  if (mustSendRetry) {
122  // @TODO: need to find a better time (next cycle?)
123  owner.schedule(sendRetryEvent, curTick() + 1);
124  }
125 }
126 
127 void
129 {
130  DPRINTF(CachePort, "Port is sending retry\n");
131 
132  // reset the flag and call retry
133  mustSendRetry = false;
134  sendRetryReq();
135 }
136 
137 void
139 {
141  fatal("Cache ports on %s are not connected\n", name());
144 }
145 
147 BaseCache::getMasterPort(const std::string &if_name, PortID idx)
148 {
149  if (if_name == "mem_side") {
150  return *memSidePort;
151  } else {
152  return MemObject::getMasterPort(if_name, idx);
153  }
154 }
155 
157 BaseCache::getSlavePort(const std::string &if_name, PortID idx)
158 {
159  if (if_name == "cpu_side") {
160  return *cpuSidePort;
161  } else {
162  return MemObject::getSlavePort(if_name, idx);
163  }
164 }
165 
166 bool
168 {
169  for (const auto& r : addrRanges) {
170  if (r.contains(addr)) {
171  return true;
172  }
173  }
174  return false;
175 }
176 
177 void
179 {
181 
182  using namespace Stats;
183 
184  // Hit statistics
185  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
186  MemCmd cmd(access_idx);
187  const string &cstr = cmd.toString();
188 
189  hits[access_idx]
190  .init(system->maxMasters())
191  .name(name() + "." + cstr + "_hits")
192  .desc("number of " + cstr + " hits")
193  .flags(total | nozero | nonan)
194  ;
195  for (int i = 0; i < system->maxMasters(); i++) {
196  hits[access_idx].subname(i, system->getMasterName(i));
197  }
198  }
199 
200 // These macros make it easier to sum the right subset of commands and
201 // to change the subset of commands that are considered "demand" vs
202 // "non-demand"
203 #define SUM_DEMAND(s) \
204  (s[MemCmd::ReadReq] + s[MemCmd::WriteReq] + s[MemCmd::WriteLineReq] + \
205  s[MemCmd::ReadExReq] + s[MemCmd::ReadCleanReq] + s[MemCmd::ReadSharedReq])
206 
207 // should writebacks be included here? prior code was inconsistent...
208 #define SUM_NON_DEMAND(s) \
209  (s[MemCmd::SoftPFReq] + s[MemCmd::HardPFReq])
210 
211  demandHits
212  .name(name() + ".demand_hits")
213  .desc("number of demand (read+write) hits")
214  .flags(total | nozero | nonan)
215  ;
217  for (int i = 0; i < system->maxMasters(); i++) {
219  }
220 
222  .name(name() + ".overall_hits")
223  .desc("number of overall hits")
224  .flags(total | nozero | nonan)
225  ;
227  for (int i = 0; i < system->maxMasters(); i++) {
229  }
230 
231  // Miss statistics
232  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
233  MemCmd cmd(access_idx);
234  const string &cstr = cmd.toString();
235 
236  misses[access_idx]
237  .init(system->maxMasters())
238  .name(name() + "." + cstr + "_misses")
239  .desc("number of " + cstr + " misses")
240  .flags(total | nozero | nonan)
241  ;
242  for (int i = 0; i < system->maxMasters(); i++) {
243  misses[access_idx].subname(i, system->getMasterName(i));
244  }
245  }
246 
248  .name(name() + ".demand_misses")
249  .desc("number of demand (read+write) misses")
250  .flags(total | nozero | nonan)
251  ;
253  for (int i = 0; i < system->maxMasters(); i++) {
255  }
256 
258  .name(name() + ".overall_misses")
259  .desc("number of overall misses")
260  .flags(total | nozero | nonan)
261  ;
263  for (int i = 0; i < system->maxMasters(); i++) {
265  }
266 
267  // Miss latency statistics
268  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
269  MemCmd cmd(access_idx);
270  const string &cstr = cmd.toString();
271 
272  missLatency[access_idx]
273  .init(system->maxMasters())
274  .name(name() + "." + cstr + "_miss_latency")
275  .desc("number of " + cstr + " miss cycles")
276  .flags(total | nozero | nonan)
277  ;
278  for (int i = 0; i < system->maxMasters(); i++) {
279  missLatency[access_idx].subname(i, system->getMasterName(i));
280  }
281  }
282 
284  .name(name() + ".demand_miss_latency")
285  .desc("number of demand (read+write) miss cycles")
286  .flags(total | nozero | nonan)
287  ;
289  for (int i = 0; i < system->maxMasters(); i++) {
291  }
292 
294  .name(name() + ".overall_miss_latency")
295  .desc("number of overall miss cycles")
296  .flags(total | nozero | nonan)
297  ;
299  for (int i = 0; i < system->maxMasters(); i++) {
301  }
302 
303  // access formulas
304  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
305  MemCmd cmd(access_idx);
306  const string &cstr = cmd.toString();
307 
308  accesses[access_idx]
309  .name(name() + "." + cstr + "_accesses")
310  .desc("number of " + cstr + " accesses(hits+misses)")
311  .flags(total | nozero | nonan)
312  ;
313  accesses[access_idx] = hits[access_idx] + misses[access_idx];
314 
315  for (int i = 0; i < system->maxMasters(); i++) {
316  accesses[access_idx].subname(i, system->getMasterName(i));
317  }
318  }
319 
321  .name(name() + ".demand_accesses")
322  .desc("number of demand (read+write) accesses")
323  .flags(total | nozero | nonan)
324  ;
326  for (int i = 0; i < system->maxMasters(); i++) {
328  }
329 
331  .name(name() + ".overall_accesses")
332  .desc("number of overall (read+write) accesses")
333  .flags(total | nozero | nonan)
334  ;
336  for (int i = 0; i < system->maxMasters(); i++) {
338  }
339 
340  // miss rate formulas
341  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
342  MemCmd cmd(access_idx);
343  const string &cstr = cmd.toString();
344 
345  missRate[access_idx]
346  .name(name() + "." + cstr + "_miss_rate")
347  .desc("miss rate for " + cstr + " accesses")
348  .flags(total | nozero | nonan)
349  ;
350  missRate[access_idx] = misses[access_idx] / accesses[access_idx];
351 
352  for (int i = 0; i < system->maxMasters(); i++) {
353  missRate[access_idx].subname(i, system->getMasterName(i));
354  }
355  }
356 
358  .name(name() + ".demand_miss_rate")
359  .desc("miss rate for demand accesses")
360  .flags(total | nozero | nonan)
361  ;
363  for (int i = 0; i < system->maxMasters(); i++) {
365  }
366 
368  .name(name() + ".overall_miss_rate")
369  .desc("miss rate for overall accesses")
370  .flags(total | nozero | nonan)
371  ;
373  for (int i = 0; i < system->maxMasters(); i++) {
375  }
376 
377  // miss latency formulas
378  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
379  MemCmd cmd(access_idx);
380  const string &cstr = cmd.toString();
381 
382  avgMissLatency[access_idx]
383  .name(name() + "." + cstr + "_avg_miss_latency")
384  .desc("average " + cstr + " miss latency")
385  .flags(total | nozero | nonan)
386  ;
387  avgMissLatency[access_idx] =
388  missLatency[access_idx] / misses[access_idx];
389 
390  for (int i = 0; i < system->maxMasters(); i++) {
391  avgMissLatency[access_idx].subname(i, system->getMasterName(i));
392  }
393  }
394 
396  .name(name() + ".demand_avg_miss_latency")
397  .desc("average overall miss latency")
398  .flags(total | nozero | nonan)
399  ;
401  for (int i = 0; i < system->maxMasters(); i++) {
403  }
404 
406  .name(name() + ".overall_avg_miss_latency")
407  .desc("average overall miss latency")
408  .flags(total | nozero | nonan)
409  ;
411  for (int i = 0; i < system->maxMasters(); i++) {
413  }
414 
417  .name(name() + ".blocked_cycles")
418  .desc("number of cycles access was blocked")
419  .subname(Blocked_NoMSHRs, "no_mshrs")
420  .subname(Blocked_NoTargets, "no_targets")
421  ;
422 
423 
426  .name(name() + ".blocked")
427  .desc("number of cycles access was blocked")
428  .subname(Blocked_NoMSHRs, "no_mshrs")
429  .subname(Blocked_NoTargets, "no_targets")
430  ;
431 
433  .name(name() + ".avg_blocked_cycles")
434  .desc("average number of cycles each access was blocked")
435  .subname(Blocked_NoMSHRs, "no_mshrs")
436  .subname(Blocked_NoTargets, "no_targets")
437  ;
438 
440 
442  .name(name() + ".unused_prefetches")
443  .desc("number of HardPF blocks evicted w/o reference")
444  .flags(nozero)
445  ;
446 
447  writebacks
448  .init(system->maxMasters())
449  .name(name() + ".writebacks")
450  .desc("number of writebacks")
451  .flags(total | nozero | nonan)
452  ;
453  for (int i = 0; i < system->maxMasters(); i++) {
455  }
456 
457  // MSHR statistics
458  // MSHR hit statistics
459  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
460  MemCmd cmd(access_idx);
461  const string &cstr = cmd.toString();
462 
463  mshr_hits[access_idx]
464  .init(system->maxMasters())
465  .name(name() + "." + cstr + "_mshr_hits")
466  .desc("number of " + cstr + " MSHR hits")
467  .flags(total | nozero | nonan)
468  ;
469  for (int i = 0; i < system->maxMasters(); i++) {
470  mshr_hits[access_idx].subname(i, system->getMasterName(i));
471  }
472  }
473 
475  .name(name() + ".demand_mshr_hits")
476  .desc("number of demand (read+write) MSHR hits")
477  .flags(total | nozero | nonan)
478  ;
480  for (int i = 0; i < system->maxMasters(); i++) {
482  }
483 
485  .name(name() + ".overall_mshr_hits")
486  .desc("number of overall MSHR hits")
487  .flags(total | nozero | nonan)
488  ;
490  for (int i = 0; i < system->maxMasters(); i++) {
492  }
493 
494  // MSHR miss statistics
495  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
496  MemCmd cmd(access_idx);
497  const string &cstr = cmd.toString();
498 
499  mshr_misses[access_idx]
500  .init(system->maxMasters())
501  .name(name() + "." + cstr + "_mshr_misses")
502  .desc("number of " + cstr + " MSHR misses")
503  .flags(total | nozero | nonan)
504  ;
505  for (int i = 0; i < system->maxMasters(); i++) {
506  mshr_misses[access_idx].subname(i, system->getMasterName(i));
507  }
508  }
509 
511  .name(name() + ".demand_mshr_misses")
512  .desc("number of demand (read+write) MSHR misses")
513  .flags(total | nozero | nonan)
514  ;
516  for (int i = 0; i < system->maxMasters(); i++) {
518  }
519 
521  .name(name() + ".overall_mshr_misses")
522  .desc("number of overall MSHR misses")
523  .flags(total | nozero | nonan)
524  ;
526  for (int i = 0; i < system->maxMasters(); i++) {
528  }
529 
530  // MSHR miss latency statistics
531  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
532  MemCmd cmd(access_idx);
533  const string &cstr = cmd.toString();
534 
535  mshr_miss_latency[access_idx]
536  .init(system->maxMasters())
537  .name(name() + "." + cstr + "_mshr_miss_latency")
538  .desc("number of " + cstr + " MSHR miss cycles")
539  .flags(total | nozero | nonan)
540  ;
541  for (int i = 0; i < system->maxMasters(); i++) {
543  }
544  }
545 
547  .name(name() + ".demand_mshr_miss_latency")
548  .desc("number of demand (read+write) MSHR miss cycles")
549  .flags(total | nozero | nonan)
550  ;
552  for (int i = 0; i < system->maxMasters(); i++) {
554  }
555 
557  .name(name() + ".overall_mshr_miss_latency")
558  .desc("number of overall MSHR miss cycles")
559  .flags(total | nozero | nonan)
560  ;
563  for (int i = 0; i < system->maxMasters(); i++) {
565  }
566 
567  // MSHR uncacheable statistics
568  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
569  MemCmd cmd(access_idx);
570  const string &cstr = cmd.toString();
571 
572  mshr_uncacheable[access_idx]
573  .init(system->maxMasters())
574  .name(name() + "." + cstr + "_mshr_uncacheable")
575  .desc("number of " + cstr + " MSHR uncacheable")
576  .flags(total | nozero | nonan)
577  ;
578  for (int i = 0; i < system->maxMasters(); i++) {
580  }
581  }
582 
584  .name(name() + ".overall_mshr_uncacheable_misses")
585  .desc("number of overall MSHR uncacheable misses")
586  .flags(total | nozero | nonan)
587  ;
590  for (int i = 0; i < system->maxMasters(); i++) {
592  }
593 
594  // MSHR miss latency statistics
595  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
596  MemCmd cmd(access_idx);
597  const string &cstr = cmd.toString();
598 
599  mshr_uncacheable_lat[access_idx]
600  .init(system->maxMasters())
601  .name(name() + "." + cstr + "_mshr_uncacheable_latency")
602  .desc("number of " + cstr + " MSHR uncacheable cycles")
603  .flags(total | nozero | nonan)
604  ;
605  for (int i = 0; i < system->maxMasters(); i++) {
606  mshr_uncacheable_lat[access_idx].subname(
607  i, system->getMasterName(i));
608  }
609  }
610 
612  .name(name() + ".overall_mshr_uncacheable_latency")
613  .desc("number of overall MSHR uncacheable cycles")
614  .flags(total | nozero | nonan)
615  ;
619  for (int i = 0; i < system->maxMasters(); i++) {
621  }
622 
623 #if 0
624  // MSHR access formulas
625  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
626  MemCmd cmd(access_idx);
627  const string &cstr = cmd.toString();
628 
629  mshrAccesses[access_idx]
630  .name(name() + "." + cstr + "_mshr_accesses")
631  .desc("number of " + cstr + " mshr accesses(hits+misses)")
632  .flags(total | nozero | nonan)
633  ;
634  mshrAccesses[access_idx] =
635  mshr_hits[access_idx] + mshr_misses[access_idx]
636  + mshr_uncacheable[access_idx];
637  }
638 
639  demandMshrAccesses
640  .name(name() + ".demand_mshr_accesses")
641  .desc("number of demand (read+write) mshr accesses")
642  .flags(total | nozero | nonan)
643  ;
644  demandMshrAccesses = demandMshrHits + demandMshrMisses;
645 
646  overallMshrAccesses
647  .name(name() + ".overall_mshr_accesses")
648  .desc("number of overall (read+write) mshr accesses")
649  .flags(total | nozero | nonan)
650  ;
651  overallMshrAccesses = overallMshrHits + overallMshrMisses
653 #endif
654 
655  // MSHR miss rate formulas
656  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
657  MemCmd cmd(access_idx);
658  const string &cstr = cmd.toString();
659 
660  mshrMissRate[access_idx]
661  .name(name() + "." + cstr + "_mshr_miss_rate")
662  .desc("mshr miss rate for " + cstr + " accesses")
663  .flags(total | nozero | nonan)
664  ;
665  mshrMissRate[access_idx] =
666  mshr_misses[access_idx] / accesses[access_idx];
667 
668  for (int i = 0; i < system->maxMasters(); i++) {
669  mshrMissRate[access_idx].subname(i, system->getMasterName(i));
670  }
671  }
672 
674  .name(name() + ".demand_mshr_miss_rate")
675  .desc("mshr miss rate for demand accesses")
676  .flags(total | nozero | nonan)
677  ;
679  for (int i = 0; i < system->maxMasters(); i++) {
681  }
682 
684  .name(name() + ".overall_mshr_miss_rate")
685  .desc("mshr miss rate for overall accesses")
686  .flags(total | nozero | nonan)
687  ;
689  for (int i = 0; i < system->maxMasters(); i++) {
691  }
692 
693  // mshrMiss latency formulas
694  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
695  MemCmd cmd(access_idx);
696  const string &cstr = cmd.toString();
697 
698  avgMshrMissLatency[access_idx]
699  .name(name() + "." + cstr + "_avg_mshr_miss_latency")
700  .desc("average " + cstr + " mshr miss latency")
701  .flags(total | nozero | nonan)
702  ;
703  avgMshrMissLatency[access_idx] =
704  mshr_miss_latency[access_idx] / mshr_misses[access_idx];
705 
706  for (int i = 0; i < system->maxMasters(); i++) {
707  avgMshrMissLatency[access_idx].subname(
708  i, system->getMasterName(i));
709  }
710  }
711 
713  .name(name() + ".demand_avg_mshr_miss_latency")
714  .desc("average overall mshr miss latency")
715  .flags(total | nozero | nonan)
716  ;
718  for (int i = 0; i < system->maxMasters(); i++) {
720  }
721 
723  .name(name() + ".overall_avg_mshr_miss_latency")
724  .desc("average overall mshr miss latency")
725  .flags(total | nozero | nonan)
726  ;
728  for (int i = 0; i < system->maxMasters(); i++) {
730  }
731 
732  // mshrUncacheable latency formulas
733  for (int access_idx = 0; access_idx < MemCmd::NUM_MEM_CMDS; ++access_idx) {
734  MemCmd cmd(access_idx);
735  const string &cstr = cmd.toString();
736 
737  avgMshrUncacheableLatency[access_idx]
738  .name(name() + "." + cstr + "_avg_mshr_uncacheable_latency")
739  .desc("average " + cstr + " mshr uncacheable latency")
740  .flags(total | nozero | nonan)
741  ;
742  avgMshrUncacheableLatency[access_idx] =
743  mshr_uncacheable_lat[access_idx] / mshr_uncacheable[access_idx];
744 
745  for (int i = 0; i < system->maxMasters(); i++) {
747  i, system->getMasterName(i));
748  }
749  }
750 
752  .name(name() + ".overall_avg_mshr_uncacheable_latency")
753  .desc("average overall mshr uncacheable latency")
754  .flags(total | nozero | nonan)
755  ;
758  for (int i = 0; i < system->maxMasters(); i++) {
760  }
761 
762 }
Miss Status and Handling Register (MSHR) declaration.
Stats::Formula demandMshrMissRate
The demand miss rate in the MSHRs.
Definition: base.hh:441
#define DPRINTF(x,...)
Definition: trace.hh:212
MemObject & owner
A reference to the MemObject that owns this port.
Definition: port.hh:80
virtual void regStats()
Register stats for this object.
Definition: base.cc:178
bool forwardSnoops
Do we forward snoops from mem side port through to cpu side port?
Definition: base.hh:294
Declares a basic cache interface BaseCache.
BaseCache(const BaseCacheParams *p, unsigned blk_size)
Definition: base.cc:69
Stats::Formula overallMisses
Number of misses for all accesses.
Definition: base.hh:351
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation...
Definition: statistics.hh:358
Definition: packet.hh:73
Stats::Formula demandMissRate
The miss rate of all demand accesses.
Definition: base.hh:373
Bitfield< 7 > i
Definition: miscregs.hh:1378
std::string getMasterName(MasterID master_id)
Get the name of an object for a given request id.
Definition: system.cc:490
WriteQueue writeBuffer
Write/writeback buffer.
Definition: base.hh:194
const FlagsType nonan
Don't print if this is NAN.
Definition: info.hh:59
MSHR * noTargetMSHR
Pointer to the MSHR that has no targets.
Definition: base.hh:317
#define SUM_NON_DEMAND(s)
Stats::Formula demandMshrMisses
Demand misses that miss in the MSHRs.
Definition: base.hh:408
const Cycles lookupLatency
The latency of tag lookup of a cache.
Definition: base.hh:265
Stats::Scalar unusedPrefetches
The number of times a HW-prefetched block is evicted w/o reference.
Definition: base.hh:393
Stats::Formula demandAvgMshrMissLatency
The average latency of a demand MSHR miss.
Definition: base.hh:448
Stats::Formula avgMshrMissLatency[MemCmd::NUM_MEM_CMDS]
The average latency of an MSHR miss, per command and thread.
Definition: base.hh:446
Declaration of a LRU tag store.
virtual BaseSlavePort & getSlavePort(const std::string &if_name, PortID idx=InvalidPortID)
Get a slave port with a given name and index.
Definition: base.cc:157
#define SUM_DEMAND(s)
ip6_addr_t addr
Definition: inet.hh:335
System * system
System we are currently operating in.
Definition: base.hh:329
Stats::Formula demandHits
Number of hits for demand accesses.
Definition: base.hh:341
const bool isReadOnly
Is this cache read only, for example the instruction cache, or table-walker cache.
Definition: base.hh:302
CacheSlavePort * cpuSidePort
Definition: base.hh:185
const AddrRangeList addrRanges
The address range to which the cache responds on the CPU side.
Definition: base.hh:325
bool inRange(Addr addr) const
Determine if an address is in the ranges covered by this cache.
Definition: base.cc:167
A queued port is a port that has an infinite queue for outgoing packets and thus decouples the module...
Definition: qport.hh:59
const Cycles dataLatency
The latency of data access of a cache.
Definition: base.hh:271
virtual BaseSlavePort & getSlavePort(const std::string &if_name, PortID idx=InvalidPortID)
Get a slave port with a given name and index.
Definition: mem_object.cc:58
Stats::Formula accesses[MemCmd::NUM_MEM_CMDS]
The number of accesses per command and thread.
Definition: base.hh:364
const Cycles fillLatency
The latency to fill a cache block.
Definition: base.hh:281
Stats::Formula overallMshrMisses
Total number of misses that miss in the MSHRs.
Definition: base.hh:410
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
Definition: statistics.hh:311
A BaseSlavePort is a protocol-agnostic slave port, responsible only for the structural connection to ...
Definition: port.hh:139
Stats::Formula demandAccesses
The number of demand accesses.
Definition: base.hh:366
Derived & init(size_type size)
Set this vector to have the given size.
Definition: statistics.hh:1118
void deschedule(Event &event)
Definition: eventq.hh:734
Stats::Vector blocked_cycles
The total number of cycles blocked for each blocked cause.
Definition: base.hh:385
Declaration of a fully associative LRU tag store.
Stats::Vector blocked_causes
The number of times this cache blocked for each blocked cause.
Definition: base.hh:387
Stats::Vector hits[MemCmd::NUM_MEM_CMDS]
Number of hits per thread for each type of command.
Definition: base.hh:339
Stats::Vector mshr_uncacheable_lat[MemCmd::NUM_MEM_CMDS]
Total cycle latency of each MSHR miss, per command and thread.
Definition: base.hh:425
Stats::Formula overallAvgMshrUncacheableLatency
The average overall latency of an MSHR miss.
Definition: base.hh:455
const Cycles responseLatency
The latency of sending reponse to its upper level cache/core on a linefill.
Definition: base.hh:288
Stats::Formula overallMissLatency
Total number of cycles spent waiting for all misses.
Definition: base.hh:361
bool isSnooping() const
Find out if the peer master port is snooping or not.
Definition: port.hh:405
Stats::Formula avgMissLatency[MemCmd::NUM_MEM_CMDS]
The average miss latency per command and thread.
Definition: base.hh:378
Stats::Formula demandAvgMissLatency
The average miss latency for demand misses.
Definition: base.hh:380
EventWrapper< CacheSlavePort,&CacheSlavePort::processSendRetry > sendRetryEvent
Definition: base.hh:181
Stats::Formula overallMshrUncacheable
Total number of misses that miss in the MSHRs.
Definition: base.hh:415
Tick curTick()
The current simulated tick.
Definition: core.hh:47
CacheSlavePort(const std::string &_name, BaseCache *_cache, const std::string &_label)
Definition: base.cc:61
Stats::Formula demandMshrHits
Demand misses that hit in the MSHRs.
Definition: base.hh:401
Stats::Formula overallAvgMissLatency
The average miss latency for all misses.
Definition: base.hh:382
Stats::Vector writebacks
Number of blocks written back per thread.
Definition: base.hh:396
Stats::Formula overallMshrHits
Total number of misses that hit in the MSHRs.
Definition: base.hh:403
Stats::Formula demandMisses
Number of misses for demand accesses.
Definition: base.hh:349
CacheMasterPort * memSidePort
Definition: base.hh:186
Stats::Formula missRate[MemCmd::NUM_MEM_CMDS]
The miss rate per command and thread.
Definition: base.hh:371
#define fatal(...)
Definition: misc.hh:163
A basic cache interface.
Definition: base.hh:79
Stats::Vector missLatency[MemCmd::NUM_MEM_CMDS]
Total number of cycles per thread/command spent waiting for a miss.
Definition: base.hh:357
Stats::Formula overallMshrMissLatency
Total cycle latency of overall MSHR misses.
Definition: base.hh:422
void setBlocked()
Do not accept any new requests.
Definition: base.cc:101
Stats::Formula overallMshrUncacheableLatency
Total cycle latency of overall MSHR misses.
Definition: base.hh:427
uint8_t blocked
Bit vector of the blocking reasons for the access path.
Definition: base.hh:308
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Stats::Vector mshr_misses[MemCmd::NUM_MEM_CMDS]
Number of misses that miss in the MSHRs, per command and thread.
Definition: base.hh:406
const unsigned blkSize
Block size of this cache.
Definition: base.hh:259
virtual BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a master port with a given name and index.
Definition: base.cc:147
Stats::Vector mshr_hits[MemCmd::NUM_MEM_CMDS]
Number of misses that hit in the MSHRs per command and thread.
Definition: base.hh:399
uint64_t order
Increasing order number assigned to each incoming request.
Definition: base.hh:311
Stats::Formula avgMshrUncacheableLatency[MemCmd::NUM_MEM_CMDS]
The average latency of an MSHR miss, per command and thread.
Definition: base.hh:453
const FlagsType total
Print the total.
Definition: info.hh:49
Stats::Formula avg_blocked
The average number of cycles blocked for each blocked cause.
Definition: base.hh:390
void sendRangeChange() const
Called by the owner to send a range change.
Definition: port.hh:410
MasterID maxMasters()
Get the number of masters registered in the system.
Definition: system.hh:344
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
Definition: statistics.hh:254
bool isConnected() const
Definition: port.cc:84
Stats::Formula mshrMissRate[MemCmd::NUM_MEM_CMDS]
The miss rate in the MSHRs pre command and thread.
Definition: base.hh:439
Stats::Vector misses[MemCmd::NUM_MEM_CMDS]
Number of misses per thread for each type of command.
Definition: base.hh:347
Stats::Vector mshr_miss_latency[MemCmd::NUM_MEM_CMDS]
Total cycle latency of each MSHR miss, per command and thread.
Definition: base.hh:418
virtual const std::string name() const
Definition: sim_object.hh:117
Stats::Formula overallAvgMshrMissLatency
The average overall latency of an MSHR miss.
Definition: base.hh:450
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
Definition: mem_object.hh:60
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
Definition: port.hh:115
Stats::Vector mshr_uncacheable[MemCmd::NUM_MEM_CMDS]
Number of misses that miss in the MSHRs, per command and thread.
Definition: base.hh:413
bool isConnected() const
Definition: port.cc:110
const std::string & toString() const
Return the string to a cmd given by idx.
Definition: packet.hh:227
const int numTarget
The number of targets for each MSHR.
Definition: base.hh:291
const Cycles forwardLatency
This is the forward latency of the cache.
Definition: base.hh:278
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Definition: statistics.hh:287
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:181
Stats::Formula overallMshrMissRate
The overall miss rate in the MSHRs.
Definition: base.hh:443
Counter missCount
The number of misses to trigger an exit event.
Definition: base.hh:320
Stats::Formula demandMissLatency
Total number of cycles spent waiting for demand misses.
Definition: base.hh:359
Stats::Formula overallAccesses
The number of overall accesses.
Definition: base.hh:368
Stats::Formula demandMshrMissLatency
Total cycle latency of demand MSHR misses.
Definition: base.hh:420
const FlagsType nozero
Don't print if this is zero.
Definition: info.hh:57
Bitfield< 0 > p
Describes a cache based on template policies.
Stats::Formula overallHits
Number of hit for all accesses.
Definition: base.hh:343
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: base.cc:138
Declaration of a random replacement tag store.
void regStats() override
Register statistics for this object.
virtual BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a master port with a given name and index.
Definition: mem_object.cc:52
Stats::Formula overallMissRate
The miss rate for all accesses.
Definition: base.hh:375
MSHRQueue mshrQueue
Miss status registers.
Definition: base.hh:191
void clearBlocked()
Return to normal operation and accept new requests.
Definition: base.cc:116

Generated on Fri Jun 9 2017 13:03:41 for gem5 by doxygen 1.8.6