Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#7287: Decouple Cache Replacement Policies. #7314

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7c3a719
i7291: support large pages in TLB
oralmer Feb 20, 2025
a83b0bc
fix format in utils.h
oralmer Feb 20, 2025
f33094e
CR fixes - change to int64_t and add release dox
oralmer Feb 23, 2025
bf265f7
fix base type for shift
oralmer Feb 24, 2025
145b0ec
fix format
oralmer Feb 24, 2025
2ef1000
Fixed return type - CI
oralmer Feb 24, 2025
42862d7
Fixed return type - CI
oralmer Feb 24, 2025
bb2c486
CR Fixes - grammer and link in release doc
oralmer Feb 25, 2025
3ec1a36
remove link since this file cannot be accessed by doxygen
oralmer Feb 25, 2025
aa1438a
ix: Small Fixes - Consistent Naming, Error Printing, and `add_parent`.
oralmer Feb 26, 2025
2892ba7
merge i0-cleanups-and-fixes into i7291-tlb-page-sizes
oralmer Feb 26, 2025
06adc52
CR - check int size
oralmer Feb 26, 2025
d53db1a
Merged from master to fix alpine job
oralmer Mar 2, 2025
a8a3d2f
i#7287: Decouple Cache Replacement Policies.
oralmer Mar 2, 2025
90afe0d
Self CR fixes
oralmer Mar 2, 2025
c613e38
remove get parent
oralmer Mar 2, 2025
20952ff
merge from tlb-sizes
oralmer Mar 2, 2025
36ff2d8
formatting
oralmer Mar 2, 2025
a61e251
formatting
oralmer Mar 2, 2025
4cec4df
formatting
oralmer Mar 2, 2025
dce8dfe
Update total_size and num_lines types to int64_t
oralmer Mar 3, 2025
f977681
Update return type int64_t
oralmer Mar 3, 2025
e10e3e7
Update return type int64_t
oralmer Mar 3, 2025
a4b9328
CR fixes - docs and rename to policy_*
oralmer Mar 3, 2025
55f3223
CR fixes - docs and rename to policy_*
oralmer Mar 3, 2025
e923508
CR fixes - docs and rename to policy_*
oralmer Mar 3, 2025
2727ca1
cast to size_t
oralmer Mar 3, 2025
0e09b82
undo cast to size_t
oralmer Mar 3, 2025
9168c9a
undo cast to size_t
oralmer Mar 3, 2025
c6bce93
merge from tlb sizes
oralmer Mar 3, 2025
dd96e61
auto format
oralmer Mar 3, 2025
c33d782
auto format
oralmer Mar 3, 2025
fd0ce67
auto format
oralmer Mar 3, 2025
3274cb3
auto format
oralmer Mar 3, 2025
ef4a09d
auto format
oralmer Mar 3, 2025
d601acc
Add set replace policy
oralmer Mar 3, 2025
37f5302
Add includes
oralmer Mar 3, 2025
b108ea7
CR fixes - format and release doc
oralmer Mar 4, 2025
69bf150
merge from tlb sizes
oralmer Mar 4, 2025
a7aa74d
CR fixes - sort includes, add comments, name changes
oralmer Mar 4, 2025
f52c09e
merge master
oralmer Mar 4, 2025
322b40c
CR fixes - added valid bits vector
oralmer Mar 9, 2025
33a0440
Merge branch 'master' into i7287-extract-cache-policies
oralmer Mar 9, 2025
991a956
Merge branch 'master' into i7287-extract-cache-policies
oralmer Mar 9, 2025
0ff6300
Fix test
oralmer Mar 9, 2025
d049132
Formatting
oralmer Mar 9, 2025
fd3aa95
Fix imports
oralmer Mar 9, 2025
2e6e9bc
add in\validation tracking to the policy, and renamed blocks to the m…
oralmer Mar 11, 2025
cc03a23
format
oralmer Mar 11, 2025
d9b9cb4
spelling
oralmer Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions clients/drcachesim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ configure_DynamoRIO_standalone(drmemtrace_invariant_checker)
add_exported_library(drmemtrace_simulator STATIC
simulator/simulator.cpp
simulator/cache.cpp
simulator/cache_lru.cpp
simulator/cache_fifo.cpp
simulator/cache_miss_analyzer.cpp
simulator/caching_device.cpp
simulator/caching_device_stats.cpp
Expand All @@ -204,6 +202,11 @@ add_exported_library(drmemtrace_simulator STATIC
simulator/snoop_filter.cpp
simulator/tlb.cpp
simulator/tlb_simulator.cpp
simulator/create_cache_replacement_policy.cpp
simulator/policy_bit_plru.cpp
simulator/policy_fifo.cpp
simulator/policy_lfu.cpp
simulator/policy_lru.cpp
)

add_exported_library(drmemtrace_record_filter STATIC
Expand Down
4 changes: 3 additions & 1 deletion clients/drcachesim/common/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,9 @@ droption_t<std::string>
"Specifies the replacement policy for TLBs. "
"Supported policies: " REPLACE_POLICY_LFU
" (Least Frequently Used), " REPLACE_POLICY_BIT_PLRU
" (Pseudo Least Recently Used).");
" (Pseudo Least Recently Used) " REPLACE_POLICY_LRU
" (Least Recently Used) " REPLACE_POLICY_FIFO
" (First-In-First-Out)");

droption_t<std::string>
op_tool(DROPTION_SCOPE_FRONTEND,
Expand Down
7 changes: 4 additions & 3 deletions clients/drcachesim/simulator/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class snoop_filter_t;
bool
cache_t::init(int associativity, int64_t line_size, int64_t total_size,
caching_device_t *parent, caching_device_stats_t *stats,
std::unique_ptr<cache_replacement_policy_t> replacement_policy,
prefetcher_t *prefetcher, cache_inclusion_policy_t inclusion_policy,
bool coherent_cache, int id, snoop_filter_t *snoop_filter,
const std::vector<caching_device_t *> &children)
Expand All @@ -65,9 +66,9 @@ cache_t::init(int associativity, int64_t line_size, int64_t total_size,
// convert total_size to num_blocks to fit for caching_device_t::init
int64_t num_lines = total_size / line_size;

return caching_device_t::init(associativity, line_size, num_lines, parent, stats,
prefetcher, inclusion_policy, coherent_cache, id,
snoop_filter, children);
return caching_device_t::init(
associativity, line_size, num_lines, parent, stats, std::move(replacement_policy),
prefetcher, inclusion_policy, coherent_cache, id, snoop_filter, children);
}

void
Expand Down
3 changes: 3 additions & 0 deletions clients/drcachesim/simulator/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
#define _CACHE_H_ 1

#include <string>
#include <memory>
#include <vector>

#include "cache_line.h"
#include "cache_replacement_policy.h"
#include "cache_stats.h"
#include "caching_device.h"
#include "memref.h"
Expand All @@ -63,6 +65,7 @@ class cache_t : public caching_device_t {
bool
init(int associativity, int64_t line_size, int64_t total_size,
caching_device_t *parent, caching_device_stats_t *stats,
std::unique_ptr<cache_replacement_policy_t> replacement_policy,
prefetcher_t *prefetcher = nullptr,
cache_inclusion_policy_t inclusion_policy =
cache_inclusion_policy_t::NON_INC_NON_EXC,
Expand Down
121 changes: 0 additions & 121 deletions clients/drcachesim/simulator/cache_fifo.cpp

This file was deleted.

120 changes: 0 additions & 120 deletions clients/drcachesim/simulator/cache_lru.cpp

This file was deleted.

Loading
Loading