irregular_stream_buffer.hh (13669:24ef552b4d6d) irregular_stream_buffer.hh (13963:94555f0223ba)
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;

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

36 * 46th Annual IEEE/ACM International Symposium on Microarchitecture
37 * (pp. 247-259). ACM.
38 */
39
40#ifndef __MEM_CACHE_PREFETCH_IRREGULAR_STREAM_BUFFER_HH__
41#define __MEM_CACHE_PREFETCH_IRREGULAR_STREAM_BUFFER_HH__
42
43#include "base/callback.hh"
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;

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

36 * 46th Annual IEEE/ACM International Symposium on Microarchitecture
37 * (pp. 247-259). ACM.
38 */
39
40#ifndef __MEM_CACHE_PREFETCH_IRREGULAR_STREAM_BUFFER_HH__
41#define __MEM_CACHE_PREFETCH_IRREGULAR_STREAM_BUFFER_HH__
42
43#include "base/callback.hh"
44#include "base/sat_counter.hh"
44#include "mem/cache/prefetch/associative_set.hh"
45#include "mem/cache/prefetch/queued.hh"
46
47struct IrregularStreamBufferPrefetcherParams;
48
49class IrregularStreamBufferPrefetcher : public QueuedPrefetcher
50{
45#include "mem/cache/prefetch/associative_set.hh"
46#include "mem/cache/prefetch/queued.hh"
47
48struct IrregularStreamBufferPrefetcherParams;
49
50class IrregularStreamBufferPrefetcher : public QueuedPrefetcher
51{
51 /** Maximum value of the confidence counters */
52 const unsigned maxCounterValue;
53 /** Size in bytes of a temporal stream */
54 const size_t chunkSize;
55 /** Number of prefetch candidates per Physical-to-Structural entry */
56 const unsigned prefetchCandidatesPerEntry;
57 /** Number of maximum prefetches requests created when predicting */
58 const unsigned degree;
59
60 /**

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

66 bool lastAddressSecure;
67 };
68 /** Map of PCs to Training unit entries */
69 AssociativeSet<TrainingUnitEntry> trainingUnit;
70
71 /** Address Mapping entry, holds an address and a confidence counter */
72 struct AddressMapping {
73 Addr address;
52 /** Size in bytes of a temporal stream */
53 const size_t chunkSize;
54 /** Number of prefetch candidates per Physical-to-Structural entry */
55 const unsigned prefetchCandidatesPerEntry;
56 /** Number of maximum prefetches requests created when predicting */
57 const unsigned degree;
58
59 /**

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

65 bool lastAddressSecure;
66 };
67 /** Map of PCs to Training unit entries */
68 AssociativeSet<TrainingUnitEntry> trainingUnit;
69
70 /** Address Mapping entry, holds an address and a confidence counter */
71 struct AddressMapping {
72 Addr address;
74 unsigned counter;
75 AddressMapping() : address(0), counter(0)
73 SatCounter counter;
74 AddressMapping(unsigned bits) : address(0), counter(bits)
76 {}
77 };
78
79 /**
80 * Maps a set of contiguous addresses to another set of (not necessarily
81 * contiguos) addresses, with their corresponding confidence counters
82 */
83 struct AddressMappingEntry : public TaggedEntry {
84 std::vector<AddressMapping> mappings;
75 {}
76 };
77
78 /**
79 * Maps a set of contiguous addresses to another set of (not necessarily
80 * contiguos) addresses, with their corresponding confidence counters
81 */
82 struct AddressMappingEntry : public TaggedEntry {
83 std::vector<AddressMapping> mappings;
85 AddressMappingEntry(size_t num_mappings) : mappings(num_mappings)
84 AddressMappingEntry(size_t num_mappings, unsigned counter_bits)
85 : mappings(num_mappings, counter_bits)
86 {}
87 void reset() override
88 {
89 for (auto &entry : mappings) {
90 entry.address = 0;
86 {}
87 void reset() override
88 {
89 for (auto &entry : mappings) {
90 entry.address = 0;
91 entry.counter = 0;
91 entry.counter.reset();
92 }
93 }
94 };
95
96 /** Physical-to-Structured mappings table */
97 AssociativeSet<AddressMappingEntry> psAddressMappingCache;
98 /** Structured-to-Physical mappings table */
99 AssociativeSet<AddressMappingEntry> spAddressMappingCache;

--- 32 unchanged lines hidden ---
92 }
93 }
94 };
95
96 /** Physical-to-Structured mappings table */
97 AssociativeSet<AddressMappingEntry> psAddressMappingCache;
98 /** Structured-to-Physical mappings table */
99 AssociativeSet<AddressMappingEntry> spAddressMappingCache;

--- 32 unchanged lines hidden ---