base.cc (8533:8dac0abb7a1b) base.cc (8831:6c08a877af8f)
1/*
2 * Copyright (c) 2005 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;

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

38#include "arch/isa_traits.hh"
39#include "base/trace.hh"
40#include "config/the_isa.hh"
41#include "debug/HWPrefetch.hh"
42#include "mem/cache/prefetch/base.hh"
43#include "mem/cache/base.hh"
44#include "mem/request.hh"
45
1/*
2 * Copyright (c) 2005 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;

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

38#include "arch/isa_traits.hh"
39#include "base/trace.hh"
40#include "config/the_isa.hh"
41#include "debug/HWPrefetch.hh"
42#include "mem/cache/prefetch/base.hh"
43#include "mem/cache/base.hh"
44#include "mem/request.hh"
45
46BasePrefetcher::BasePrefetcher(const BaseCacheParams *p)
47 : size(p->prefetcher_size), pageStop(!p->prefetch_past_page),
48 serialSquash(p->prefetch_serial_squash),
49 onlyData(p->prefetch_data_accesses_only)
46BasePrefetcher::BasePrefetcher(const Params *p)
47 : SimObject(p), size(p->size), latency(p->latency), degree(p->degree),
48 useContextId(p->use_cpu_id), pageStop(!p->cross_pages),
49 serialSquash(p->serial_squash), onlyData(p->data_accesses_only)
50{
51}
52
53void
54BasePrefetcher::setCache(BaseCache *_cache)
55{
56 cache = _cache;
57 blkSize = cache->getBlockSize();
50{
51}
52
53void
54BasePrefetcher::setCache(BaseCache *_cache)
55{
56 cache = _cache;
57 blkSize = cache->getBlockSize();
58 _name = cache->name() + "-pf";
59}
60
61void
58}
59
60void
62BasePrefetcher::regStats(const std::string &name)
61BasePrefetcher::regStats()
63{
64 pfIdentified
62{
63 pfIdentified
65 .name(name + ".prefetcher.num_hwpf_identified")
64 .name(name() + ".prefetcher.num_hwpf_identified")
66 .desc("number of hwpf identified")
67 ;
68
69 pfMSHRHit
65 .desc("number of hwpf identified")
66 ;
67
68 pfMSHRHit
70 .name(name + ".prefetcher.num_hwpf_already_in_mshr")
69 .name(name() + ".prefetcher.num_hwpf_already_in_mshr")
71 .desc("number of hwpf that were already in mshr")
72 ;
73
74 pfCacheHit
70 .desc("number of hwpf that were already in mshr")
71 ;
72
73 pfCacheHit
75 .name(name + ".prefetcher.num_hwpf_already_in_cache")
74 .name(name() + ".prefetcher.num_hwpf_already_in_cache")
76 .desc("number of hwpf that were already in the cache")
77 ;
78
79 pfBufferHit
75 .desc("number of hwpf that were already in the cache")
76 ;
77
78 pfBufferHit
80 .name(name + ".prefetcher.num_hwpf_already_in_prefetcher")
79 .name(name() + ".prefetcher.num_hwpf_already_in_prefetcher")
81 .desc("number of hwpf that were already in the prefetch queue")
82 ;
83
84 pfRemovedFull
80 .desc("number of hwpf that were already in the prefetch queue")
81 ;
82
83 pfRemovedFull
85 .name(name + ".prefetcher.num_hwpf_evicted")
84 .name(name() + ".prefetcher.num_hwpf_evicted")
86 .desc("number of hwpf removed due to no buffer left")
87 ;
88
89 pfRemovedMSHR
85 .desc("number of hwpf removed due to no buffer left")
86 ;
87
88 pfRemovedMSHR
90 .name(name + ".prefetcher.num_hwpf_removed_MSHR_hit")
89 .name(name() + ".prefetcher.num_hwpf_removed_MSHR_hit")
91 .desc("number of hwpf removed because MSHR allocated")
92 ;
93
94 pfIssued
90 .desc("number of hwpf removed because MSHR allocated")
91 ;
92
93 pfIssued
95 .name(name + ".prefetcher.num_hwpf_issued")
94 .name(name() + ".prefetcher.num_hwpf_issued")
96 .desc("number of hwpf issued")
97 ;
98
99 pfSpanPage
95 .desc("number of hwpf issued")
96 ;
97
98 pfSpanPage
100 .name(name + ".prefetcher.num_hwpf_span_page")
99 .name(name() + ".prefetcher.num_hwpf_span_page")
101 .desc("number of hwpf spanning a virtual page")
102 ;
103
104 pfSquashed
100 .desc("number of hwpf spanning a virtual page")
101 ;
102
103 pfSquashed
105 .name(name + ".prefetcher.num_hwpf_squashed_from_miss")
104 .name(name() + ".prefetcher.num_hwpf_squashed_from_miss")
106 .desc("number of hwpf that got squashed due to a miss "
107 "aborting calculation time")
108 ;
109}
110
111inline bool
112BasePrefetcher::inCache(Addr addr)
113{

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

271 return pf.end();
272}
273
274bool
275BasePrefetcher::samePage(Addr a, Addr b)
276{
277 return roundDown(a, TheISA::VMPageSize) == roundDown(b, TheISA::VMPageSize);
278}
105 .desc("number of hwpf that got squashed due to a miss "
106 "aborting calculation time")
107 ;
108}
109
110inline bool
111BasePrefetcher::inCache(Addr addr)
112{

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

270 return pf.end();
271}
272
273bool
274BasePrefetcher::samePage(Addr a, Addr b)
275{
276 return roundDown(a, TheISA::VMPageSize) == roundDown(b, TheISA::VMPageSize);
277}
278
279