mem-ruby: Sequencer can be used without cache
authorTiago Mück <tiago.muck@arm.com>
Thu, 28 May 2020 21:16:20 +0000 (16:16 -0500)
committerTiago Mück <tiago.muck@arm.com>
Mon, 12 Oct 2020 14:09:55 +0000 (14:09 +0000)
Moved the dcache check to the LLSC functions that use it.
This allows a Sequencer to be coupled with a gem5 object
that does not need a cache (as long as it doesn't issue
LLSC instructions).

Also, icache was not used at all so it was removed.

Change-Id: I04bd2711f8d0a7dfc952cff8e0020d2d1881cae1
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31267
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bradford Beckmann <bradford.beckmann@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
19 files changed:
configs/learning_gem5/part3/msi_caches.py
configs/learning_gem5/part3/ruby_caches_MI_example.py
configs/learning_gem5/part3/test_caches.py
configs/ruby/AMD_Base_Constructor.py
configs/ruby/GPU_RfO.py
configs/ruby/GPU_VIPER.py
configs/ruby/GPU_VIPER_Baseline.py
configs/ruby/GPU_VIPER_Region.py
configs/ruby/Garnet_standalone.py
configs/ruby/MESI_Three_Level.py
configs/ruby/MESI_Two_Level.py
configs/ruby/MI_example.py
configs/ruby/MOESI_AMD_Base.py
configs/ruby/MOESI_CMP_directory.py
configs/ruby/MOESI_CMP_token.py
configs/ruby/MOESI_hammer.py
src/mem/ruby/system/Sequencer.cc
src/mem/ruby/system/Sequencer.hh
src/mem/ruby/system/Sequencer.py

index f8994265cdc92d7f42e91a690d0bf4d2e5e36de8..d718a6befd494cba5c79808d236727b774664ae4 100644 (file)
@@ -82,7 +82,6 @@ class MyCacheSystem(RubySystem):
         # and other controllers, too.
         self.sequencers = [RubySequencer(version = i,
                                 # I/D cache is combined and grab from ctrl
-                                icache = self.controllers[i].cacheMemory,
                                 dcache = self.controllers[i].cacheMemory,
                                 clk_domain = self.controllers[i].clk_domain,
                                 ) for i in range(len(cpus))]
index 29b66a6d47560d8737e6fa241a5f0b9268fabef3..8c0e563e99546c6b0030a4234a16f2d67e6cb05b 100644 (file)
@@ -82,7 +82,6 @@ class MyCacheSystem(RubySystem):
         # and other controllers, too.
         self.sequencers = [RubySequencer(version = i,
                                 # I/D cache is combined and grab from ctrl
-                                icache = self.controllers[i].cacheMemory,
                                 dcache = self.controllers[i].cacheMemory,
                                 clk_domain = self.controllers[i].clk_domain,
                                 ) for i in range(len(cpus))]
index 855bf17b9192e977d6e8b251ddd451b949f26dff..cdf5d19525f24122b4e47bce9d0d4ef5bd4505ac 100644 (file)
@@ -76,7 +76,6 @@ class TestCacheSystem(RubySystem):
 
         self.sequencers = [RubySequencer(version = i,
                               # I/D cache is combined and grab from ctrl
-                              icache = self.controllers[i].cacheMemory,
                               dcache = self.controllers[i].cacheMemory,
                               clk_domain = self.clk_domain,
                               ) for i in range(num_testers)]
