misc: Adopt the gem5 namespace

Apply the gem5 namespace to the codebase.

Some anonymous namespaces could theoretically be removed,
but since this change's main goal was to keep conflicts
at a minimum, it was decided not to modify much the
general shape of the files.

A few missing comments of the form "// namespace X" that
occurred before the newly added "} // namespace gem5"
have been added for consistency.

std out should not be included in the gem5 namespace, so
they weren't.

ProtoMessage has not been included in the gem5 namespace,
since I'm not familiar with how proto works.

Regarding the SystemC files, although they belong to gem5,
they actually perform integration between gem5 and SystemC;
therefore, it deserved its own separate namespace.

Files that are automatically generated have been included
in the gem5 namespace.

The .isa files currently are limited to a single namespace.
This limitation should be later removed to make it easier
to accomodate a better API.

Regarding the files in util, gem5:: was prepended where
suitable. Notice that this patch was tested as much as
possible given that most of these were already not
previously compiling.

Change-Id: Ia53d404ec79c46edaa98f654e23bc3b0e179fe2d
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46323
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel R. Carvalho
2021-05-09 12:32:07 -03:00
committed by Daniel Carvalho
parent d4904b3b89
commit 974a47dfb9
2124 changed files with 10144 additions and 1357 deletions

View File

@@ -37,3 +37,4 @@ from m5.objects.TesterThread import TesterThread
class CpuThread(TesterThread):
type = 'CpuThread'
cxx_header = "cpu/testers/gpu_ruby_test/cpu_thread.hh"
cxx_class = 'gem5::CpuThread'

View File

@@ -37,3 +37,4 @@ from m5.objects.TesterThread import TesterThread
class DmaThread(TesterThread):
type = 'DmaThread'
cxx_header = "cpu/testers/gpu_ruby_test/dma_thread.hh"
cxx_class = 'gem5::DmaThread'

View File

@@ -37,4 +37,6 @@ from m5.objects.TesterThread import TesterThread
class GpuWavefront(TesterThread):
type = 'GpuWavefront'
cxx_header = "cpu/testers/gpu_ruby_test/gpu_wavefront.hh"
cxx_class = 'gem5::GpuWavefront'
cu_id = Param.Int("Compute Unit ID")

View File

@@ -36,6 +36,7 @@ from m5.proxy import *
class ProtocolTester(ClockedObject):
type = 'ProtocolTester'
cxx_header = "cpu/testers/gpu_ruby_test/protocol_tester.hh"
cxx_class = 'gem5::ProtocolTester'
cpu_ports = VectorRequestPort("Ports for CPUs")
dma_ports = VectorRequestPort("Ports for DMAs")

View File

@@ -34,3 +34,4 @@ from m5.objects.Device import DmaDevice
class TesterDma(DmaDevice):
type = 'TesterDma'
cxx_header = "cpu/testers/gpu_ruby_test/tester_dma.hh"
cxx_class = 'gem5::TesterDma'

View File

@@ -37,6 +37,8 @@ class TesterThread(ClockedObject):
type = 'TesterThread'
abstract = True
cxx_header = "cpu/testers/gpu_ruby_test/tester_thread.hh"
cxx_class = 'gem5::TesterThread'
thread_id = Param.Int("Unique TesterThread ID")
num_lanes = Param.Int("Number of lanes this thread has")
deadlock_threshold = Param.Cycles(1000000000, "Deadlock threshold")

View File

@@ -40,6 +40,9 @@
#include "base/random.hh"
#include "base/trace.hh"
namespace gem5
{
const int AddressManager::INVALID_VALUE = -1;
const int AddressManager::INVALID_LOCATION = -1;
@@ -429,3 +432,5 @@ AddressManager::validateAtomicResp(Location loc, Value ret_val)
assert(loc >= 0 && loc < numAtomicLocs);
return atomicStructs[loc]->isExpectedValue(ret_val);
}
} // namespace gem5

View File

