Deleted Added
sdiff udiff text old ( 13423:a414d6fccc4e ) new ( 13424:1744211c9a65 )
full compact
1/*
2 * Copyright (c) 2012-2013, 2015 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

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

45 * Describes a strided prefetcher.
46 */
47
48#ifndef __MEM_CACHE_PREFETCH_STRIDE_HH__
49#define __MEM_CACHE_PREFETCH_STRIDE_HH__
50
51#include <string>
52#include <unordered_map>
53
54#include "base/types.hh"
55#include "mem/cache/prefetch/queued.hh"
56#include "mem/packet.hh"
57
58struct StridePrefetcherParams;
59
60class StridePrefetcher : public QueuedPrefetcher

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

85 int confidence;
86 };
87
88 class PCTable
89 {
90 public:
91 PCTable(int assoc, int sets, const std::string name) :
92 pcTableAssoc(assoc), pcTableSets(sets), _name(name) {}
93 StrideEntry** operator[] (int context) {
94 auto it = entries.find(context);
95 if (it != entries.end())
96 return it->second;
97
98 return allocateNewContext(context);
99 }
100
101 ~PCTable();
102 private:
103 const std::string name() {return _name; }
104 const int pcTableAssoc;
105 const int pcTableSets;
106 const std::string _name;
107 std::unordered_map<int, StrideEntry**> entries;
108
109 StrideEntry** allocateNewContext(int context);
110 };
111 PCTable pcTable;
112
113 /**
114 * Search for an entry in the pc table.
115 *
116 * @param pc The PC to look for.
117 * @param is_secure True if the target memory space is secure.

--- 17 unchanged lines hidden ---