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

Function OBL_parse_init_params

libCacheSim/cache/prefetch/OBL.c:43–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43static void OBL_parse_init_params(const char *cache_specific_params, OBL_init_params_t *init_params) {
44 char *params_str = strdup(cache_specific_params);
45
46 while (params_str != NULL && params_str[0] != '\0') {
47 char *key = strsep((char **)&params_str, "=");
48 char *value = strsep((char **)&params_str, ",");
49 while (params_str != NULL && *params_str == ' ') {
50 params_str++;
51 }
52 if (strcasecmp(key, "block-size") == 0) {
53 init_params->block_size = atoi(value);
54 } else if (strcasecmp(key, "sequential-confidence-k") == 0) {
55 init_params->sequential_confidence_k = atoi(value);
56 } else {
57 ERROR("OBL does not have parameter %s\n", key);
58 printf("default params: %s\n", OBL_default_params());
59 exit(1);
60 }
61 }
62}
63
64static void set_OBL_params(OBL_params_t *OBL_params, OBL_init_params_t *init_params, uint64_t cache_size) {
65 OBL_params->block_size = init_params->block_size;

Callers 1

create_OBL_prefetcherFunction · 0.85

Calls 2

atoiFunction · 0.85
OBL_default_paramsFunction · 0.85

Tested by

no test coverage detected