MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / _Mithril_check_sequential

Function _Mithril_check_sequential

libCacheSim/cache/prefetch/Mithril.c:492–514  ·  view source on GitHub ↗

Mithril help function ********************/ check whether last request is part of a sequential access */

Source from the content-addressed store, hash-verified

490 check whether last request is part of a sequential access
491 */
492static inline bool _Mithril_check_sequential(cache_t *cache,
493 const request_t *req) {
494 int i;
495 Mithril_params_t *Mithril_params =
496 (Mithril_params_t *)(cache->prefetcher->params);
497 if (Mithril_params->sequential_K == 0) return FALSE;
498
499 request_t *new_req = my_malloc(request_t);
500 copy_request(new_req, req);
501 bool is_sequential = TRUE;
502 gint sequential_K = Mithril_params->sequential_K;
503 if (sequential_K == -1) { /* when use AMP, this is -1 */
504 sequential_K = 1;
505 }
506 for (i = 0; i < sequential_K; i++) {
507 new_req->obj_id--;
508 if (!cache->find(cache, new_req, false)) {
509 is_sequential = FALSE;
510 break;
511 }
512 }
513 return is_sequential;
514}
515
516static inline void _Mithril_rec_min_support_one(cache_t *cache,
517 const request_t *req) {

Callers 2

Mithril_prefetchFunction · 0.85
_Mithril_record_entryFunction · 0.85

Calls 2

copy_requestFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected