diff options
author | bd <bdunahu@operationnull.com> | 2025-04-14 16:28:05 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-14 16:28:05 -0400 |
commit | ee433509972d9390a52f188e902eb74e55596822 (patch) | |
tree | a2bb8d9eb7220cbaf147c3af3fb837bec6736296 /inc/dram.h | |
parent | b91eb002d4e6b2dc0c51b03df57c5089659ac669 (diff) |
Allow multi-level cache by passing a size into the constructor
Diffstat (limited to 'inc/dram.h')
-rw-r--r-- | inc/dram.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -5,6 +5,15 @@ #include <functional> #include <ostream> +// clang-format off +/** + * Ensures address is within the current memory size using a clean wrap. + * @param an address + */ +#define WRAP_ADDRESS(a) \ + ((a < 0) ? ((a % MEM_WORDS) + MEM_WORDS) % MEM_WORDS : a % MEM_WORDS) +// clang-format on + class Dram : public Storage { public: |