From 85078b99e4cf652fcbd5f4d36b061674a2fe8aa6 Mon Sep 17 00:00:00 2001 From: bd Date: Mon, 10 Mar 2025 22:07:36 -0400 Subject: overload << operator for dram --- inc/cache.h | 2 +- inc/definitions.h | 2 +- inc/dram.h | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'inc') 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, 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 #include 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& data) override; + Response read( + Accessor accessor, + int address, + std::array &data) override; - private: + private: /** * Helper for `write`. */ @@ -26,8 +31,9 @@ class Dram : public Storage /** * Helper for `read`. */ - void do_read(std::array& data_line, int address); + void do_read(std::array &data_line, int address); }; -#endif /* DRAM_H_INCLUDED */ +std::ostream &operator<<(std::ostream &os, const Dram &d); +#endif /* DRAM_H_INCLUDED */ -- cgit v1.2.3