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 <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
diff --git a/src/mem/SConscript b/src/mem/SConscript
index 9ebb074..95d8654 100644
--- a/src/mem/SConscript
+++ b/src/mem/SConscript
@@ -60,14 +60,12 @@
 
 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('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 16257ed..847bd1e 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 0000000..abab5cc
--- /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 6aecc40..3ddd715 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 96%
rename from src/mem/atomic_protocol.hh
rename to src/mem/protocol/atomic.hh
index bb2de0a..bbbd408 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 @@
             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 97%
rename from src/mem/functional_protocol.cc
rename to src/mem/protocol/functional.cc
index be12953..6ae7c62 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 95%
rename from src/mem/functional_protocol.hh
rename to src/mem/protocol/functional.hh
index 443b980..ffd27a4 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 @@
     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 98%
rename from src/mem/timing_protocol.cc
rename to src/mem/protocol/timing.cc
index bc56ce2..b3efcfb 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 97%
rename from src/mem/timing_protocol.hh
rename to src/mem/protocol/timing.hh
index 4223573..108ac97 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 @@
     virtual void recvRespRetry() = 0;
 };
 
-#endif //__MEM_TIMING_PROTOCOL_HH__
+#endif //__MEM_GEM5_PROTOCOL_TIMING_HH__