From 893533a1264bb369b47f74493adf30ce22829f34 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 3 Jul 2015 10:14:39 -0400 Subject: mem: Allow read-only caches and check compliance This patch adds a parameter to the BaseCache to enable a read-only cache, for example for the instruction cache, or table-walker cache (not for x86). A number of checks are put in place in the code to ensure a read-only cache does not end up with dirty data. A follow-on patch adds suitable read requests to allow a read-only cache to explicitly ask for clean data. --- tests/configs/base_config.py | 12 ++++++------ tests/configs/x86_generic.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/configs/base_config.py b/tests/configs/base_config.py index c440d48d9..a3e1e0271 100644 --- a/tests/configs/base_config.py +++ b/tests/configs/base_config.py @@ -92,8 +92,8 @@ class BaseSystem(object): Arguments: cpu -- CPU instance to work on. """ - cpu.addPrivateSplitL1Caches(L1Cache(size='32kB', assoc=1), - L1Cache(size='32kB', assoc=4)) + cpu.addPrivateSplitL1Caches(L1_ICache(size='32kB', assoc=1), + L1_DCache(size='32kB', assoc=4)) def create_caches_shared(self, system): """Add shared caches to a system. @@ -212,8 +212,8 @@ class BaseSESystemUniprocessor(BaseSESystem): # The atomic SE configurations do not use caches if self.mem_mode == "timing": # @todo We might want to revisit these rather enthusiastic L1 sizes - cpu.addTwoLevelCacheHierarchy(L1Cache(size='128kB'), - L1Cache(size='256kB'), + cpu.addTwoLevelCacheHierarchy(L1_ICache(size='128kB'), + L1_DCache(size='256kB'), L2Cache(size='2MB')) def create_caches_shared(self, system): @@ -256,8 +256,8 @@ class BaseFSSystemUniprocessor(BaseFSSystem): BaseFSSystem.__init__(self, **kwargs) def create_caches_private(self, cpu): - cpu.addTwoLevelCacheHierarchy(L1Cache(size='32kB', assoc=1), - L1Cache(size='32kB', assoc=4), + cpu.addTwoLevelCacheHierarchy(L1_ICache(size='32kB', assoc=1), + L1_DCache(size='32kB', assoc=4), L2Cache(size='4MB', assoc=8)) def create_caches_shared(self, system): diff --git a/tests/configs/x86_generic.py b/tests/configs/x86_generic.py index 5dc8702ba..ad3ea31bf 100644 --- a/tests/configs/x86_generic.py +++ b/tests/configs/x86_generic.py @@ -81,8 +81,8 @@ class LinuxX86FSSystem(LinuxX86SystemBuilder, LinuxX86SystemBuilder.__init__(self) def create_caches_private(self, cpu): - cpu.addPrivateSplitL1Caches(L1Cache(size='32kB', assoc=1), - L1Cache(size='32kB', assoc=4), + cpu.addPrivateSplitL1Caches(L1_ICache(size='32kB', assoc=1), + L1_DCache(size='32kB', assoc=4), PageTableWalkerCache(), PageTableWalkerCache()) @@ -100,8 +100,8 @@ class LinuxX86FSSystemUniprocessor(LinuxX86SystemBuilder, LinuxX86SystemBuilder.__init__(self) def create_caches_private(self, cpu): - cpu.addTwoLevelCacheHierarchy(L1Cache(size='32kB', assoc=1), - L1Cache(size='32kB', assoc=4), + cpu.addTwoLevelCacheHierarchy(L1_ICache(size='32kB', assoc=1), + L1_DCache(size='32kB', assoc=4), L2Cache(size='4MB', assoc=8), PageTableWalkerCache(), PageTableWalkerCache()) -- cgit v1.2.3