index a347f437390b8185fef80b7044037b1448ad33f3..6f13c1e0f2f0d8f7c81f5f854623681e10648204 100644 (file)
@@ -78,7 +78,6 @@ class CPCntrl(AMD_Base_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1Icache
         self.sequencer.dcache = self.L1D0cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.coreid = 0
@@ -86,7 +85,6 @@ class CPCntrl(AMD_Base_Controller, CntrlBase):
 
         self.sequencer1 = RubySequencer()
         self.sequencer1.version = self.seqCount()
-        self.sequencer1.icache = self.L1Icache
         self.sequencer1.dcache = self.L1D1cache
         self.sequencer1.ruby_system = ruby_system
         self.sequencer1.coreid = 1
index 58711ea0d0a67264fc081d8fc66374621bbbb57f..6705fc1a7f564b99ac5e647323395e8d4f5ad1eb 100644 (file)
@@ -118,7 +118,6 @@ class CPCntrl(CorePair_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1Icache
         self.sequencer.dcache = self.L1D0cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.coreid = 0
@@ -126,7 +125,6 @@ class CPCntrl(CorePair_Controller, CntrlBase):
 
         self.sequencer1 = RubySequencer()
         self.sequencer1.version = self.seqCount()
-        self.sequencer1.icache = self.L1Icache
         self.sequencer1.dcache = self.L1D1cache
         self.sequencer1.ruby_system = ruby_system
         self.sequencer1.coreid = 1
@@ -180,7 +178,6 @@ class TCPCntrl(TCP_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.is_cpu_sequencer = True
@@ -209,7 +206,6 @@ class TCPCntrl(TCP_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.is_cpu_sequencer = True
@@ -243,7 +239,6 @@ class SQCCntrl(SQC_Controller, CntrlBase):
         self.sequencer = RubySequencer()
 
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.support_data_reqs = False
@@ -268,7 +263,6 @@ class SQCCntrl(SQC_Controller, CntrlBase):
         self.sequencer = RubySequencer()
 
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.support_data_reqs = False
index 6a6dec53ba987a54a3c32c264be5e0136ddf9de4..3ea2998ebc653d7a5be611c579d39d3cbcc068a8 100644 (file)
@@ -105,7 +105,6 @@ class CPCntrl(CorePair_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1Icache
         self.sequencer.dcache = self.L1D0cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.coreid = 0
@@ -113,7 +112,6 @@ class CPCntrl(CorePair_Controller, CntrlBase):
 
         self.sequencer1 = RubySequencer()
         self.sequencer1.version = self.seqCount()
-        self.sequencer1.icache = self.L1Icache
         self.sequencer1.dcache = self.L1D1cache
         self.sequencer1.ruby_system = ruby_system
         self.sequencer1.coreid = 1
@@ -166,7 +164,6 @@ class TCPCntrl(TCP_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.is_cpu_sequencer = True
@@ -197,7 +194,6 @@ class TCPCntrl(TCP_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.is_cpu_sequencer = True
@@ -232,7 +228,6 @@ class SQCCntrl(SQC_Controller, CntrlBase):
         self.sequencer = RubySequencer()
 
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.support_data_reqs = False
index 5a32222fca7460e6cdfadc2cae03e658c677a892..a55ecd4136e45f68f3935c4118d12c0a7eb7324b 100644 (file)
@@ -104,7 +104,6 @@ class CPCntrl(CorePair_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1Icache
         self.sequencer.dcache = self.L1D0cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.coreid = 0
@@ -112,7 +111,6 @@ class CPCntrl(CorePair_Controller, CntrlBase):
 
         self.sequencer1 = RubySequencer()
         self.sequencer1.version = self.seqCount()
-        self.sequencer1.icache = self.L1Icache
         self.sequencer1.dcache = self.L1D1cache
         self.sequencer1.ruby_system = ruby_system
         self.sequencer1.coreid = 1
@@ -165,7 +163,6 @@ class TCPCntrl(TCP_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.is_cpu_sequencer = True
@@ -196,7 +193,6 @@ class SQCCntrl(SQC_Controller, CntrlBase):
         self.L1cache.resourceStalls = False
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.support_data_reqs = False
index fa431e3d1db473b990af40ae7b669471f2528a7a..1d63cb0e4a0faf3227b4aecdeb31cb3015473c18 100644 (file)
@@ -105,7 +105,6 @@ class CPCntrl(CorePair_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1Icache
         self.sequencer.dcache = self.L1D0cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.coreid = 0
@@ -113,7 +112,6 @@ class CPCntrl(CorePair_Controller, CntrlBase):
 
         self.sequencer1 = RubySequencer()
         self.sequencer1.version = self.seqCount()
-        self.sequencer1.icache = self.L1Icache
         self.sequencer1.dcache = self.L1D1cache
         self.sequencer1.ruby_system = ruby_system
         self.sequencer1.coreid = 1
@@ -166,7 +164,6 @@ class TCPCntrl(TCP_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.is_cpu_sequencer = True
@@ -197,7 +194,6 @@ class SQCCntrl(SQC_Controller, CntrlBase):
         self.L1cache.resourceStalls = False
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1cache
         self.sequencer.dcache = self.L1cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.support_data_reqs = False
index 4b7ca8d1225f2bd042551c711803176b5e83bf8e..13e990d15a022e581d332584edf3084cf736b0fc 100644 (file)
@@ -79,8 +79,7 @@ def create_system(options, full_system, system, dma_ports, bootmem,
                                       cacheMemory = cache,
                                       ruby_system = ruby_system)
 
-        cpu_seq = RubySequencer(icache = cache,
-                                dcache = cache,
+        cpu_seq = RubySequencer(dcache = cache,
                                 garnet_standalone = True,
                                 ruby_system = ruby_system)
 
index 7cfb83242f265da7d98ec3704b2758d5519e36c2..91ccb58963409224e60365fa2b4888cc515d0532 100644 (file)
@@ -141,7 +141,6 @@ def create_system(options, full_system, system, dma_ports, bootmem,
                    ruby_system = ruby_system)
 
             cpu_seq = RubySequencer(version = i * num_cpus_per_cluster + j,
-                                    icache = l0i_cache,
                                     clk_domain = clk_domain,
                                     dcache = l0d_cache,
                                     ruby_system = ruby_system)
index 77fef767fe9daabfa3fca933b7a64fa2be78e1c6..96650e010611f1df6afebed275875fadbe5aa7c4 100644 (file)
@@ -102,7 +102,7 @@ def create_system(options, full_system, system, dma_ports, bootmem,
                                       transitions_per_cycle = options.ports,
                                       enable_prefetch = False)
 
-        cpu_seq = RubySequencer(version = i, icache = l1i_cache,
+        cpu_seq = RubySequencer(version = i,
                                 dcache = l1d_cache, clk_domain = clk_domain,
                                 ruby_system = ruby_system)
 
index 264f709ecca87b664c4a54f2a3c0f101060202e5..6e5c8b4e2713d39f03a2636ba9640a1cb600ba44 100644 (file)
@@ -92,7 +92,7 @@ def create_system(options, full_system, system, dma_ports, bootmem,
                                       clk_domain=clk_domain,
                                       ruby_system=ruby_system)
 
-        cpu_seq = RubySequencer(version=i, icache=cache, dcache=cache,
+        cpu_seq = RubySequencer(version=i, dcache=cache,
                                 clk_domain=clk_domain, ruby_system=ruby_system)
 
         l1_cntrl.sequencer = cpu_seq
index 91ff4d232a650b7a50233778940580f02f7f8f06..eb008ea580720d563f39769d5f7430a93364208d 100644 (file)
@@ -101,7 +101,6 @@ class CPCntrl(CorePair_Controller, CntrlBase):
 
         self.sequencer = RubySequencer()
         self.sequencer.version = self.seqCount()
-        self.sequencer.icache = self.L1Icache
         self.sequencer.dcache = self.L1D0cache
         self.sequencer.ruby_system = ruby_system
         self.sequencer.coreid = 0
@@ -109,7 +108,6 @@ class CPCntrl(CorePair_Controller, CntrlBase):
 
         self.sequencer1 = RubySequencer()
         self.sequencer1.version = self.seqCount()
-        self.sequencer1.icache = self.L1Icache
         self.sequencer1.dcache = self.L1D1cache
         self.sequencer1.ruby_system = ruby_system
         self.sequencer1.coreid = 1
index a78f73c68b9e4e8ce2eb0b5e2f0bcd6bbe4fcef7..5366fe7ab10d7a9b57df50432e4bfb2631df0c2f 100644 (file)
@@ -113,7 +113,7 @@ def create_system(options, full_system, system, dma_ports, bootmem,
                                       clk_domain=clk_domain,
                                       ruby_system=ruby_system)
 
-        cpu_seq = RubySequencer(version=i, icache=l1i_cache,
+        cpu_seq = RubySequencer(version=i,
                                 dcache=l1d_cache, clk_domain=clk_domain,
                                 ruby_system=ruby_system)
 
index 80944f56605dda764d5098008b73d42e91021ceb..28ec52f3dd3dee0efd59270e78457701407d6c67 100644 (file)
@@ -117,7 +117,7 @@ def create_system(options, full_system, system, dma_ports, bootmem,
                                       clk_domain=clk_domain,
                                       ruby_system=ruby_system)
 
-        cpu_seq = RubySequencer(version=i, icache=l1i_cache,
+        cpu_seq = RubySequencer(version=i,
                                 dcache=l1d_cache, clk_domain=clk_domain,
                                 ruby_system=ruby_system)
 
index c83bb72dcddf9e9308dc4705a0067fd158079701..1e00f0f479d0c05a904766ce380a498a6b956705 100644 (file)
@@ -109,7 +109,7 @@ def create_system(options, full_system, system, dma_ports, bootmem,
                                       clk_domain=clk_domain,
                                       ruby_system=ruby_system)
 
-        cpu_seq = RubySequencer(version=i, icache=l1i_cache,
+        cpu_seq = RubySequencer(version=i,
                                 dcache=l1d_cache,clk_domain=clk_domain,
                                 ruby_system=ruby_system)
 
index dbc85c4182a21822b48c2c44d04cd908e9ace544..0614c1108965974fcdf6074211d82a38f7f03269 100644 (file)
@@ -73,7 +73,6 @@ Sequencer::Sequencer(const Params *p)
 {
     m_outstanding_count = 0;
 
-    m_instCache_ptr = p->icache;
     m_dataCache_ptr = p->dcache;
     m_max_outstanding_requests = p->max_outstanding_requests;
     m_deadlock_threshold = p->deadlock_threshold;
@@ -81,8 +80,6 @@ Sequencer::Sequencer(const Params *p)
     m_coreId = p->coreid; // for tracking the two CorePair sequencers
     assert(m_max_outstanding_requests > 0);
     assert(m_deadlock_threshold > 0);
-    assert(m_instCache_ptr != NULL);
-    assert(m_dataCache_ptr != NULL);
 
     m_runningGarnetStandalone = p->garnet_standalone;
 }
@@ -94,6 +91,8 @@ Sequencer::~Sequencer()
 void
 Sequencer::llscLoadLinked(const Addr claddr)
 {
+    fatal_if(m_dataCache_ptr == NULL,
+        "%s must have a dcache object to support LLSC requests.", name());
     AbstractCacheEntry *line = m_dataCache_ptr->lookup(claddr);
     if (line) {
         line->setLocked(m_version);
@@ -105,6 +104,9 @@ Sequencer::llscLoadLinked(const Addr claddr)
 void
 Sequencer::llscClearMonitor(const Addr claddr)
 {
+    // clear monitor is called for all stores and evictions
+    if (m_dataCache_ptr == NULL)
+        return;
     AbstractCacheEntry *line = m_dataCache_ptr->lookup(claddr);
     if (line && line->isLocked(m_version)) {
         line->clearLocked();
@@ -116,6 +118,8 @@ Sequencer::llscClearMonitor(const Addr claddr)
 bool
 Sequencer::llscStoreConditional(const Addr claddr)
 {
+    fatal_if(m_dataCache_ptr == NULL,
+        "%s must have a dcache object to support LLSC requests.", name());
     AbstractCacheEntry *line = m_dataCache_ptr->lookup(claddr);
     if (!line)
         return false;
@@ -137,6 +141,7 @@ Sequencer::llscStoreConditional(const Addr claddr)
 bool
 Sequencer::llscCheckMonitor(const Addr address)
 {
+    assert(m_dataCache_ptr != NULL);
     const Addr claddr = makeLineAddress(address);
     AbstractCacheEntry *line = m_dataCache_ptr->lookup(claddr);
     if (!line)
index 92fdab690f2e6fc17da7c0ed78a8bed788294518..4a5e2812335f37abcb28ffc56f8796d8495d3199 100644 (file)
@@ -212,7 +212,6 @@ class Sequencer : public RubyPort
     int m_max_outstanding_requests;
 
     CacheMemory* m_dataCache_ptr;
-    CacheMemory* m_instCache_ptr;
 
     // The cache access latency for top-level caches (L0/L1). These are
     // currently assessed at the beginning of each memory access through the
index 0a28d363198ecb2df770f863c241ff6362490431..0acd87a4bf19e70a807d3d2b9fdc8ea8adf72c8e 100644 (file)
@@ -1,3 +1,15 @@
+# Copyright (c) 2020 ARM Limited
+# All rights reserved.
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder.  You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
 # Copyright (c) 2009 Advanced Micro Devices, Inc.
 # Copyright (c) 2020 ARM Limited
 # All rights reserved.
@@ -76,7 +88,6 @@ class RubySequencer(RubyPort):
    cxx_class = 'Sequencer'
    cxx_header = "mem/ruby/system/Sequencer.hh"
 
-   icache = Param.RubyCache("")
    dcache = Param.RubyCache("")
 
    max_outstanding_requests = Param.Int(16,