From 210fff77d5ec0ab172aee309323168a052d489c3 Mon Sep 17 00:00:00 2001
From: David Li
Date: Sun, 17 Jan 2016 17:11:25 -0700
Subject: Distinguish between memory and cache at type level
---
src/memory.rs | 42 ++++++++++++++++++++++++++++++++++++++++++
src/simulator.rs | 6 +++---
2 files changed, 45 insertions(+), 3 deletions(-)
(limited to 'src')
diff --git a/src/memory.rs b/src/memory.rs
index 052ffb7..958ef21 100644
--- a/src/memory.rs
+++ b/src/memory.rs
@@ -123,7 +123,23 @@ pub trait MemoryInterface {
}
}
+pub struct CacheMetadata {
+ /// How many sets are in the cache
+ pub num_sets: usize,
+ /// How many ways are in a set
+ pub num_ways: usize,
+ /// How many words are in a block/line
+ pub num_block_words: usize,
+ /// The tags currently in the cache, in order of set, then way
+ pub tags: Vec