Deleted Added
sdiff udiff text old ( 13624:3d8220c2d41d ) new ( 13963:94555f0223ba )
full compact
1/**
2 * Copyright (c) 2018 Metempsy Technology Consulting
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;

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

37 * The 2nd Data Prefetching Championship (DPC2)
38 * The filter feature described in the paper is not implemented, as it
39 * redundant prefetches are dropped by the cache.
40 */
41
42#ifndef __MEM_CACHE_PREFETCH_SIGNATURE_PATH_HH__
43#define __MEM_CACHE_PREFETCH_SIGNATURE_PATH_HH__
44
45#include "mem/cache/prefetch/associative_set.hh"
46#include "mem/cache/prefetch/queued.hh"
47#include "mem/packet.hh"
48
49struct SignaturePathPrefetcherParams;
50
51class SignaturePathPrefetcher : public QueuedPrefetcher
52{

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

57 typedef int16_t stride_t;
58
59 /** Number of strides stored in each pattern entry */
60 const unsigned stridesPerPatternEntry;
61 /** Number of bits to shift when generating a new signature */
62 const uint8_t signatureShift;
63 /** Size of the signature, in bits */
64 const signature_t signatureBits;
65 /** Maximum pattern entries counter value */
66 const uint8_t maxCounterValue;
67 /** Minimum confidence to issue a prefetch */
68 const double prefetchConfidenceThreshold;
69 /** Minimum confidence to keep navigating lookahead entries */
70 const double lookaheadConfidenceThreshold;
71
72 /** Signature entry data type */
73 struct SignatureEntry : public TaggedEntry
74 {

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

82 /** Signature table */
83 AssociativeSet<SignatureEntry> signatureTable;
84
85 /** A stride entry with its counter */
86 struct PatternStrideEntry
87 {
88 /** stride in a page in blkSize increments */
89 stride_t stride;
90 /** counter value (max value defined by maxCounterValue) */
91 uint8_t counter;
92 PatternStrideEntry() : stride(0), counter(0)
93 {}
94 };
95 /** Pattern entry data type, a set of stride and counter entries */
96 struct PatternEntry : public TaggedEntry
97 {
98 /** group of stides */
99 std::vector<PatternStrideEntry> strideEntries;
100 /** use counter, used by SPPv2 */
101 uint8_t counter;
102 PatternEntry(size_t num_strides) : strideEntries(num_strides),
103 counter(0)
104 {}
105
106 /** Reset the entries to their initial values */
107 void reset() override
108 {
109 for (auto &entry : strideEntries) {
110 entry.counter = 0;
111 entry.stride = 0;
112 }
113 counter = 0;
114 }
115
116 /**
117 * Returns the entry with the desired stride
118 * @param stride the stride to find
119 * @result a pointer to the entry, if the stride was found, or nullptr,
120 * if the stride was not found
121 */

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

130 }
131 return found_entry;
132 }
133
134 /**
135 * Gets the entry with the provided stride, if there is no entry with
136 * the associated stride, it replaces one of them.
137 * @param stride the stride to find
138 * @param max_counter_value maximum value of the confidence counters,
139 * it is used when no strides are found and an entry needs to be
140 * replaced
141 * @result reference to the selected entry
142 */
143 PatternStrideEntry &getStrideEntry(stride_t stride,
144 uint8_t max_counter_value);
145 };
146 /** Pattern table */
147 AssociativeSet<PatternEntry> patternTable;
148
149 /**
150 * Generates a new signature from an existing one and a new stride
151 * @param sig current signature
152 * @param str stride to add to the new signature

--- 137 unchanged lines hidden ---