summaryrefslogtreecommitdiff
path: root/inc/definitions.h
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-11 11:28:25 -0400
committerGitHub <noreply@github.com>2025-03-11 11:28:25 -0400
commit33c7c78b1c65c375d0291fd435e02ddc9d35681b (patch)
tree25646d98b4bfcf4b9a664eabfc2651c481984c1d /inc/definitions.h
parent66edce63597093cf5f3afa5b577fd9e3ecae0ef6 (diff)
parent202f9a05d449ddc1160584c4e8a87f397f248e94 (diff)
Merge pull request #23 from bdunahu/bdunahu
Memory simulator CLI function implementation
Diffstat (limited to 'inc/definitions.h')
-rw-r--r--inc/definitions.h19
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