diff options
author | Siddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com> | 2025-03-11 11:28:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-11 11:28:25 -0400 |
commit | e24e3cd4d296599b9ef1b705846b1c868148b0fd (patch) | |
tree | 25646d98b4bfcf4b9a664eabfc2651c481984c1d /inc/definitions.h | |
parent | 357e7fb37caf58cdfcdf85f7553db9378ff16e0c (diff) | |
parent | fde996690d77b81e445450671a0723f837de4eb3 (diff) |
Merge pull request #23 from bdunahu/bdunahu
Memory simulator CLI function implementation
Diffstat (limited to 'inc/definitions.h')
-rw-r--r-- | inc/definitions.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/inc/definitions.h b/inc/definitions.h index 877065e..f015ce9 100644 --- a/inc/definitions.h +++ b/inc/definitions.h @@ -1,5 +1,6 @@ #ifndef DEFINITIONS_H #define DEFINITIONS_H +#include "logger.h" #include <cmath> /** @@ -9,17 +10,17 @@ /** * The total number of words in a line */ -#define LINE_SIZE (int)pow(2, 2) +#define LINE_SIZE static_cast<int>(pow(2, 2)) /** * The number of bits to specify a memory line * calculated as: (/ (expt 2 15) 4) */ -#define MEM_SPEC 13 +#define MEM_SPEC 8 /** * The total number of words in memory */ -#define MEM_SIZE (int)pow(2, MEM_SPEC) +#define MEM_SIZE static_cast<int>(pow(2, MEM_SPEC)) /** * The number of bits to specify a l1 cache line @@ -28,7 +29,17 @@ /** * The total number of words in l1 cache */ -#define L1_CACHE_SIZE (int)pow(2, L1_CACHE_SPEC) +#define L1_CACHE_SIZE static_cast<int>(pow(2, L1_CACHE_SPEC)) + +/** + * The total number of cycles a memory access takes. + */ +#define MEM_DELAY 4 + +/** + * The total number of cycles a level one cache access takes + */ +#define L1_CACHE_DELAY 1 /** * Return the N least-significant bits from integer K using a bit mask |