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; --- 29 unchanged lines hidden (view full) --- 38 * (pp. 178-190). ACM. 39 */ 40 41#ifndef __MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__ 42#define __MEM_CACHE_PREFETCH_INDIRECT_MEMORY_HH__ 43 44#include <vector> 45 |
46#include "base/sat_counter.hh" |
47#include "mem/cache/prefetch/associative_set.hh" 48#include "mem/cache/prefetch/queued.hh" 49 50struct IndirectMemoryPrefetcherParams; 51 52class IndirectMemoryPrefetcher : public QueuedPrefetcher 53{ 54 /** Maximum number of prefetches generated per event */ 55 const unsigned int maxPrefetchDistance; 56 /** Shift values considered */ 57 const std::vector<int> shiftValues; 58 /** Counter threshold to start prefetching */ 59 const unsigned int prefetchThreshold; |
60 /** streamCounter value to trigger the streaming prefetcher */ 61 const int streamCounterThreshold; 62 /** Number of prefetches generated when using the streaming prefetcher */ 63 const int streamingDistance; 64 65 /** Prefetch Table Entry */ 66 struct PrefetchTableEntry : public TaggedEntry 67 { --- 12 unchanged lines hidden (view full) --- 80 bool enabled; 81 /** Current index value */ 82 int64_t index; 83 /** BaseAddr detected */ 84 Addr baseAddr; 85 /** Shift detected */ 86 int shift; 87 /** Confidence counter of the indirect fields */ |
88 SatCounter indirectCounter; |
89 /** 90 * This variable is set to indicate that there has been at least one 91 * match with the current index value. This information is later used 92 * when a new index is updated. If there were no increases in the 93 * indirectCounter, the counter is decremented. 94 */ 95 bool increasedIndirectCounter; 96 |
97 PrefetchTableEntry(unsigned indirect_counter_bits) 98 : TaggedEntry(), address(0), secure(false), streamCounter(0), 99 enabled(false), index(0), baseAddr(0), shift(0), 100 indirectCounter(indirect_counter_bits), 101 increasedIndirectCounter(false) |
102 {} 103 104 void reset() override { 105 address = 0; 106 secure = false; 107 streamCounter = 0; 108 enabled = false; 109 index = 0; 110 baseAddr = 0; 111 shift = 0; |
112 indirectCounter.reset(); |
113 increasedIndirectCounter = false; 114 } 115 }; 116 /** Prefetch table */ 117 AssociativeSet<PrefetchTableEntry> prefetchTable; 118 119 /** Indirect Pattern Detector entrt */ 120 struct IndirectPatternDetectorEntry : public TaggedEntry --- 75 unchanged lines hidden --- |