summaryrefslogtreecommitdiff
path: root/inc/definitions.h
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-11 11:54:21 -0400
committerbd <bdunahu@operationnull.com>2025-03-11 11:54:21 -0400
commit7c226db9f04de7061596b98763dc408d601d74e1 (patch)
treec6d4ff93026441bff50de16633706ee3dd2ea196 /inc/definitions.h
parent202f9a05d449ddc1160584c4e8a87f397f248e94 (diff)
Clarify size of mem and cache in definitions, CLI print invalid tags
Diffstat (limited to 'inc/definitions.h')
-rw-r--r--inc/definitions.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/inc/definitions.h b/inc/definitions.h
index f015ce9..1d68a60 100644
--- a/inc/definitions.h
+++ b/inc/definitions.h
@@ -13,28 +13,27 @@
#define LINE_SIZE static_cast<int>(pow(2, 2))
/**
+ * The number of bits to specify a memory word
* The number of bits to specify a memory line
- * calculated as: (/ (expt 2 15) 4)
+ * The total number of lines in memory
*/
-#define MEM_SPEC 8
-/**
- * The total number of words in memory
- */
-#define MEM_SIZE static_cast<int>(pow(2, MEM_SPEC))
+#define MEM_WORD_SPEC 10
+#define MEM_LINE_SPEC static_cast<unsigned int>(MEM_WORD_SPEC - LINE_SPEC)
+#define MEM_LINES static_cast<int>(pow(2, MEM_LINE_SPEC))
/**
+ * The number of bits to specify a l1 cache word
* The number of bits to specify a l1 cache line
+ * The total number of lines in l1 cache
*/
-#define L1_CACHE_SPEC 5
-/**
- * The total number of words in l1 cache
- */
-#define L1_CACHE_SIZE static_cast<int>(pow(2, L1_CACHE_SPEC))
+#define L1_CACHE_WORD_SPEC 7
+#define L1_CACHE_LINE_SPEC static_cast<unsigned int>(L1_CACHE_WORD_SPEC - LINE_SPEC)
+#define L1_CACHE_LINES static_cast<int>(pow(2, L1_CACHE_LINE_SPEC))
/**
* The total number of cycles a memory access takes.
*/
-#define MEM_DELAY 4
+#define MEM_DELAY 3
/**
* The total number of cycles a level one cache access takes