summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-10 22:07:36 -0400
committerbd <bdunahu@operationnull.com>2025-03-10 22:07:36 -0400
commite8fbf581f70a899a26f71e4b2220dccd1b986ed8 (patch)
tree1e3097ec91c7fcd7fc9d00f912b46814900201f0 /inc
parentaf103123a90eaf34437b7979eee2579bab8b4b36 (diff)
overload << operator for dram
Diffstat (limited to 'inc')
-rw-r--r--inc/cache.h2
-rw-r--r--inc/definitions.h2
-rw-r--r--inc/dram.h14
3 files changed, 12 insertions, 6 deletions
diff --git a/inc/cache.h b/inc/cache.h
index 0c9b3d7..04f6181 100644
--- a/inc/cache.h
+++ b/inc/cache.h
@@ -50,6 +50,6 @@ class Cache : public Storage
std::array<std::array<int, 2>, L1_CACHE_SIZE> meta;
};
-std::ostream &operator<<(std::ostream &os, const Cache &a);
+std::ostream &operator<<(std::ostream &os, const Cache &c);
#endif /* CACHE_H_INCLUDED */
diff --git a/inc/definitions.h b/inc/definitions.h
index 98c4575..62ed0f6 100644
--- a/inc/definitions.h
+++ b/inc/definitions.h
@@ -16,7 +16,7 @@
* 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
*/
diff --git a/inc/dram.h b/inc/dram.h
index 20221b7..e8d3573 100644
--- a/inc/dram.h
+++ b/inc/dram.h
@@ -1,5 +1,7 @@
#ifndef DRAM_H
#define DRAM_H
+#include "definitions.h"
+#include <ostream>
#include <storage.h>
class Dram : public Storage
@@ -16,9 +18,12 @@ class Dram : public Storage
~Dram();
Response write(Accessor accessor, signed int data, int address) override;
- Response read(Accessor accessor, int address, std::array<signed int, LINE_SIZE>& data) override;
+ Response read(
+ Accessor accessor,
+ int address,
+ std::array<signed int, LINE_SIZE> &data) override;
- private:
+ private:
/**
* Helper for `write`.
*/
@@ -26,8 +31,9 @@ class Dram : public Storage
/**
* Helper for `read`.
*/
- void do_read(std::array<signed int, LINE_SIZE>& data_line, int address);
+ void do_read(std::array<signed int, LINE_SIZE> &data_line, int address);
};
-#endif /* DRAM_H_INCLUDED */
+std::ostream &operator<<(std::ostream &os, const Dram &d);
+#endif /* DRAM_H_INCLUDED */