@@ -42,6 +42,9 @@
#include "base/types.hh"
#include "sim/eventq.hh"
namespace gem5
{
/*
* --- AddressManager has 3 main tasks ---
* (1) generate DRF request sequences
@@ -271,4 +274,6 @@ class AddressManager
LogTable logTable;
};
} // namespace gem5
#endif /* CPU_TESTERS_PROTOCOL_TESTER_ADDRESS_MANAGER_HH_ */

View File

@@ -35,6 +35,9 @@
#include "debug/ProtocolTest.hh"
namespace gem5
{
CpuThread::CpuThread(const Params &p)
: TesterThread(p)
{
@@ -115,3 +118,5 @@ CpuThread::hitCallback(PacketPtr pkt)
{
fatal("CpuThread::hitCallback - not yet implemented");
}
} // namespace gem5

View File

@@ -38,6 +38,9 @@
#include "params/CpuThread.hh"
#include "sim/clocked_object.hh"
namespace gem5
{
class CpuThread : public TesterThread
{
public:
@@ -58,4 +61,6 @@ class CpuThread : public TesterThread
void issueReleaseOp();
};
} // namespace gem5
#endif /* CPU_TESTERS_PROTOCOL_TESTER_CPU_THREAD_HH_ */

View File

@@ -35,6 +35,9 @@
#include "debug/ProtocolTest.hh"
namespace gem5
{
DmaThread::DmaThread(const Params& _params)
: TesterThread(_params)
{
@@ -287,3 +290,5 @@ DmaThread::hitCallback(PacketPtr pkt)
scheduleWakeup();
}
}
} // namespace gem5

View File

@@ -37,6 +37,9 @@
#include "cpu/testers/gpu_ruby_test/tester_thread.hh"
#include "params/DmaThread.hh"
namespace gem5
{
class DmaThread : public TesterThread
{
public:
@@ -57,4 +60,6 @@ class DmaThread : public TesterThread
void issueReleaseOp();
};
} // namespace gem5
#endif /* CPU_TESTERS_PROTOCOL_TESTER_DMATHREAD_HH_ */

View File

@@ -39,6 +39,9 @@
#include "cpu/testers/gpu_ruby_test/protocol_tester.hh"
#include "cpu/testers/gpu_ruby_test/tester_thread.hh"
namespace gem5
{
Episode::Episode(ProtocolTester* _tester, TesterThread* _thread, int num_loads,
int num_stores)
: tester(_tester),
@@ -319,3 +322,5 @@ Episode::Action::printType() const
else
panic("Invalid action type\n");
}
} // namespace gem5

View File

@@ -38,6 +38,9 @@
#include "cpu/testers/gpu_ruby_test/address_manager.hh"
namespace gem5
{
class ProtocolTester;
class TesterThread;
@@ -125,4 +128,6 @@ class Episode
void initActions();
};
} // namespace gem5
#endif /* CPU_TESTERS_PROTOCOL_TESTER_EPISODE_HH_ */

View File

@@ -35,6 +35,9 @@
#include "debug/ProtocolTest.hh"
namespace gem5
{
GpuWavefront::GpuWavefront(const Params &p)
: TesterThread(p), cuId(p.cu_id)
{
@@ -369,3 +372,5 @@ GpuWavefront::setExtraRequestFlags(RequestPtr req)
{
// No extra request flag is set
}
} // namespace gem5

View File

@@ -38,6 +38,9 @@
#include "params/GpuWavefront.hh"
#include "sim/clocked_object.hh"
namespace gem5
{
class GpuWavefront : public TesterThread
{
public:
@@ -65,4 +68,6 @@ class GpuWavefront : public TesterThread
int cuId; // compute unit associated with this wavefront
};
} // namespace gem5
#endif /* CPU_TESTERS_PROTOCOL_TESTER_GPU_WAVEFRONT_HH_ */

View File

@@ -47,6 +47,9 @@
#include "sim/sim_exit.hh"
#include "sim/system.hh"
namespace gem5
{
ProtocolTester::ProtocolTester(const Params &p)
: ClockedObject(p),
_requestorId(p.system->getRequestorId(this)),
@@ -357,3 +360,5 @@ ProtocolTester::SeqPort::recvTimingResp(PacketPtr pkt)
return true;
}
} // namespace gem5

View File

@@ -61,6 +61,9 @@
#include "mem/token_port.hh"
#include "params/ProtocolTester.hh"
namespace gem5
{
class TesterThread;
class CpuThread;
class GpuWavefront;
@@ -198,4 +201,6 @@ class ProtocolTester : public ClockedObject
OutputStream* logFile;
};
} // namespace gem5
#endif /* CPU_TESTERS_PROTOCOL_TESTER_PROTOCOL_TESTER_HH_ */

View File

@@ -43,6 +43,9 @@
#include "dev/dma_device.hh"
#include "params/TesterDma.hh"
namespace gem5
{
class TesterDma : public DmaDevice
{
public:
@@ -65,4 +68,6 @@ class TesterDma : public DmaDevice
Tick write(PacketPtr) override { return 10; }
};
} // namespace gem5
#endif /* __CPU_TESTERS_GPU_RUBY_TEST_TESTER_DMA_HH__ */

View File

@@ -37,6 +37,9 @@
#include "debug/ProtocolTest.hh"
namespace gem5
{
TesterThread::TesterThread(const Params &p)
: ClockedObject(p),
threadEvent(this, "TesterThread tick"),
@@ -444,3 +447,5 @@ TesterThread::printAllOutstandingReqs(std::stringstream& ss) const
ss << "\t\tNumber of outstanding acquires & releases: "
<< pendingFenceCount << std::endl;
}
} // namespace gem5

View File

@@ -45,6 +45,9 @@
#include "mem/token_port.hh"
#include "sim/clocked_object.hh"
namespace gem5
{
class TesterThread : public ClockedObject
{
public:
@@ -204,4 +207,6 @@ class TesterThread : public ClockedObject
std::stringstream& ss) const;
};
} // namespace gem5
#endif /* CPU_TESTERS_PROTOCOL_TESTER_TESTER_THREAD_HH_ */