From 41f38a559b6b6ed50d821f16b742575d1487d1cf Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 16 Aug 2019 13:21:56 -0700 Subject: [PATCH] mem: Put gem5 protocols in their own directory. This reduces clutter in the src/mem directory, and makes it clear that those protocols are for the classic gem5 memory system, not ruby, TLM, etc. Change-Id: I6cf6b21134d82f4f01991e4fe92dbea8c7e82081 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20231 Tested-by: kokoro Maintainer: Gabe Black Reviewed-by: Andreas Sandberg --- src/mem/SConscript | 3 -- src/mem/port.hh | 6 ++-- src/mem/protocol/SConscript | 32 +++++++++++++++++++ .../atomic.cc} | 2 +- .../atomic.hh} | 6 ++-- .../functional.cc} | 2 +- .../functional.hh} | 6 ++-- .../timing.cc} | 2 +- .../timing.hh} | 6 ++-- 9 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 src/mem/protocol/SConscript rename src/mem/{atomic_protocol.cc => protocol/atomic.cc} (98%) rename src/mem/{atomic_protocol.hh => protocol/atomic.hh} (97%) rename src/mem/{functional_protocol.cc => protocol/functional.cc} (98%) rename src/mem/{functional_protocol.hh => protocol/functional.hh} (96%) rename src/mem/{timing_protocol.cc => protocol/timing.cc} (99%) rename src/mem/{timing_protocol.hh => protocol/timing.hh} (98%) diff --git a/src/mem/SConscript b/src/mem/SConscript index 9ebb07436..95d8654b1 100644 --- a/src/mem/SConscript +++ b/src/mem/SConscript @@ -60,14 +60,12 @@ SimObject('MemDelay.py') Source('abstract_mem.cc') Source('addr_mapper.cc') -Source('atomic_protocol.cc') Source('bridge.cc') Source('coherent_xbar.cc') Source('drampower.cc') Source('dram_ctrl.cc') Source('external_master.cc') Source('external_slave.cc') -Source('functional_protocol.cc') Source('mem_object.cc') Source('mport.cc') Source('noncoherent_xbar.cc') @@ -77,7 +75,6 @@ Source('packet_queue.cc') Source('port_proxy.cc') Source('physical.cc') Source('secure_port_proxy.cc') -Source('timing_protocol.cc') Source('simple_mem.cc') Source('snoop_filter.cc') Source('stack_dist_calc.cc') diff --git a/src/mem/port.hh b/src/mem/port.hh index 16257ed4f..847bd1e7d 100644 --- a/src/mem/port.hh +++ b/src/mem/port.hh @@ -51,10 +51,10 @@ #define __MEM_PORT_HH__ #include "base/addr_range.hh" -#include "mem/atomic_protocol.hh" -#include "mem/functional_protocol.hh" #include "mem/packet.hh" -#include "mem/timing_protocol.hh" +#include "mem/protocol/atomic.hh" +#include "mem/protocol/functional.hh" +#include "mem/protocol/timing.hh" #include "sim/port.hh" class SimObject; diff --git a/src/mem/protocol/SConscript b/src/mem/protocol/SConscript new file mode 100644 index 000000000..abab5cc7f --- /dev/null +++ b/src/mem/protocol/SConscript @@ -0,0 +1,32 @@ +# Copyright 2019 Google Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Gabe Black + +Import('*') + +Source('atomic.cc') +Source('functional.cc') +Source('timing.cc') diff --git a/src/mem/atomic_protocol.cc b/src/mem/protocol/atomic.cc similarity index 98% rename from src/mem/atomic_protocol.cc rename to src/mem/protocol/atomic.cc index 6aecc4058..3ddd71589 100644 --- a/src/mem/atomic_protocol.cc +++ b/src/mem/protocol/atomic.cc @@ -42,7 +42,7 @@ * William Wang */ -#include "mem/atomic_protocol.hh" +#include "mem/protocol/atomic.hh" #include "base/trace.hh" diff --git a/src/mem/atomic_protocol.hh b/src/mem/protocol/atomic.hh similarity index 97% rename from src/mem/atomic_protocol.hh rename to src/mem/protocol/atomic.hh index bb2de0a22..bbbd408d0 100644 --- a/src/mem/atomic_protocol.hh +++ b/src/mem/protocol/atomic.hh @@ -42,8 +42,8 @@ * William Wang */ -#ifndef __MEM_ATOMIC_PROTOCOL_HH__ -#define __MEM_ATOMIC_PROTOCOL_HH__ +#ifndef __MEM_GEM5_PROTOCOL_ATOMIC_HH__ +#define __MEM_GEM5_PROTOCOL_ATOMIC_HH__ #include "mem/backdoor.hh" #include "mem/packet.hh" @@ -117,4 +117,4 @@ class AtomicResponseProtocol PacketPtr pkt, MemBackdoorPtr &backdoor) = 0; }; -#endif //__MEM_ATOMIC_PROTOCOL_HH__ +#endif //__MEM_GEM5_PROTOCOL_ATOMIC_HH__ diff --git a/src/mem/functional_protocol.cc b/src/mem/protocol/functional.cc similarity index 98% rename from src/mem/functional_protocol.cc rename to src/mem/protocol/functional.cc index be129539b..6ae7c626d 100644 --- a/src/mem/functional_protocol.cc +++ b/src/mem/protocol/functional.cc @@ -42,7 +42,7 @@ * William Wang */ -#include "mem/functional_protocol.hh" +#include "mem/protocol/functional.hh" /* The request protocol. */ diff --git a/src/mem/functional_protocol.hh b/src/mem/protocol/functional.hh similarity index 96% rename from src/mem/functional_protocol.hh rename to src/mem/protocol/functional.hh index 443b98032..ffd27a488 100644 --- a/src/mem/functional_protocol.hh +++ b/src/mem/protocol/functional.hh @@ -42,8 +42,8 @@ * William Wang */ -#ifndef __MEM_FUNCTIONAL_PROTOCOL_HH__ -#define __MEM_FUNCTIONAL_PROTOCOL_HH__ +#ifndef __MEM_GEM5_PROTOCOL_FUNCTIONAL_HH__ +#define __MEM_GEM5_PROTOCOL_FUNCTIONAL_HH__ #include "mem/packet.hh" @@ -89,4 +89,4 @@ class FunctionalResponseProtocol virtual void recvFunctional(PacketPtr pkt) = 0; }; -#endif //__MEM_FUNCTIONAL_PROTOCOL_HH__ +#endif //__MEM_GEM5_PROTOCOL_FUNCTIONAL_HH__ diff --git a/src/mem/timing_protocol.cc b/src/mem/protocol/timing.cc similarity index 99% rename from src/mem/timing_protocol.cc rename to src/mem/protocol/timing.cc index bc56ce2e3..b3efcfbfc 100644 --- a/src/mem/timing_protocol.cc +++ b/src/mem/protocol/timing.cc @@ -42,7 +42,7 @@ * William Wang */ -#include "mem/timing_protocol.hh" +#include "mem/protocol/timing.hh" /* The request protocol. */ diff --git a/src/mem/timing_protocol.hh b/src/mem/protocol/timing.hh similarity index 98% rename from src/mem/timing_protocol.hh rename to src/mem/protocol/timing.hh index 42235732c..108ac9796 100644 --- a/src/mem/timing_protocol.hh +++ b/src/mem/protocol/timing.hh @@ -42,8 +42,8 @@ * William Wang */ -#ifndef __MEM_TIMING_PROTOCOL_HH__ -#define __MEM_TIMING_PROTOCOL_HH__ +#ifndef __MEM_GEM5_PROTOCOL_TIMING_HH__ +#define __MEM_GEM5_PROTOCOL_TIMING_HH__ #include "mem/packet.hh" @@ -187,4 +187,4 @@ class TimingResponseProtocol virtual void recvRespRetry() = 0; }; -#endif //__MEM_TIMING_PROTOCOL_HH__ +#endif //__MEM_GEM5_PROTOCOL_TIMING_HH__ -- 2.30.2