summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-06 00:34:35 -0500
committerbd <bdunahu@operationnull.com>2025-03-06 00:34:35 -0500
commit3322aa0845f7fe9cc98aa4e429bd5ecf72a5c27e (patch)
tree75f627ee8e75c0763ab8b048496464c60e486490 /inc
parent20fe698a4074df4abe02f14a1a14481770e90abc (diff)
dram write (no delay, no accessor tracking
Diffstat (limited to 'inc')
-rw-r--r--inc/cache.h2
-rw-r--r--inc/definitions.h10
-rw-r--r--inc/dram.h2
-rw-r--r--inc/storage.h5
4 files changed, 15 insertions, 4 deletions
diff --git a/inc/cache.h b/inc/cache.h
index 4d143aa..312f3d1 100644
--- a/inc/cache.h
+++ b/inc/cache.h
@@ -8,7 +8,7 @@ class Cache : public Storage
/**
* Constructor.
* @param The number of `lines` contained in memory. The total number of
- * words is this number multiplied by 4.
+ * words is this number multiplied by LINE_SIZE.
* @param The next lowest level in storage. Methods from this object are
* called in case of a cache miss.
* @param The number of clock cycles each access takes.
diff --git a/inc/definitions.h b/inc/definitions.h
new file mode 100644
index 0000000..1593162
--- /dev/null
+++ b/inc/definitions.h
@@ -0,0 +1,10 @@
+#ifndef DEFINITIONS_H
+#define DEFINITIONS_H
+
+/**
+ * Defines common macros.
+ */
+
+#define LINE_SIZE 4
+
+#endif /* DEFINITIONS_H_INCLUDED */
diff --git a/inc/dram.h b/inc/dram.h
index 6d33534..c1e86b9 100644
--- a/inc/dram.h
+++ b/inc/dram.h
@@ -8,7 +8,7 @@ class Dram : public Storage
/**
* Constructor.
* @param The number of `lines` contained in memory. The total number of
- * words is this number multiplied by 4.
+ * words is this number multiplied by LINE_SIZE.
* @param The number of clock cycles each access takes.
* @return A new memory object.
*/
diff --git a/inc/storage.h b/inc/storage.h
index 5ad4f99..c0f09a3 100644
--- a/inc/storage.h
+++ b/inc/storage.h
@@ -1,5 +1,6 @@
#ifndef STORAGE_H
#define STORAGE_H
+#include "definitions.h"
#include "response.h"
#include <array>
#include <vector>
@@ -37,13 +38,13 @@ class Storage
* @return A matrix of data values, where each row is a line and each column
* is a word.
*/
- std::vector<std::array<signed int, 4>> view(int base, int lines);
+ std::vector<std::array<signed int, LINE_SIZE>> view(int base, int lines);
protected:
/**
* The data currently stored in this level of storage.
*/
- std::vector<std::array<signed int, 4>> *data;
+ std::vector<std::array<signed int, LINE_SIZE>> *data;
/**
* A pointer to the next lowest level of storage.
* Used in case of cache misses.