43b026f3f9690bb78b357a062133858931632932
The GEM5_DEPRECATED_NAMESPACE macro temporarily declares a namespace with the deprecated name that prints a warning message when used. It also make sure that when the old namespace name is used the new name is referenced. The GEM5_DEPRECATED_CLASS macro deprecates classes that were renamed, or moved to different namespaces. Attributes in namespaces are an issue, though. - Clang only allows from version 6 on, and only when using C++17. - GCC has a bug before version 10 where the deprecated attribute was not properly recognized in namespaces: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79817 Possible solutions for GCC < 10: 1) \#define GEM5_DEPRECATED_NAMESPACE() \ namespace gem5 { namespace deprecated { \ auto namespace_##old_namespace = [](){ \ GEM5_DEPRECATED("Please use the new namespace: '" \ \#new_namespace "'") \ int old_namespace; \ return old_namespace; \ }; \ }} \ namespace new_namespace {} \ namespace old_namespace { \ using namespace new_namespace; \ } Add the above macro to all headers that previously declared the deprecated namespace to trigger a warning. This is extremely inconvenient because every file that includes that header will trigger the deprecation warning, so the compilation output gets VERY clogged. 2) Similar to 1), but do not use the temporary variable on declaration. This would require using the variable somewhere else, like a respective .c file. This is not always possible, so we could resort to adding a special file (e.g., base/deprecated_elements.cc) containing all uses of the deprecated temporary variables. 3) \#define GEM5_DEPRECATED_NAMESPACE(old_ns, new_ns) \ namespace old_ns = new_ns; Similar to 3), but simply declare an alias in the header files (see above macro) to maintain backwards compatibility. Then use the special file to declare all deprecation messages. 4) Rely on release notes / e-mail to the mailing list to inform that those are deprecated. We have selected option 4 for these problematic instances. Checking if namespace deprecation is possible is done through scons. Jira issues: https://gem5.atlassian.net/browse/GEM5-975 https://gem5.atlassian.net/browse/GEM5-991 Change-Id: Ide234f6a8707d88a869fa843bf8c61ca7714e4f3 Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45246 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This is the gem5 simulator. The main website can be found at http://www.gem5.org A good starting point is http://www.gem5.org/about, and for more information about building the simulator and getting started please see http://www.gem5.org/documentation and http://www.gem5.org/documentation/learning_gem5/introduction. To build gem5, you will need the following software: g++ or clang, Python (gem5 links in the Python interpreter), SCons, SWIG, zlib, m4, and lastly protobuf if you want trace capture and playback support. Please see http://www.gem5.org/documentation/general_docs/building for more details concerning the minimum versions of the aforementioned tools. Once you have all dependencies resolved, type 'scons build/<ARCH>/gem5.opt' where ARCH is one of ARM, NULL, MIPS, POWER, SPARC, or X86. This will build an optimized version of the gem5 binary (gem5.opt) for the the specified architecture. See http://www.gem5.org/documentation/general_docs/building for more details and options. The basic source release includes these subdirectories: - configs: example simulation configuration scripts - ext: less-common external packages needed to build gem5 - src: source code of the gem5 simulator - system: source for some optional system software for simulated systems - tests: regression tests - util: useful utility programs and files To run full-system simulations, you will need compiled system firmware (console and PALcode for Alpha), kernel binaries and one or more disk images. If you have questions, please send mail to gem5-users@gem5.org Enjoy using gem5 and please share your modifications and extensions.
Description