Skip to content

Commit cdb5c25

Browse files
Marthenn1a1a11a
andauthored
integrated clockpro to the libCacheSim (#86)
* Integrated ClockPro * Uncomment tests * Add print support like Clock.c * Moved clockpro_status_e to cacheObj.h and gave it enumeration prefix --------- Co-authored-by: Juncheng Yang <1a1a11a@users.noreply.github.com>
1 parent a349f02 commit cdb5c25

7 files changed

Lines changed: 538 additions & 5 deletions

File tree

libCacheSim/bin/cachesim/cache_init.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ extern "C" {
1515
static inline cache_t *create_cache(const char *trace_path, const char *eviction_algo, const uint64_t cache_size,
1616
const char *eviction_params, const bool consider_obj_metadata) {
1717
common_cache_params_t cc_params = {
18-
.cache_size = cache_size,
19-
.default_ttl = 86400 * 300,
20-
.hashpower = 24,
21-
.consider_obj_metadata = consider_obj_metadata,
22-
};
18+
.cache_size = cache_size,
19+
.default_ttl = 86400 * 300,
20+
.hashpower = 24,
21+
.consider_obj_metadata = consider_obj_metadata,
22+
};
2323
cache_t *cache;
2424

2525
/* the trace provided is small */
@@ -105,6 +105,8 @@ static inline cache_t *create_cache(const char *trace_path, const char *eviction
105105
} else if (strcasecmp(eviction_algo, "fifo-reinsertion") == 0 || strcasecmp(eviction_algo, "clock") == 0 ||
106106
strcasecmp(eviction_algo, "second-chance") == 0) {
107107
cache = Clock_init(cc_params, eviction_params);
108+
} else if (strcasecmp(eviction_algo, "clockpro") == 0) {
109+
cache = ClockPro_init(cc_params, eviction_params);
108110
} else if (strcasecmp(eviction_algo, "lirs") == 0) {
109111
cache = LIRS_init(cc_params, eviction_params);
110112
} else if (strcasecmp(eviction_algo, "fifomerge") == 0 || strcasecmp(eviction_algo, "fifo-merge") == 0) {

libCacheSim/cache/eviction/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(sourceC
88
FIFO.c
99
LRU.c
1010
Clock.c
11+
ClockPro.c
1112
SLRU.c
1213
SLRUv0.c
1314
CR_LFU.c

0 commit comments

Comments
 (0)